From b2532eff87c73b11212dd63403ee9ae18c56b53a Mon Sep 17 00:00:00 2001
From: wdenk <wdenk>
Date: Mon, 20 Jun 2005 10:17:34 +0000
Subject: [PATCH] * Patch by Travis Sawyer, 10 Jun 2005:   Initialize allocated
 dev and private hw structures   after their respective allocation in
 440gx_enet.c

* Patch by Steven Scholz, 10 Jun 2005:
  Fix byteorder problems with second argument of "bootm" with
  standalone images;
---
 CHANGELOG               | 8 ++++++++
 common/cmd_bootm.c      | 2 +-
 cpu/ppc4xx/440gx_enet.c | 2 ++
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG b/CHANGELOG
index 83b13c460a..a504419d99 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,6 +2,14 @@
 Changes for U-Boot 1.1.3:
 ======================================================================
 
+* Patch by Travis Sawyer, 10 Jun 2005:
+  Initialize allocated dev and private hw structures
+  after their respective allocation in 440gx_enet.c
+
+* Patch by Steven Scholz, 10 Jun 2005:
+  Fix byteorder problems with second argument of "bootm" with
+  standalone images;
+
 * Add support for HMI1001 board
 
 * Disable "date" and "sntp" commands on TQM866M
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index cdb0c19b0b..a90735f3f2 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -261,7 +261,7 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 		name = "Standalone Application";
 		/* A second argument overwrites the load address */
 		if (argc > 2) {
-			hdr->ih_load = simple_strtoul(argv[2], NULL, 16);
+			hdr->ih_load = htonl(simple_strtoul(argv[2], NULL, 16));
 		}
 		break;
 	case IH_TYPE_KERNEL:
diff --git a/cpu/ppc4xx/440gx_enet.c b/cpu/ppc4xx/440gx_enet.c
index d1f4b76869..871f83b96e 100644
--- a/cpu/ppc4xx/440gx_enet.c
+++ b/cpu/ppc4xx/440gx_enet.c
@@ -1216,6 +1216,7 @@ int ppc_440x_eth_initialize (bd_t * bis)
 				"Cannot allocate eth_device %d\n", eth_num);
 			return (-1);
 		}
+		memset(dev, 0, sizeof(*dev));
 
 		/* Allocate our private use data */
 		hw = (EMAC_440GX_HW_PST) malloc (sizeof (*hw));
@@ -1226,6 +1227,7 @@ int ppc_440x_eth_initialize (bd_t * bis)
 			free (dev);
 			return (-1);
 		}
+		memset(hw, 0, sizeof(*hw));
 
 		switch (eth_num) {
 		default:		/* fall through */