aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorBecky Bruce <becky.bruce@freescale.com>2008-06-09 20:37:18 -0500
committerWolfgang Denk <wd@denx.de>2008-06-12 00:56:39 +0200
commit391fd93ab23e15ab3dd58a54f5b609024009c378 (patch)
treecbecdac5275d3ee048a0f0402042437b60e816d6 /common
parent61b09fc2952dc636017df4e7970e3de132276ba1 (diff)
downloadu-boot-linaro-natty-391fd93ab23e15ab3dd58a54f5b609024009c378.tar.gz
Change lmb to use phys_size_t/phys_addr_t
This updates the lmb code to use phys_size_t and phys_addr_t instead of unsigned long. Other code which interacts with this code, like getenv_bootm_size() is also updated. Booted on MPC8641HPCN, build-tested ppc, arm, mips. Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
Diffstat (limited to 'common')
-rw-r--r--common/cmd_bootm.c5
-rw-r--r--common/image.c17
2 files changed, 14 insertions, 8 deletions
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 0d6713236..959689ea7 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -127,7 +127,8 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
ulong os_data, os_len;
ulong image_start, image_end;
ulong load_start, load_end;
- ulong mem_start, mem_size;
+ ulong mem_start;
+ phys_size_t mem_size;
struct lmb lmb;
@@ -141,7 +142,7 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
mem_start = getenv_bootm_low();
mem_size = getenv_bootm_size();
- lmb_add(&lmb, mem_start, mem_size);
+ lmb_add(&lmb, (phys_addr_t)mem_start, mem_size);
board_lmb_reserve(&lmb);
diff --git a/common/image.c b/common/image.c
index 918802480..ddd9e8ba0 100644
--- a/common/image.c
+++ b/common/image.c
@@ -435,11 +435,16 @@ ulong getenv_bootm_low(void)
#endif
}
-ulong getenv_bootm_size(void)
+phys_size_t getenv_bootm_size(void)
{
char *s = getenv ("bootm_size");
if (s) {
- ulong tmp = simple_strtoul (s, NULL, 16);
+ phys_size_t tmp;
+#ifdef CFG_64BIT_STRTOUL
+ tmp = (phys_size_t)simple_strtoull (s, NULL, 16);
+#else
+ tmp = (phys_size_t)simple_strtoul (s, NULL, 16);
+#endif
return tmp;
}
@@ -1034,9 +1039,9 @@ int boot_ramdisk_high (struct lmb *lmb, ulong rd_data, ulong rd_len,
lmb_reserve(lmb, rd_data, rd_len);
} else {
if (initrd_high)
- *initrd_start = lmb_alloc_base (lmb, rd_len, 0x1000, initrd_high);
+ *initrd_start = (ulong)lmb_alloc_base (lmb, rd_len, 0x1000, initrd_high);
else
- *initrd_start = lmb_alloc (lmb, rd_len, 0x1000);
+ *initrd_start = (ulong)lmb_alloc (lmb, rd_len, 0x1000);
if (*initrd_start == 0) {
puts ("ramdisk - allocation error\n");
@@ -1089,7 +1094,7 @@ int boot_get_cmdline (struct lmb *lmb, ulong *cmd_start, ulong *cmd_end,
char *cmdline;
char *s;
- cmdline = (char *)lmb_alloc_base(lmb, CFG_BARGSIZE, 0xf,
+ cmdline = (char *)(ulong)lmb_alloc_base(lmb, CFG_BARGSIZE, 0xf,
CFG_BOOTMAPSZ + bootmap_base);
if (cmdline == NULL)
@@ -1125,7 +1130,7 @@ int boot_get_cmdline (struct lmb *lmb, ulong *cmd_start, ulong *cmd_end,
*/
int boot_get_kbd (struct lmb *lmb, bd_t **kbd, ulong bootmap_base)
{
- *kbd = (bd_t *)lmb_alloc_base(lmb, sizeof(bd_t), 0xf,
+ *kbd = (bd_t *)(ulong)lmb_alloc_base(lmb, sizeof(bd_t), 0xf,
CFG_BOOTMAPSZ + bootmap_base);
if (*kbd == NULL)
return -1;