diff options
author | Matt Porter <mporter@kernel.crashing.org> | 2005-10-28 20:46:14 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-10-28 23:55:39 -0400 |
commit | d5f7b06b036afc2cb250decb2c76b7f82c5de639 (patch) | |
tree | a4c67d17b5ee7ba23490977bbe74c42201e1d54d /arch | |
parent | de957c89b7dadb3147e885d7b6eb9db73d0eea57 (diff) |
[PATCH] ppc32: Cleanup AMCC PPC44x eval board U-Boot support
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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/ppc/platforms/4xx/bamboo.c | 14 | ||||
-rw-r--r-- | arch/ppc/platforms/4xx/ebony.c | 13 | ||||
-rw-r--r-- | arch/ppc/platforms/4xx/luan.c | 13 | ||||
-rw-r--r-- | arch/ppc/platforms/4xx/ocotea.c | 31 | ||||
-rw-r--r-- | arch/ppc/syslib/ibm44x_common.c | 35 | ||||
-rw-r--r-- | arch/ppc/syslib/ibm44x_common.h | 3 |
6 files changed, 53 insertions, 56 deletions
diff --git a/arch/ppc/platforms/4xx/bamboo.c b/arch/ppc/platforms/4xx/bamboo.c index 78a403b48dba..159b228eca1e 100644 --- a/arch/ppc/platforms/4xx/bamboo.c +++ b/arch/ppc/platforms/4xx/bamboo.c | |||
@@ -51,7 +51,7 @@ | |||
51 | #include <syslib/gen550.h> | 51 | #include <syslib/gen550.h> |
52 | #include <syslib/ibm440gx_common.h> | 52 | #include <syslib/ibm440gx_common.h> |
53 | 53 | ||
54 | bd_t __res; | 54 | extern bd_t __res; |
55 | 55 | ||
56 | static struct ibm44x_clocks clocks __initdata; | 56 | static struct ibm44x_clocks clocks __initdata; |
57 | 57 | ||
@@ -425,17 +425,7 @@ bamboo_setup_arch(void) | |||
425 | void __init platform_init(unsigned long r3, unsigned long r4, | 425 | void __init platform_init(unsigned long r3, unsigned long r4, |
426 | unsigned long r5, unsigned long r6, unsigned long r7) | 426 | unsigned long r5, unsigned long r6, unsigned long r7) |
427 | { | 427 | { |
428 | parse_bootinfo(find_bootinfo()); | 428 | ibm44x_platform_init(r3, r4, r5, r6, r7); |
429 | |||
430 | /* | ||
431 | * If we were passed in a board information, copy it into the | ||
432 | * residual data area. | ||
433 | */ | ||
434 | if (r3) | ||
435 | __res = *(bd_t *)(r3 + KERNELBASE); | ||
436 | |||
437 | |||
438 | ibm44x_platform_init(); | ||
439 | 429 | ||
440 | ppc_md.setup_arch = bamboo_setup_arch; | 430 | ppc_md.setup_arch = bamboo_setup_arch; |
441 | ppc_md.show_cpuinfo = bamboo_show_cpuinfo; | 431 | ppc_md.show_cpuinfo = bamboo_show_cpuinfo; |
diff --git a/arch/ppc/platforms/4xx/ebony.c b/arch/ppc/platforms/4xx/ebony.c index d32ae112f639..64ebae19cdbb 100644 --- a/arch/ppc/platforms/4xx/ebony.c +++ b/arch/ppc/platforms/4xx/ebony.c | |||
@@ -54,7 +54,7 @@ | |||
54 | #include <syslib/gen550.h> | 54 | #include <syslib/gen550.h> |
55 | #include <syslib/ibm440gp_common.h> | 55 | #include <syslib/ibm440gp_common.h> |
56 | 56 | ||
57 | bd_t __res; | 57 | extern bd_t __res; |
58 | 58 | ||
59 | static struct ibm44x_clocks clocks __initdata; | 59 | static struct ibm44x_clocks clocks __initdata; |
60 | 60 | ||
@@ -317,16 +317,7 @@ ebony_setup_arch(void) | |||
317 | void __init platform_init(unsigned long r3, unsigned long r4, | 317 | void __init platform_init(unsigned long r3, unsigned long r4, |
318 | unsigned long r5, unsigned long r6, unsigned long r7) | 318 | unsigned long r5, unsigned long r6, unsigned long r7) |
319 | { | 319 | { |
320 | parse_bootinfo(find_bootinfo()); | 320 | ibm44x_platform_init(r3, r4, r5, r6, r7); |
321 | |||
322 | /* | ||
323 | * If we were passed in a board information, copy it into the | ||
324 | * residual data area. | ||
325 | */ | ||
326 | if (r3) | ||
327 | __res = *(bd_t *)(r3 + KERNELBASE); | ||
328 | |||
329 | ibm44x_platform_init(); | ||
330 | 321 | ||
331 | ppc_md.setup_arch = ebony_setup_arch; | 322 | ppc_md.setup_arch = ebony_setup_arch; |
332 | ppc_md.show_cpuinfo = ebony_show_cpuinfo; | 323 | ppc_md.show_cpuinfo = ebony_show_cpuinfo; |
diff --git a/arch/ppc/platforms/4xx/luan.c b/arch/ppc/platforms/4xx/luan.c index 16d953bda22c..d810b736d9bf 100644 --- a/arch/ppc/platforms/4xx/luan.c +++ b/arch/ppc/platforms/4xx/luan.c | |||
@@ -52,7 +52,7 @@ | |||
52 | #include <syslib/ibm440gx_common.h> | 52 | #include <syslib/ibm440gx_common.h> |
53 | #include <syslib/ibm440sp_common.h> | 53 | #include <syslib/ibm440sp_common.h> |
54 | 54 | ||
55 | bd_t __res; | 55 | extern bd_t __res; |
56 | 56 | ||
57 | static struct ibm44x_clocks clocks __initdata; | 57 | static struct ibm44x_clocks clocks __initdata; |
58 | 58 | ||
@@ -355,16 +355,7 @@ luan_setup_arch(void) | |||
355 | void __init platform_init(unsigned long r3, unsigned long r4, | 355 | void __init platform_init(unsigned long r3, unsigned long r4, |
356 | unsigned long r5, unsigned long r6, unsigned long r7) | 356 | unsigned long r5, unsigned long r6, unsigned long r7) |
357 | { | 357 | { |
358 | parse_bootinfo(find_bootinfo()); | 358 | ibm44x_platform_init(r3, r4, r5, r6, r7); |
359 | |||
360 | /* | ||
361 | * If we were passed in a board information, copy it into the | ||
362 | * residual data area. | ||
363 | */ | ||
364 | if (r3) | ||
365 | __res = *(bd_t *)(r3 + KERNELBASE); | ||
366 | |||
367 | ibm44x_platform_init(); | ||
368 | 359 | ||
369 | ppc_md.setup_arch = luan_setup_arch; | 360 | ppc_md.setup_arch = luan_setup_arch; |
370 | ppc_md.show_cpuinfo = luan_show_cpuinfo; | 361 | ppc_md.show_cpuinfo = luan_show_cpuinfo; |
diff --git a/arch/ppc/platforms/4xx/ocotea.c b/arch/ppc/platforms/4xx/ocotea.c index 506949c5dd29..73b2c98158f6 100644 --- a/arch/ppc/platforms/4xx/ocotea.c +++ b/arch/ppc/platforms/4xx/ocotea.c | |||
@@ -52,7 +52,7 @@ | |||
52 | #include <syslib/gen550.h> | 52 | #include <syslib/gen550.h> |
53 | #include <syslib/ibm440gx_common.h> | 53 | #include <syslib/ibm440gx_common.h> |
54 | 54 | ||
55 | bd_t __res; | 55 | extern bd_t __res; |
56 | 56 | ||
57 | static struct ibm44x_clocks clocks __initdata; | 57 | static struct ibm44x_clocks clocks __initdata; |
58 | 58 | ||
@@ -286,6 +286,15 @@ ocotea_setup_arch(void) | |||
286 | 286 | ||
287 | ibm440gx_tah_enable(); | 287 | ibm440gx_tah_enable(); |
288 | 288 | ||
289 | /* | ||
290 | * Determine various clocks. | ||
291 | * To be completely correct we should get SysClk | ||
292 | * from FPGA, because it can be changed by on-board switches | ||
293 | * --ebs | ||
294 | */ | ||
295 | ibm440gx_get_clocks(&clocks, 33333333, 6 * 1843200); | ||
296 | ocp_sys_info.opb_bus_freq = clocks.opb; | ||
297 | |||
289 | /* Setup TODC access */ | 298 | /* Setup TODC access */ |
290 | TODC_INIT(TODC_TYPE_DS1743, | 299 | TODC_INIT(TODC_TYPE_DS1743, |
291 | 0, | 300 | 0, |
@@ -324,25 +333,7 @@ static void __init ocotea_init(void) | |||
324 | void __init platform_init(unsigned long r3, unsigned long r4, | 333 | void __init platform_init(unsigned long r3, unsigned long r4, |
325 | unsigned long r5, unsigned long r6, unsigned long r7) | 334 | unsigned long r5, unsigned long r6, unsigned long r7) |
326 | { | 335 | { |
327 | parse_bootinfo(find_bootinfo()); | 336 | ibm44x_platform_init(r3, r4, r5, r6, r7); |
328 | |||
329 | /* | ||
330 | * If we were passed in a board information, copy it into the | ||
331 | * residual data area. | ||
332 | */ | ||
333 | if (r3) | ||
334 | __res = *(bd_t *)(r3 + KERNELBASE); | ||
335 | |||
336 | /* | ||
337 | * Determine various clocks. | ||
338 | * To be completely correct we should get SysClk | ||
339 | * from FPGA, because it can be changed by on-board switches | ||
340 | * --ebs | ||
341 | */ | ||
342 | ibm440gx_get_clocks(&clocks, 33333333, 6 * 1843200); | ||
343 | ocp_sys_info.opb_bus_freq = clocks.opb; | ||
344 | |||
345 | ibm44x_platform_init(); | ||
346 | 337 | ||
347 | ppc_md.setup_arch = ocotea_setup_arch; | 338 | ppc_md.setup_arch = ocotea_setup_arch; |
348 | ppc_md.show_cpuinfo = ocotea_show_cpuinfo; | 339 | ppc_md.show_cpuinfo = ocotea_show_cpuinfo; |
diff --git a/arch/ppc/syslib/ibm44x_common.c b/arch/ppc/syslib/ibm44x_common.c index 95e11f93c15d..5152c8e41340 100644 --- a/arch/ppc/syslib/ibm44x_common.c +++ b/arch/ppc/syslib/ibm44x_common.c | |||
@@ -27,9 +27,14 @@ | |||
27 | #include <asm/time.h> | 27 | #include <asm/time.h> |
28 | #include <asm/ppc4xx_pic.h> | 28 | #include <asm/ppc4xx_pic.h> |
29 | #include <asm/param.h> | 29 | #include <asm/param.h> |
30 | #include <asm/bootinfo.h> | ||
31 | #include <asm/ppcboot.h> | ||
30 | 32 | ||
31 | #include <syslib/gen550.h> | 33 | #include <syslib/gen550.h> |
32 | 34 | ||
35 | /* Global Variables */ | ||
36 | bd_t __res; | ||
37 | |||
33 | phys_addr_t fixup_bigphys_addr(phys_addr_t addr, phys_addr_t size) | 38 | phys_addr_t fixup_bigphys_addr(phys_addr_t addr, phys_addr_t size) |
34 | { | 39 | { |
35 | phys_addr_t page_4gb = 0; | 40 | phys_addr_t page_4gb = 0; |
@@ -150,8 +155,36 @@ static unsigned long __init ibm44x_find_end_of_memory(void) | |||
150 | return mem_size; | 155 | return mem_size; |
151 | } | 156 | } |
152 | 157 | ||
153 | void __init ibm44x_platform_init(void) | 158 | void __init ibm44x_platform_init(unsigned long r3, unsigned long r4, unsigned long r5, |
159 | unsigned long r6, unsigned long r7) | ||
154 | { | 160 | { |
161 | parse_bootinfo(find_bootinfo()); | ||
162 | |||
163 | /* | ||
164 | * If we were passed in a board information, copy it into the | ||
165 | * residual data area. | ||
166 | */ | ||
167 | if (r3) | ||
168 | __res = *(bd_t *)(r3 + KERNELBASE); | ||
169 | |||
170 | #if defined(CONFIG_BLK_DEV_INITRD) | ||
171 | /* | ||
172 | * If the init RAM disk has been configured in, and there's a valid | ||
173 | * starting address for it, set it up. | ||
174 | */ | ||
175 | if (r4) { | ||
176 | initrd_start = r4 + KERNELBASE; | ||
177 | initrd_end = r5 + KERNELBASE; | ||
178 | } | ||
179 | #endif /* CONFIG_BLK_DEV_INITRD */ | ||
180 | |||
181 | /* Copy the kernel command line arguments to a safe place. */ | ||
182 | |||
183 | if (r6) { | ||
184 | *(char *) (r7 + KERNELBASE) = 0; | ||
185 | strcpy(cmd_line, (char *) (r6 + KERNELBASE)); | ||
186 | } | ||
187 | |||
155 | ppc_md.init_IRQ = ppc4xx_pic_init; | 188 | ppc_md.init_IRQ = ppc4xx_pic_init; |
156 | ppc_md.find_end_of_memory = ibm44x_find_end_of_memory; | 189 | ppc_md.find_end_of_memory = ibm44x_find_end_of_memory; |
157 | ppc_md.restart = ibm44x_restart; | 190 | ppc_md.restart = ibm44x_restart; |
diff --git a/arch/ppc/syslib/ibm44x_common.h b/arch/ppc/syslib/ibm44x_common.h index c16b6a5ac6ab..b25a8995e4e9 100644 --- a/arch/ppc/syslib/ibm44x_common.h +++ b/arch/ppc/syslib/ibm44x_common.h | |||
@@ -36,7 +36,8 @@ struct ibm44x_clocks { | |||
36 | }; | 36 | }; |
37 | 37 | ||
38 | /* common 44x platform init */ | 38 | /* common 44x platform init */ |
39 | void ibm44x_platform_init(void) __init; | 39 | void ibm44x_platform_init(unsigned long r3, unsigned long r4, unsigned long r5, |
40 | unsigned long r6, unsigned long r7) __init; | ||
40 | 41 | ||
41 | /* initialize decrementer and tick-related variables */ | 42 | /* initialize decrementer and tick-related variables */ |
42 | void ibm44x_calibrate_decr(unsigned int freq) __init; | 43 | void ibm44x_calibrate_decr(unsigned int freq) __init; |