From d6ac2ed893c2168738aee01579d6283af8d37045 Mon Sep 17 00:00:00 2001 From: Scott Wood Date: Thu, 22 May 2008 10:49:46 -0500 Subject: Remove prototypes of nand_init() in favor of including nand.h. Likewise with onenand_init(). Signed-off-by: Scott Wood --- lib_ppc/board.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'lib_ppc') diff --git a/lib_ppc/board.c b/lib_ppc/board.c index 4956403..6f7242d 100644 --- a/lib_ppc/board.c +++ b/lib_ppc/board.c @@ -93,9 +93,7 @@ void doc_init (void); #if defined(CONFIG_HARD_SPI) #include #endif -#if defined(CONFIG_CMD_NAND) -void nand_init (void); -#endif +#include static char *failed = "*** failed ***\n"; -- cgit v1.1 From c148f24c15743a02e855636e6bed013bd121f7f2 Mon Sep 17 00:00:00 2001 From: Becky Bruce Date: Thu, 15 May 2008 21:29:04 -0500 Subject: PPC: Change lib_ppc/bat_rw.c to use high bats Currently, this code only deals with BATs 0-3, which makes it useless on systems that support BATs 4-7. Add the support for these registers. Signed-off-by: Becky Bruce --- lib_ppc/bat_rw.c | 132 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 92 insertions(+), 40 deletions(-) (limited to 'lib_ppc') diff --git a/lib_ppc/bat_rw.c b/lib_ppc/bat_rw.c index 912efa7..5f01a63 100644 --- a/lib_ppc/bat_rw.c +++ b/lib_ppc/bat_rw.c @@ -29,46 +29,72 @@ int write_bat (ppc_bat_t bat, unsigned long upper, unsigned long lower) { switch (bat) { + case DBAT0: + mtspr (DBAT0L, lower); + mtspr (DBAT0U, upper); + break; case IBAT0: mtspr (IBAT0L, lower); mtspr (IBAT0U, upper); break; - + case DBAT1: + mtspr (DBAT1L, lower); + mtspr (DBAT1U, upper); + break; case IBAT1: mtspr (IBAT1L, lower); mtspr (IBAT1U, upper); break; - + case DBAT2: + mtspr (DBAT2L, lower); + mtspr (DBAT2U, upper); + break; case IBAT2: mtspr (IBAT2L, lower); mtspr (IBAT2U, upper); break; - + case DBAT3: + mtspr (DBAT3L, lower); + mtspr (DBAT3U, upper); + break; case IBAT3: mtspr (IBAT3L, lower); mtspr (IBAT3U, upper); break; - - case DBAT0: - mtspr (DBAT0L, lower); - mtspr (DBAT0U, upper); +#ifdef CONFIG_HIGH_BATS + case DBAT4: + mtspr (DBAT4L, lower); + mtspr (DBAT4U, upper); break; - - case DBAT1: - mtspr (DBAT1L, lower); - mtspr (DBAT1U, upper); + case IBAT4: + mtspr (IBAT4L, lower); + mtspr (IBAT4U, upper); break; - - case DBAT2: - mtspr (DBAT2L, lower); - mtspr (DBAT2U, upper); + case DBAT5: + mtspr (DBAT5L, lower); + mtspr (DBAT5U, upper); break; - - case DBAT3: - mtspr (DBAT3L, lower); - mtspr (DBAT3U, upper); + case IBAT5: + mtspr (IBAT5L, lower); + mtspr (IBAT5U, upper); break; - + case DBAT6: + mtspr (DBAT6L, lower); + mtspr (DBAT6U, upper); + break; + case IBAT6: + mtspr (IBAT6L, lower); + mtspr (IBAT6U, upper); + break; + case DBAT7: + mtspr (DBAT7L, lower); + mtspr (DBAT7U, upper); + break; + case IBAT7: + mtspr (IBAT7L, lower); + mtspr (IBAT7U, upper); + break; +#endif default: return (-1); } @@ -82,46 +108,72 @@ int read_bat (ppc_bat_t bat, unsigned long *upper, unsigned long *lower) unsigned long register l; switch (bat) { + case DBAT0: + l = mfspr (DBAT0L); + u = mfspr (DBAT0U); + break; case IBAT0: l = mfspr (IBAT0L); u = mfspr (IBAT0U); break; - + case DBAT1: + l = mfspr (DBAT1L); + u = mfspr (DBAT1U); + break; case IBAT1: l = mfspr (IBAT1L); u = mfspr (IBAT1U); break; - + case DBAT2: + l = mfspr (DBAT2L); + u = mfspr (DBAT2U); + break; case IBAT2: l = mfspr (IBAT2L); u = mfspr (IBAT2U); break; - + case DBAT3: + l = mfspr (DBAT3L); + u = mfspr (DBAT3U); + break; case IBAT3: l = mfspr (IBAT3L); u = mfspr (IBAT3U); break; - - case DBAT0: - l = mfspr (DBAT0L); - u = mfspr (DBAT0U); +#ifdef CONFIG_HIGH_BATS + case DBAT4: + l = mfspr (DBAT4L); + u = mfspr (DBAT4U); break; - - case DBAT1: - l = mfspr (DBAT1L); - u = mfspr (DBAT1U); + case IBAT4: + l = mfspr (IBAT4L); + u = mfspr (IBAT4U); break; - - case DBAT2: - l = mfspr (DBAT2L); - u = mfspr (DBAT2U); + case DBAT5: + l = mfspr (DBAT5L); + u = mfspr (DBAT5U); break; - - case DBAT3: - l = mfspr (DBAT3L); - u = mfspr (DBAT3U); + case IBAT5: + l = mfspr (IBAT5L); + u = mfspr (IBAT5U); break; - + case DBAT6: + l = mfspr (DBAT6L); + u = mfspr (DBAT6U); + break; + case IBAT6: + l = mfspr (IBAT6L); + u = mfspr (IBAT6U); + break; + case DBAT7: + l = mfspr (DBAT7L); + u = mfspr (DBAT7U); + break; + case IBAT7: + l = mfspr (IBAT7L); + u = mfspr (IBAT7U); + break; +#endif default: return (-1); } -- cgit v1.1 From d5b9b8cdb8b6eb3a8b0f5d9909d69ccc9c703ed9 Mon Sep 17 00:00:00 2001 From: Becky Bruce Date: Fri, 9 May 2008 15:41:35 -0500 Subject: PPC: Add print_bats() to lib_ppc/bat_rw.c This function prints the values of all the BAT register pairs - I needed this for debug earlier this week; adding it to lib_ppc so others can use it (and add it to reginfo commands if so desired). Signed-off-by: Becky Bruce --- lib_ppc/bat_rw.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'lib_ppc') diff --git a/lib_ppc/bat_rw.c b/lib_ppc/bat_rw.c index 5f01a63..8546333 100644 --- a/lib_ppc/bat_rw.c +++ b/lib_ppc/bat_rw.c @@ -183,3 +183,44 @@ int read_bat (ppc_bat_t bat, unsigned long *upper, unsigned long *lower) return (0); } + +void print_bats(void) +{ + printf("BAT registers:\n"); + + printf ("\tIBAT0L = 0x%08X ", mfspr (IBAT0L)); + printf ("\tIBAT0U = 0x%08X\n", mfspr (IBAT0U)); + printf ("\tDBAT0L = 0x%08X ", mfspr (DBAT0L)); + printf ("\tDBAT0U = 0x%08X\n", mfspr (DBAT0U)); + printf ("\tIBAT1L = 0x%08X ", mfspr (IBAT1L)); + printf ("\tIBAT1U = 0x%08X\n", mfspr (IBAT1U)); + printf ("\tDBAT1L = 0x%08X ", mfspr (DBAT1L)); + printf ("\tDBAT1U = 0x%08X\n", mfspr (DBAT1U)); + printf ("\tIBAT2L = 0x%08X ", mfspr (IBAT2L)); + printf ("\tIBAT2U = 0x%08X\n", mfspr (IBAT2U)); + printf ("\tDBAT2L = 0x%08X ", mfspr (DBAT2L)); + printf ("\tDBAT2U = 0x%08X\n", mfspr (DBAT2U)); + printf ("\tIBAT3L = 0x%08X ", mfspr (IBAT3L)); + printf ("\tIBAT3U = 0x%08X\n", mfspr (IBAT3U)); + printf ("\tDBAT3L = 0x%08X ", mfspr (DBAT3L)); + printf ("\tDBAT3U = 0x%08X\n", mfspr (DBAT3U)); + +#ifdef CONFIG_HIGH_BATS + printf ("\tIBAT4L = 0x%08X ", mfspr (IBAT4L)); + printf ("\tIBAT4U = 0x%08X\n", mfspr (IBAT4U)); + printf ("\tDBAT4L = 0x%08X ", mfspr (DBAT4L)); + printf ("\tDBAT4U = 0x%08X\n", mfspr (DBAT4U)); + printf ("\tIBAT5L = 0x%08X ", mfspr (IBAT5L)); + printf ("\tIBAT5U = 0x%08X\n", mfspr (IBAT5U)); + printf ("\tDBAT5L = 0x%08X ", mfspr (DBAT5L)); + printf ("\tDBAT5U = 0x%08X\n", mfspr (DBAT5U)); + printf ("\tIBAT6L = 0x%08X ", mfspr (IBAT6L)); + printf ("\tIBAT6U = 0x%08X\n", mfspr (IBAT6U)); + printf ("\tDBAT6L = 0x%08X ", mfspr (DBAT6L)); + printf ("\tDBAT6U = 0x%08X\n", mfspr (DBAT6U)); + printf ("\tIBAT7L = 0x%08X ", mfspr (IBAT7L)); + printf ("\tIBAT7U = 0x%08X\n", mfspr (IBAT7U)); + printf ("\tDBAT7L = 0x%08X ", mfspr (DBAT7L)); + printf ("\tDBAT7U = 0x%08X\n", mfspr (DBAT7U)); +#endif +} -- cgit v1.1 From 95d449ad4de79dd32b1705b8a4d3550f1e9081e3 Mon Sep 17 00:00:00 2001 From: Marian Balakowicz Date: Tue, 13 May 2008 15:53:29 +0200 Subject: Avoid initrd and logbuffer area overlaps Add logbuffer to reserved LMB areas to prevent initrd allocation from overlaping with it. Make sure to use correct logbuffer base address. Signed-off-by: Marian Balakowicz --- lib_ppc/board.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib_ppc') diff --git a/lib_ppc/board.c b/lib_ppc/board.c index 6f7242d..a908831 100644 --- a/lib_ppc/board.c +++ b/lib_ppc/board.c @@ -396,6 +396,13 @@ ulong get_effective_memsize(void) ************************************************************************ */ +#ifdef CONFIG_LOGBUFFER +unsigned long logbuffer_base(void) +{ + return CFG_SDRAM_BASE + get_effective_memsize() - LOGBUFF_LEN; +} +#endif + void board_init_f (ulong bootflag) { bd_t *bd; -- cgit v1.1 From e489b9c078e22b0d9e75f002cd2a1bd967e88f5e Mon Sep 17 00:00:00 2001 From: Kim Phillips Date: Tue, 10 Jun 2008 11:06:17 -0500 Subject: fdt: unshadow global working fdt variable differentiate with local variables of the same name by renaming the global 'fdt' variable 'working_fdt'. Signed-off-by: Kim Phillips --- lib_ppc/bootm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib_ppc') diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c index 9194fd8..0421ce4 100644 --- a/lib_ppc/bootm.c +++ b/lib_ppc/bootm.c @@ -750,7 +750,7 @@ static int boot_relocate_fdt (struct lmb *lmb, ulong bootmap_base, *of_flat_tree = (char *)of_start; } else { *of_flat_tree = fdt_blob; - lmb_reserve(lmb, (ulong)fdt, of_len); + lmb_reserve(lmb, (ulong)working_fdt, of_len); } return 0; -- cgit v1.1 From f060054dadbbe7027ca088eed806a3ef1f82fdb7 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Wed, 11 Jun 2008 00:44:10 -0500 Subject: FSL LAW: Keep track of LAW allocations Make it so we keep track of which LAWs have allocated and provide a function (set_next_law) which can allocate a LAW for us if one is free. In the future we will move to doing more "dynamic" LAW allocation since the majority of users dont really care about what LAW number they are at. Also, add CONFIG_MPC8540 or CONFIG_MPC8560 to those boards which needed them Signed-off-by: Kumar Gala Signed-off-by: Andy Fleming --- lib_ppc/board.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib_ppc') diff --git a/lib_ppc/board.c b/lib_ppc/board.c index a908831..c42e088 100644 --- a/lib_ppc/board.c +++ b/lib_ppc/board.c @@ -421,7 +421,8 @@ void board_init_f (ulong bootflag) /* compiler optimization barrier needed for GCC >= 3.4 */ __asm__ __volatile__("": : :"memory"); -#if !defined(CONFIG_CPM2) && !defined(CONFIG_MPC83XX) +#if !defined(CONFIG_CPM2) && !defined(CONFIG_MPC83XX) && \ + !defined(CONFIG_MPC85xx) && !defined(CONFIG_MPC86xx) /* Clear initial global data */ memset ((void *) gd, 0, sizeof (gd_t)); #endif -- cgit v1.1 From 391fd93ab23e15ab3dd58a54f5b609024009c378 Mon Sep 17 00:00:00 2001 From: Becky Bruce Date: Mon, 9 Jun 2008 20:37:18 -0500 Subject: 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 --- lib_ppc/bootm.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'lib_ppc') diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c index 0421ce4..10a0b12 100644 --- a/lib_ppc/bootm.c +++ b/lib_ppc/bootm.c @@ -71,6 +71,7 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], ulong initrd_start, initrd_end; ulong rd_data_start, rd_data_end, rd_len; ulong size; + phys_size_t bootm_size; ulong cmd_start, cmd_end, bootmap_base; bd_t *kbd; @@ -85,22 +86,23 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], #endif bootmap_base = getenv_bootm_low(); - size = getenv_bootm_size(); + bootm_size = getenv_bootm_size(); #ifdef DEBUG - if (((u64)bootmap_base + size) > (CFG_SDRAM_BASE + (u64)gd->ram_size)) + if (((u64)bootmap_base + bootm_size) > + (CFG_SDRAM_BASE + (u64)gd->ram_size)) puts("WARNING: bootm_low + bootm_size exceed total memory\n"); - if ((bootmap_base + size) > get_effective_memsize()) + if ((bootmap_base + bootm_size) > get_effective_memsize()) puts("WARNING: bootm_low + bootm_size exceed eff. memory\n"); #endif - size = min(size, get_effective_memsize()); + size = min(bootm_size, get_effective_memsize()); size = min(size, CFG_LINUX_LOWMEM_MAX_SIZE); - if (size < getenv_bootm_size()) { + if (size < bootm_size) { ulong base = bootmap_base + size; printf("WARNING: adjusting available memory to %x\n", size); - lmb_reserve(lmb, base, getenv_bootm_size() - size); + lmb_reserve(lmb, base, bootm_size - size); } /* @@ -725,7 +727,7 @@ static int boot_relocate_fdt (struct lmb *lmb, ulong bootmap_base, ulong of_start; /* position on a 4K boundary before the alloc_current */ - of_start = lmb_alloc_base(lmb, of_len, 0x1000, + of_start = (unsigned long)lmb_alloc_base(lmb, of_len, 0x1000, (CFG_BOOTMAPSZ + bootmap_base)); if (of_start == 0) { -- cgit v1.1 From 41c5eaa7253ed82bbae1eda5667755872c615164 Mon Sep 17 00:00:00 2001 From: Andy Fleming Date: Mon, 16 Jun 2008 13:58:56 -0500 Subject: Resize device tree to allow space for board changes and the chosen node Current code requires that a compiled device tree have space added to the end to leave room for extra nodes added by board code (and the chosen node). This requires that device tree creators anticipate how much space U-Boot will add to the tree, which is absurd. Ideally, the code would resize and/or relocate the tree when it needed more space, but this would require a systemic change to the fdt code, which is non-trivial. Instead, we resize the tree inside boot_relocate_fdt, reserving either the remainder of the bootmap (in the case where the fdt is inside the bootmap), or adding CFG_FDT_PAD bytes to the size. Signed-off-by: Andy Fleming --- lib_ppc/bootm.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 58 insertions(+), 8 deletions(-) (limited to 'lib_ppc') diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c index 10a0b12..9db1c2e 100644 --- a/lib_ppc/bootm.c +++ b/lib_ppc/bootm.c @@ -51,6 +51,10 @@ static int boot_relocate_fdt (struct lmb *lmb, ulong bootmap_base, #include #endif +#ifndef CFG_FDT_PAD +#define CFG_FDT_PAD 0x3000 +#endif + DECLARE_GLOBAL_DATA_PTR; extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); @@ -191,6 +195,44 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], ft_board_setup(of_flat_tree, gd->bd); #endif } + + /* Fixup the fdt memreserve now that we know how big it is */ + if (of_flat_tree) { + int j; + uint64_t addr, size; + int total = fdt_num_mem_rsv(of_flat_tree); + uint actualsize; + + for (j = 0; j < total; j++) { + fdt_get_mem_rsv(of_flat_tree, j, &addr, &size); + if (addr == (uint64_t)of_flat_tree) { + fdt_del_mem_rsv(of_flat_tree, j); + break; + } + } + + /* Delete the old LMB reservation */ + lmb_free(lmb, of_flat_tree, fdt_totalsize(of_flat_tree)); + + /* Calculate the actual size of the fdt */ + actualsize = fdt_off_dt_strings(of_flat_tree) + + fdt_size_dt_strings(of_flat_tree); + + /* Make it so the fdt ends on a page boundary */ + actualsize = ALIGN(actualsize, 0x1000); + actualsize = actualsize - ((uint)of_flat_tree & 0xfff); + + /* Change the fdt header to reflect the correct size */ + fdt_set_totalsize(of_flat_tree, actualsize); + of_size = actualsize; + + /* Add the new reservation */ + ret = fdt_add_mem_rsv(of_flat_tree, (uint)of_flat_tree, + of_size); + + /* Create a new LMB reservation */ + lmb_reserve(lmb, (ulong)of_flat_tree, of_size); + } #endif /* CONFIG_OF_LIBFDT */ ret = boot_ramdisk_high (lmb, rd_data_start, rd_len, &initrd_start, &initrd_end); @@ -713,22 +755,25 @@ static int boot_relocate_fdt (struct lmb *lmb, ulong bootmap_base, #endif /* - * The blob must be within CFG_BOOTMAPSZ, - * so we flag it to be copied if it is not. + * The blob needs to be inside the boot mapping. */ - if (fdt_blob >= (char *)CFG_BOOTMAPSZ) + if (fdt_blob < (char *)bootmap_base) relocate = 1; - of_len = be32_to_cpu (fdt_totalsize (fdt_blob)); + if ((fdt_blob + *of_size + CFG_FDT_PAD) >= + ((char *)CFG_BOOTMAPSZ + bootmap_base)) + relocate = 1; /* move flattend device tree if needed */ if (relocate) { int err; - ulong of_start; + ulong of_start = 0; /* position on a 4K boundary before the alloc_current */ + /* Pad the FDT by a specified amount */ + of_len = *of_size + CFG_FDT_PAD; of_start = (unsigned long)lmb_alloc_base(lmb, of_len, 0x1000, - (CFG_BOOTMAPSZ + bootmap_base)); + (CFG_BOOTMAPSZ + bootmap_base)); if (of_start == 0) { puts("device tree - allocation error\n"); @@ -736,7 +781,7 @@ static int boot_relocate_fdt (struct lmb *lmb, ulong bootmap_base, } debug ("## device tree at 0x%08lX ... 0x%08lX (len=%ld=0x%lX)\n", - (ulong)fdt_blob, (ulong)fdt_blob + of_len - 1, + (ulong)fdt_blob, (ulong)fdt_blob + *of_size - 1, of_len, of_len); printf (" Loading Device Tree to %08lx, end %08lx ... ", @@ -750,9 +795,14 @@ static int boot_relocate_fdt (struct lmb *lmb, ulong bootmap_base, puts ("OK\n"); *of_flat_tree = (char *)of_start; + *of_size = of_len; } else { *of_flat_tree = fdt_blob; - lmb_reserve(lmb, (ulong)working_fdt, of_len); + of_len = (CFG_BOOTMAPSZ + bootmap_base) - (ulong)fdt_blob; + lmb_reserve(lmb, (ulong)fdt_blob, of_len); + fdt_set_totalsize(*of_flat_tree, of_len); + + *of_size = of_len; } return 0; -- cgit v1.1 From f8cc312bbee69257d741dc9f4062f4a0f5adf609 Mon Sep 17 00:00:00 2001 From: Ben Warren Date: Sun, 8 Jun 2008 23:28:33 -0700 Subject: Move conditional compilation of MPC8XXX SPI driver to Makefile Signed-off-by: Ben Warren --- lib_ppc/board.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'lib_ppc') diff --git a/lib_ppc/board.c b/lib_ppc/board.c index c42e088..96c573c 100644 --- a/lib_ppc/board.c +++ b/lib_ppc/board.c @@ -90,9 +90,7 @@ void doc_init (void); defined(CONFIG_SOFT_I2C) #include #endif -#if defined(CONFIG_HARD_SPI) #include -#endif #include static char *failed = "*** failed ***\n"; -- cgit v1.1 From 730f298485984b011b6ee8f4acb511cb45a843dd Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Thu, 3 Jul 2008 22:04:17 +0200 Subject: lmb: fix "implicit declaration of function 'lmb_free'" warning Signed-off-by: Wolfgang Denk --- lib_ppc/bootm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib_ppc') diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c index 9db1c2e..3c1c18b 100644 --- a/lib_ppc/bootm.c +++ b/lib_ppc/bootm.c @@ -212,7 +212,7 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], } /* Delete the old LMB reservation */ - lmb_free(lmb, of_flat_tree, fdt_totalsize(of_flat_tree)); + lmb_free(lmb, (uint64_t)of_flat_tree, fdt_totalsize(of_flat_tree)); /* Calculate the actual size of the fdt */ actualsize = fdt_off_dt_strings(of_flat_tree) + -- cgit v1.1 From 9fea65a6c469b1b474b27446feb58738baba2d31 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Tue, 24 Jun 2008 09:54:09 +0200 Subject: ppc4xx: Rename CONFIG_XILINX_ML300 to CONFIG_XILINX_405 This change helps with better handling with others Xilinx based platform. Signed-off-by: Michal Simek Acked-by: Stefan Roese --- lib_ppc/board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib_ppc') diff --git a/lib_ppc/board.c b/lib_ppc/board.c index 96c573c..9afa88a 100644 --- a/lib_ppc/board.c +++ b/lib_ppc/board.c @@ -625,7 +625,7 @@ void board_init_f (ulong bootflag) defined(CONFIG_440EPX) || defined(CONFIG_440GRX) bd->bi_pci_busfreq = get_PCI_freq (); bd->bi_opbfreq = get_OPB_freq (); -#elif defined(CONFIG_XILINX_ML300) +#elif defined(CONFIG_XILINX_405) bd->bi_pci_busfreq = get_PCI_freq (); #endif #endif -- cgit v1.1 From dc4b0b38d4aadf08826f6c31270f1eecd27964fd Mon Sep 17 00:00:00 2001 From: Andrew Klossner Date: Mon, 7 Jul 2008 06:41:14 -0700 Subject: Fix printf errors. The compiler will help find mismatches between printf formats and arguments if you let it. This patch adds the necessary attributes to declarations in include/common.h, then begins to correct the resulting compiler warnings. Some of these were bugs, e.g., "$d" instead of "%d" and incorrect arguments. Others were just annoying, like int-long mismatches on a system where both are 32 bits. It's worth fixing the annoying errors to catch the real ones. Signed-off-by: Andrew Klossner --- lib_ppc/bootm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib_ppc') diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c index 3c1c18b..8d54675 100644 --- a/lib_ppc/bootm.c +++ b/lib_ppc/bootm.c @@ -105,7 +105,7 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], if (size < bootm_size) { ulong base = bootmap_base + size; - printf("WARNING: adjusting available memory to %x\n", size); + printf("WARNING: adjusting available memory to %lx\n", size); lmb_reserve(lmb, base, bootm_size - size); } @@ -672,7 +672,7 @@ static int boot_get_fdt (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], */ fdt_blob = (char *)fdt_addr; debug ("* fdt: raw FDT blob\n"); - printf ("## Flattened Device Tree blob at %08lx\n", fdt_blob); + printf ("## Flattened Device Tree blob at %08lx\n", (long)fdt_blob); } break; default: @@ -680,7 +680,7 @@ static int boot_get_fdt (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], goto error; } - printf (" Booting using the fdt blob at 0x%x\n", fdt_blob); + printf (" Booting using the fdt blob at 0x%x\n", (int)fdt_blob); } else if (images->legacy_hdr_valid && image_check_type (&images->legacy_hdr_os_copy, IH_TYPE_MULTI)) { @@ -699,7 +699,7 @@ static int boot_get_fdt (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], if (fdt_len) { fdt_blob = (char *)fdt_data; - printf (" Booting using the fdt at 0x%x\n", fdt_blob); + printf (" Booting using the fdt at 0x%x\n", (int)fdt_blob); if (fdt_check_header (fdt_blob) != 0) { fdt_error ("image is not a fdt"); -- cgit v1.1 From da8693a91b8eef75ade8de50a1b2ce035bc5fb54 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Mon, 7 Jul 2008 09:39:06 -0500 Subject: Fix compiler warnings gcc-4.3.x generates the following: bootm.c: In function 'do_bootm_linux': bootm.c:208: warning: cast from pointer to integer of different size bootm.c:215: warning: cast from pointer to integer of different size Signed-off-by: Kumar Gala --- lib_ppc/bootm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib_ppc') diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c index 8d54675..b0d224e 100644 --- a/lib_ppc/bootm.c +++ b/lib_ppc/bootm.c @@ -205,14 +205,14 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], for (j = 0; j < total; j++) { fdt_get_mem_rsv(of_flat_tree, j, &addr, &size); - if (addr == (uint64_t)of_flat_tree) { + if (addr == (uint64_t)(u32)of_flat_tree) { fdt_del_mem_rsv(of_flat_tree, j); break; } } /* Delete the old LMB reservation */ - lmb_free(lmb, (uint64_t)of_flat_tree, fdt_totalsize(of_flat_tree)); + lmb_free(lmb, (uint64_t)(u32)of_flat_tree, fdt_totalsize(of_flat_tree)); /* Calculate the actual size of the fdt */ actualsize = fdt_off_dt_strings(of_flat_tree) + -- cgit v1.1 From 98874ff329d4a5b32c467b43f6e966e1aa68479f Mon Sep 17 00:00:00 2001 From: Andy Fleming Date: Mon, 7 Jul 2008 14:24:39 -0500 Subject: Fix LMB type issues The LMB code now uses phys_addr_t and phys_size_t. Also, there were a couple of casting problems in the bootm code that called the LMB functions. Signed-off-by: Andy Fleming --- lib_ppc/bootm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib_ppc') diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c index b0d224e..81803dd 100644 --- a/lib_ppc/bootm.c +++ b/lib_ppc/bootm.c @@ -212,7 +212,8 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], } /* Delete the old LMB reservation */ - lmb_free(lmb, (uint64_t)(u32)of_flat_tree, fdt_totalsize(of_flat_tree)); + lmb_free(lmb, (phys_addr_t)(u32)of_flat_tree, + (phys_size_t)fdt_totalsize(of_flat_tree)); /* Calculate the actual size of the fdt */ actualsize = fdt_off_dt_strings(of_flat_tree) + -- cgit v1.1