[PATCH u-boot] MAC needs to be stopped after starting

OpenBMC Patches openbmc-patches at stwcx.xyz
Sat Mar 12 01:20:44 AEDT 2016


From: Norman James <njames at us.ibm.com>

We found that u-boot network was corrupting kernel memory.
This is because aspeednic_init is called at startup,
but if the u-boot network is not used, the network driver
is not cleaned up.  This fix is a temporary hack and just calls
the halt function after the init. This driver needs to be
reworked to not start network initially and use set_hwaddr hook
to setup MAC address.

Signed-off-by: Norman James <nkskjames at gmail.com>
---
 drivers/net/aspeednic.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/aspeednic.c b/drivers/net/aspeednic.c
index d70c7ab..a870c4a 100644
--- a/drivers/net/aspeednic.c
+++ b/drivers/net/aspeednic.c
@@ -580,6 +580,7 @@ int aspeednic_initialize(bd_t *bis)
 #if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
   miiphy_register(dev->name, faraday_mdio_read, faraday_mdio_write);
 #endif
+  dev->halt(dev);
 
   return 1;
 }
@@ -1359,6 +1360,7 @@ static int aspeednic_recv(struct eth_device* dev)
 
 static void aspeednic_halt(struct eth_device* dev)
 {
+  printf("Stopping Network\n");
   STOP_MAC(dev);
 }
 
-- 
2.7.1




More information about the openbmc mailing list