소스 검색

MIPS: Implement ethernet halt for au1x00

Implement ethernet halt() by putting MAC0 in reset.
If we do not do this, we will get memory corruption
when ethernet frames are received during early OS boot.

Signed-off-by: Thomas Lange <thomas@corelatus.se>
Signed-off-by: Shinya Kuribayashi <skuribay@pobox.com>
Thomas Lange 16 년 전
부모
커밋
87423d740b
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      cpu/mips/au1x00_eth.c

+ 4 - 0
cpu/mips/au1x00_eth.c

@@ -276,6 +276,10 @@ static int au1x00_init(struct eth_device* dev, bd_t * bd){
 }
 
 static void au1x00_halt(struct eth_device* dev){
+	volatile u32 *macen = (volatile u32*)MAC0_ENABLE;
+
+	/* Put MAC0 in reset */
+	*macen = 0;
 }
 
 int au1x00_enet_initialize(bd_t *bis){