aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-06-23 01:11:30 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-23 01:11:30 -0400
commit45c091bb2d453ce4a8b06cf19872ec7a77fc4799 (patch)
tree06fb2e05518ebfba163f8424e028e7faf5672d66 /arch/powerpc/boot
parentd588fcbe5a7ba8bba2cebf7799ab2d573717a806 (diff)
parent2191fe3e39159e3375f4b7ec1420df149f154101 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: (139 commits) [POWERPC] re-enable OProfile for iSeries, using timer interrupt [POWERPC] support ibm,extended-*-frequency properties [POWERPC] Extra sanity check in EEH code [POWERPC] Dont look for class-code in pci children [POWERPC] Fix mdelay badness on shared processor partitions [POWERPC] disable floating point exceptions for init [POWERPC] Unify ppc syscall tables [POWERPC] mpic: add support for serial mode interrupts [POWERPC] pseries: Print PCI slot location code on failure [POWERPC] spufs: one more fix for 64k pages [POWERPC] spufs: fail spu_create with invalid flags [POWERPC] spufs: clear class2 interrupt status before wakeup [POWERPC] spufs: fix Makefile for "make clean" [POWERPC] spufs: remove stop_code from struct spu [POWERPC] spufs: fix spu irq affinity setting [POWERPC] spufs: further abstract priv1 register access [POWERPC] spufs: split the Cell BE support into generic and platform dependant parts [POWERPC] spufs: dont try to access SPE channel 1 count [POWERPC] spufs: use kzalloc in create_spu [POWERPC] spufs: fix initial state of wbox file ... Manually resolved conflicts in: drivers/net/phy/Makefile include/asm-powerpc/spu.h
Diffstat (limited to 'arch/powerpc/boot')
-rw-r--r--arch/powerpc/boot/main.c27
-rw-r--r--arch/powerpc/boot/prom.h7
2 files changed, 34 insertions, 0 deletions
diff --git a/arch/powerpc/boot/main.c b/arch/powerpc/boot/main.c
index 816446f0e497..b66634c9ea34 100644
--- a/arch/powerpc/boot/main.c
+++ b/arch/powerpc/boot/main.c
@@ -33,6 +33,14 @@ extern char _vmlinux_end[];
33extern char _initrd_start[]; 33extern char _initrd_start[];
34extern char _initrd_end[]; 34extern char _initrd_end[];
35 35
36/* A buffer that may be edited by tools operating on a zImage binary so as to
37 * edit the command line passed to vmlinux (by setting /chosen/bootargs).
38 * The buffer is put in it's own section so that tools may locate it easier.
39 */
40static char builtin_cmdline[512]
41 __attribute__((section("__builtin_cmdline")));
42
43
36struct addr_range { 44struct addr_range {
37 unsigned long addr; 45 unsigned long addr;
38 unsigned long size; 46 unsigned long size;
@@ -204,6 +212,23 @@ static int is_elf32(void *hdr)
204 return 1; 212 return 1;
205} 213}
206 214
215void export_cmdline(void* chosen_handle)
216{
217 int len;
218 char cmdline[2] = { 0, 0 };
219
220 if (builtin_cmdline[0] == 0)
221 return;
222
223 len = getprop(chosen_handle, "bootargs", cmdline, sizeof(cmdline));
224 if (len > 0 && cmdline[0] != 0)
225 return;
226
227 setprop(chosen_handle, "bootargs", builtin_cmdline,
228 strlen(builtin_cmdline) + 1);
229}
230
231
207void start(unsigned long a1, unsigned long a2, void *promptr, void *sp) 232void start(unsigned long a1, unsigned long a2, void *promptr, void *sp)
208{ 233{
209 int len; 234 int len;
@@ -289,6 +314,8 @@ void start(unsigned long a1, unsigned long a2, void *promptr, void *sp)
289 memmove((void *)vmlinux.addr,(void *)vmlinuz.addr,vmlinuz.size); 314 memmove((void *)vmlinux.addr,(void *)vmlinuz.addr,vmlinuz.size);
290 } 315 }
291 316
317 export_cmdline(chosen_handle);
318
292 /* Skip over the ELF header */ 319 /* Skip over the ELF header */
293#ifdef DEBUG 320#ifdef DEBUG
294 printf("... skipping 0x%lx bytes of ELF header\n\r", 321 printf("... skipping 0x%lx bytes of ELF header\n\r",
diff --git a/arch/powerpc/boot/prom.h b/arch/powerpc/boot/prom.h
index 3e2ddd4a5a81..a57b184c564f 100644
--- a/arch/powerpc/boot/prom.h
+++ b/arch/powerpc/boot/prom.h
@@ -31,4 +31,11 @@ static inline int getprop(void *phandle, const char *name,
31 return call_prom("getprop", 4, 1, phandle, name, buf, buflen); 31 return call_prom("getprop", 4, 1, phandle, name, buf, buflen);
32} 32}
33 33
34
35static inline int setprop(void *phandle, const char *name,
36 void *buf, int buflen)
37{
38 return call_prom("setprop", 4, 1, phandle, name, buf, buflen);
39}
40
34#endif /* _PPC_BOOT_PROM_H_ */ 41#endif /* _PPC_BOOT_PROM_H_ */