[PATCH] ppc32: Cleanup AMCC PPC44x eval board U-Boot support
authorMatt Porter <mporter@kernel.crashing.org>
Sat, 29 Oct 2005 00:46:14 +0000 (17:46 -0700)
committerPaul Mackerras <paulus@samba.org>
Sat, 29 Oct 2005 03:55:39 +0000 (13:55 +1000)
Cleanup PPC440 eval boards (bamboo, ebony, luan and ocotea) to better
support U-Boot as bootloader.

Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Matt Porter <mporter@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/ppc/platforms/4xx/bamboo.c
arch/ppc/platforms/4xx/ebony.c
arch/ppc/platforms/4xx/luan.c
arch/ppc/platforms/4xx/ocotea.c
arch/ppc/syslib/ibm44x_common.c
arch/ppc/syslib/ibm44x_common.h

index 78a403b48dba9c861fe54f27ee94cab2c3db09be..159b228eca1edb83b31ac35cf83ba2ff7bb55417 100644 (file)
@@ -51,7 +51,7 @@
 #include <syslib/gen550.h>
 #include <syslib/ibm440gx_common.h>
 
-bd_t __res;
+extern bd_t __res;
 
 static struct ibm44x_clocks clocks __initdata;
 
@@ -425,17 +425,7 @@ bamboo_setup_arch(void)
 void __init platform_init(unsigned long r3, unsigned long r4,
                unsigned long r5, unsigned long r6, unsigned long r7)
 {
-       parse_bootinfo(find_bootinfo());
-
-       /*
-        * If we were passed in a board information, copy it into the
-        * residual data area.
-        */
-       if (r3)
-               __res = *(bd_t *)(r3 + KERNELBASE);
-
-
-       ibm44x_platform_init();
+       ibm44x_platform_init(r3, r4, r5, r6, r7);
 
        ppc_md.setup_arch = bamboo_setup_arch;
        ppc_md.show_cpuinfo = bamboo_show_cpuinfo;
index d32ae112f63936ca754dd4abb12c049e3568e923..64ebae19cdbb103faa168a110842dddf35168a45 100644 (file)
@@ -54,7 +54,7 @@
 #include <syslib/gen550.h>
 #include <syslib/ibm440gp_common.h>
 
-bd_t __res;
+extern bd_t __res;
 
 static struct ibm44x_clocks clocks __initdata;
 
@@ -317,16 +317,7 @@ ebony_setup_arch(void)
 void __init platform_init(unsigned long r3, unsigned long r4,
                unsigned long r5, unsigned long r6, unsigned long r7)
 {
-       parse_bootinfo(find_bootinfo());
-
-       /*
-        * If we were passed in a board information, copy it into the
-        * residual data area.
-        */
-       if (r3)
-               __res = *(bd_t *)(r3 + KERNELBASE);
-
-       ibm44x_platform_init();
+       ibm44x_platform_init(r3, r4, r5, r6, r7);
 
        ppc_md.setup_arch = ebony_setup_arch;
        ppc_md.show_cpuinfo = ebony_show_cpuinfo;
index 16d953bda22cf13b50f2d43c42a8187d7d4e6e81..d810b736d9bf5efa933a1e672484bca7f660d239 100644 (file)
@@ -52,7 +52,7 @@
 #include <syslib/ibm440gx_common.h>
 #include <syslib/ibm440sp_common.h>
 
-bd_t __res;
+extern bd_t __res;
 
 static struct ibm44x_clocks clocks __initdata;
 
@@ -355,16 +355,7 @@ luan_setup_arch(void)
 void __init platform_init(unsigned long r3, unsigned long r4,
                unsigned long r5, unsigned long r6, unsigned long r7)
 {
-       parse_bootinfo(find_bootinfo());
-
-       /*
-        * If we were passed in a board information, copy it into the
-        * residual data area.
-        */
-       if (r3)
-               __res = *(bd_t *)(r3 + KERNELBASE);
-
-       ibm44x_platform_init();
+       ibm44x_platform_init(r3, r4, r5, r6, r7);
 
        ppc_md.setup_arch = luan_setup_arch;
        ppc_md.show_cpuinfo = luan_show_cpuinfo;
index 506949c5dd29d4c069ce518e0e02ef22d0427b1b..73b2c98158f64ccc0016c3f7e03c13cafc15d478 100644 (file)
@@ -52,7 +52,7 @@
 #include <syslib/gen550.h>
 #include <syslib/ibm440gx_common.h>
 
-bd_t __res;
+extern bd_t __res;
 
 static struct ibm44x_clocks clocks __initdata;
 
@@ -286,6 +286,15 @@ ocotea_setup_arch(void)
 
        ibm440gx_tah_enable();
 
+       /*
+        * Determine various clocks.
+        * To be completely correct we should get SysClk
+        * from FPGA, because it can be changed by on-board switches
+        * --ebs
+        */
+       ibm440gx_get_clocks(&clocks, 33333333, 6 * 1843200);
+       ocp_sys_info.opb_bus_freq = clocks.opb;
+
        /* Setup TODC access */
        TODC_INIT(TODC_TYPE_DS1743,
                        0,
@@ -324,25 +333,7 @@ static void __init ocotea_init(void)
 void __init platform_init(unsigned long r3, unsigned long r4,
                unsigned long r5, unsigned long r6, unsigned long r7)
 {
-       parse_bootinfo(find_bootinfo());
-
-       /*
-        * If we were passed in a board information, copy it into the
-        * residual data area.
-        */
-       if (r3)
-               __res = *(bd_t *)(r3 + KERNELBASE);
-
-       /*
-        * Determine various clocks.
-        * To be completely correct we should get SysClk
-        * from FPGA, because it can be changed by on-board switches
-        * --ebs
-        */
-       ibm440gx_get_clocks(&clocks, 33333333, 6 * 1843200);
-       ocp_sys_info.opb_bus_freq = clocks.opb;
-
-       ibm44x_platform_init();
+       ibm44x_platform_init(r3, r4, r5, r6, r7);
 
        ppc_md.setup_arch = ocotea_setup_arch;
        ppc_md.show_cpuinfo = ocotea_show_cpuinfo;
index 95e11f93c15df981c31faeba386af619dc2e383c..5152c8e41340cca5f0a4437dd4fdb6c697b9677f 100644 (file)
 #include <asm/time.h>
 #include <asm/ppc4xx_pic.h>
 #include <asm/param.h>
+#include <asm/bootinfo.h>
+#include <asm/ppcboot.h>
 
 #include <syslib/gen550.h>
 
+/* Global Variables */
+bd_t __res;
+
 phys_addr_t fixup_bigphys_addr(phys_addr_t addr, phys_addr_t size)
 {
        phys_addr_t page_4gb = 0;
@@ -150,8 +155,36 @@ static unsigned long __init ibm44x_find_end_of_memory(void)
        return mem_size;
 }
 
-void __init ibm44x_platform_init(void)
+void __init ibm44x_platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
+                                unsigned long r6, unsigned long r7)
 {
+       parse_bootinfo(find_bootinfo());
+
+       /*
+        * If we were passed in a board information, copy it into the
+        * residual data area.
+        */
+       if (r3)
+               __res = *(bd_t *)(r3 + KERNELBASE);
+
+#if defined(CONFIG_BLK_DEV_INITRD)
+       /*
+        * If the init RAM disk has been configured in, and there's a valid
+        * starting address for it, set it up.
+        */
+       if (r4) {
+               initrd_start = r4 + KERNELBASE;
+               initrd_end = r5 + KERNELBASE;
+       }
+#endif  /* CONFIG_BLK_DEV_INITRD */
+
+       /* Copy the kernel command line arguments to a safe place. */
+
+       if (r6) {
+               *(char *) (r7 + KERNELBASE) = 0;
+               strcpy(cmd_line, (char *) (r6 + KERNELBASE));
+       }
+
        ppc_md.init_IRQ = ppc4xx_pic_init;
        ppc_md.find_end_of_memory = ibm44x_find_end_of_memory;
        ppc_md.restart = ibm44x_restart;
index c16b6a5ac6ab9bc8090c6a4437210c404ccafe54..b25a8995e4e9c9b3b0d1952162aaa551a0d826c8 100644 (file)
@@ -36,7 +36,8 @@ struct ibm44x_clocks {
 };
 
 /* common 44x platform init */
-void ibm44x_platform_init(void) __init;
+void ibm44x_platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
+                         unsigned long r6, unsigned long r7) __init;
 
 /* initialize decrementer and tick-related variables */
 void ibm44x_calibrate_decr(unsigned int freq) __init;