Skip to contentSkip to conversation

MIPS: Implement ethernet halt for au1x00

PATCH New Thomas Lange 2 participants 2 messages Apr 24, 2009 – May 3, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 cpu/mips/au1x00_eth.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
cpu/mips/au1x00_eth.c +4 -0
index 6272a3a..5074997 100644
@@ -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){
Signature · 1 line
1.5.6.5
#1 lore raw

PATCH 1/1 MIPS: Implement ethernet halt for au1x00

Quoted 14 lines · Thomas Lange

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.

---
 cpu/mips/au1x00_eth.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
cpu/mips/au1x00_eth.c +0 -0
index 6272a3a..5074997 100644

cpu/mips/au1x00_eth.c static int au1x00_init(struct eth_device* dev, bd_t * bd){ · line 285

Quoted 10 lines
cpu/mips/au1x00_eth.c +4 -0
@@ -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){

Wolfgang-san,

could you please pick up this patch directly? Thanks,

Shinya