u-boot: Apply patch to stop aspeednic dma
Apply Norm's mac-stop patch that calls the halt method after calling
the init method in the aspeednic initialize function.
While alternative patches exist that touch less hardware, this simple
patch will prevent the memory alteration when the network is not used
during u-boot.
Signed-off-by: Milton Miller <miltonm@us.ibm.com>
diff --git a/meta-openbmc-bsp/meta-aspeed/meta-ast2400/recipes-bsp/u-boot/files/aspeednic-mac-stop.patch b/meta-openbmc-bsp/meta-aspeed/meta-ast2400/recipes-bsp/u-boot/files/aspeednic-mac-stop.patch
new file mode 100644
index 0000000..bb53c40
--- /dev/null
+++ b/meta-openbmc-bsp/meta-aspeed/meta-ast2400/recipes-bsp/u-boot/files/aspeednic-mac-stop.patch
@@ -0,0 +1,36 @@
+commit a7517cfcebd9ea45d65b3fbc6438602dd28cae86
+Author: Norman James <njames@us.ibm.com>
+Commit: Norman James <njames@us.ibm.com>
+
+ MAC needs to be stopped after starting
+
+ 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@gmail.com>
+
+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);
+ }
+
diff --git a/meta-openbmc-bsp/meta-aspeed/meta-ast2400/recipes-bsp/u-boot/u-boot_2013.07%.bbappend b/meta-openbmc-bsp/meta-aspeed/meta-ast2400/recipes-bsp/u-boot/u-boot_2013.07%.bbappend
index 50adb9f..774419f 100644
--- a/meta-openbmc-bsp/meta-aspeed/meta-ast2400/recipes-bsp/u-boot/u-boot_2013.07%.bbappend
+++ b/meta-openbmc-bsp/meta-aspeed/meta-ast2400/recipes-bsp/u-boot/u-boot_2013.07%.bbappend
@@ -2,6 +2,7 @@
SRC_URI += "file://fw_env.config"
SRC_URI += "file://config.patch"
+SRC_URI += "file://aspeednic-mac-stop.patch"
# Do not install u-boot in rootfs
#do_install[postfuncs] += "remove_uboot_from_rootfs"