summaryrefslogtreecommitdiff
path: root/lib_ppc/bootm.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib_ppc/bootm.c')
-rw-r--r--lib_ppc/bootm.c70
1 files changed, 38 insertions, 32 deletions
diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c
index 38266e1..1f3501a 100644
--- a/lib_ppc/bootm.c
+++ b/lib_ppc/bootm.c
@@ -41,7 +41,7 @@
#endif
-#ifdef CFG_INIT_RAM_LOCK
+#ifdef CONFIG_SYS_INIT_RAM_LOCK
#include <asm/cache.h>
#endif
@@ -51,48 +51,28 @@ extern ulong get_effective_memsize(void);
static ulong get_sp (void);
static void set_clocks_in_mhz (bd_t *kbd);
-#ifndef CFG_LINUX_LOWMEM_MAX_SIZE
-#define CFG_LINUX_LOWMEM_MAX_SIZE (768*1024*1024)
+#ifndef CONFIG_SYS_LINUX_LOWMEM_MAX_SIZE
+#define CONFIG_SYS_LINUX_LOWMEM_MAX_SIZE (768*1024*1024)
#endif
-__attribute__((noinline))
-int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
+void arch_lmb_reserve(struct lmb *lmb)
{
- ulong sp;
-
- ulong initrd_start, initrd_end;
- ulong rd_len;
- ulong size;
phys_size_t bootm_size;
-
- ulong cmd_start, cmd_end, bootmap_base;
- bd_t *kbd;
- void (*kernel)(bd_t *, ulong r4, ulong r5, ulong r6,
- ulong r7, ulong r8, ulong r9);
- int ret;
- ulong of_size = images->ft_len;
- struct lmb *lmb = &images->lmb;
-
-#if defined(CONFIG_OF_LIBFDT)
- char *of_flat_tree = images->ft_addr;
-#endif
-
- kernel = (void (*)(bd_t *, ulong, ulong, ulong,
- ulong, ulong, ulong))images->ep;
+ ulong size, sp, bootmap_base;
bootmap_base = getenv_bootm_low();
bootm_size = getenv_bootm_size();
#ifdef DEBUG
if (((u64)bootmap_base + bootm_size) >
- (CFG_SDRAM_BASE + (u64)gd->ram_size))
+ (CONFIG_SYS_SDRAM_BASE + (u64)gd->ram_size))
puts("WARNING: bootm_low + bootm_size exceed total memory\n");
if ((bootmap_base + bootm_size) > get_effective_memsize())
puts("WARNING: bootm_low + bootm_size exceed eff. memory\n");
#endif
size = min(bootm_size, get_effective_memsize());
- size = min(size, CFG_LINUX_LOWMEM_MAX_SIZE);
+ size = min(size, CONFIG_SYS_LINUX_LOWMEM_MAX_SIZE);
if (size < bootm_size) {
ulong base = bootmap_base + size;
@@ -105,7 +85,7 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
*
* Allocate space for command line and board info - the
* address should be as high as possible within the reach of
- * the kernel (see CFG_BOOTMAPSZ settings), but in unused
+ * the kernel (see CONFIG_SYS_BOOTMAPSZ settings), but in unused
* memory, which means far enough below the current stack
* pointer.
*/
@@ -114,7 +94,33 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
/* adjust sp by 1K to be safe */
sp -= 1024;
- lmb_reserve(lmb, sp, (CFG_SDRAM_BASE + get_effective_memsize() - sp));
+ lmb_reserve(lmb, sp, (CONFIG_SYS_SDRAM_BASE + get_effective_memsize() - sp));
+
+ return ;
+}
+
+__attribute__((noinline))
+int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
+{
+ ulong initrd_start, initrd_end;
+ ulong rd_len;
+
+ ulong cmd_start, cmd_end, bootmap_base;
+ bd_t *kbd;
+ void (*kernel)(bd_t *, ulong r4, ulong r5, ulong r6,
+ ulong r7, ulong r8, ulong r9);
+ int ret;
+ ulong of_size = images->ft_len;
+ struct lmb *lmb = &images->lmb;
+
+#if defined(CONFIG_OF_LIBFDT)
+ char *of_flat_tree = images->ft_addr;
+#endif
+
+ kernel = (void (*)(bd_t *, ulong, ulong, ulong,
+ ulong, ulong, ulong))images->ep;
+
+ bootmap_base = getenv_bootm_low();
if (!of_size) {
/* allocate space and init command line */
@@ -145,7 +151,7 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
* if the user wants it (the logic is in the subroutines).
*/
if (of_size) {
- if (fdt_chosen(of_flat_tree, 0) < 0) {
+ if (fdt_chosen(of_flat_tree, 1) < 0) {
puts ("ERROR: ");
puts ("/chosen node create failed");
puts (" - must RESET the board to recover.\n");
@@ -189,7 +195,7 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
show_boot_progress (15);
-#if defined(CFG_INIT_RAM_LOCK) && !defined(CONFIG_E500)
+#if defined(CONFIG_SYS_INIT_RAM_LOCK) && !defined(CONFIG_E500)
unlock_ram_in_cache();
#endif
@@ -213,7 +219,7 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
debug (" Booting using OF flat tree...\n");
(*kernel) ((bd_t *)of_flat_tree, 0, 0, EPAPR_MAGIC,
- CFG_BOOTMAPSZ, 0, 0);
+ CONFIG_SYS_BOOTMAPSZ, 0, 0);
/* does not return */
} else
#endif