diff options
Diffstat (limited to 'arch/powerpc/boot/main.c')
-rw-r--r-- | arch/powerpc/boot/main.c | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/arch/powerpc/boot/main.c b/arch/powerpc/boot/main.c index d719bb9333d1..418497482b6e 100644 --- a/arch/powerpc/boot/main.c +++ b/arch/powerpc/boot/main.c | |||
@@ -27,6 +27,8 @@ extern char _vmlinux_start[]; | |||
27 | extern char _vmlinux_end[]; | 27 | extern char _vmlinux_end[]; |
28 | extern char _initrd_start[]; | 28 | extern char _initrd_start[]; |
29 | extern char _initrd_end[]; | 29 | extern char _initrd_end[]; |
30 | extern char _dtb_start[]; | ||
31 | extern char _dtb_end[]; | ||
30 | 32 | ||
31 | struct addr_range { | 33 | struct addr_range { |
32 | unsigned long addr; | 34 | unsigned long addr; |
@@ -250,10 +252,6 @@ static void prep_kernel(unsigned long *a1, unsigned long *a2) | |||
250 | flush_cache((void *)vmlinux.addr, vmlinux.size); | 252 | flush_cache((void *)vmlinux.addr, vmlinux.size); |
251 | } | 253 | } |
252 | 254 | ||
253 | void __attribute__ ((weak)) ft_init(void *dt_blob) | ||
254 | { | ||
255 | } | ||
256 | |||
257 | /* A buffer that may be edited by tools operating on a zImage binary so as to | 255 | /* A buffer that may be edited by tools operating on a zImage binary so as to |
258 | * edit the command line passed to vmlinux (by setting /chosen/bootargs). | 256 | * edit the command line passed to vmlinux (by setting /chosen/bootargs). |
259 | * The buffer is put in it's own section so that tools may locate it easier. | 257 | * The buffer is put in it's own section so that tools may locate it easier. |
@@ -285,19 +283,12 @@ static void set_cmdline(char *buf) | |||
285 | setprop(devp, "bootargs", buf, strlen(buf) + 1); | 283 | setprop(devp, "bootargs", buf, strlen(buf) + 1); |
286 | } | 284 | } |
287 | 285 | ||
288 | /* Section where ft can be tacked on after zImage is built */ | ||
289 | union blobspace { | ||
290 | struct boot_param_header hdr; | ||
291 | char space[8*1024]; | ||
292 | } dt_blob __attribute__((__section__("__builtin_ft"))); | ||
293 | |||
294 | struct platform_ops platform_ops; | 286 | struct platform_ops platform_ops; |
295 | struct dt_ops dt_ops; | 287 | struct dt_ops dt_ops; |
296 | struct console_ops console_ops; | 288 | struct console_ops console_ops; |
297 | 289 | ||
298 | void start(unsigned long a1, unsigned long a2, void *promptr, void *sp) | 290 | void start(unsigned long a1, unsigned long a2, void *promptr, void *sp) |
299 | { | 291 | { |
300 | int have_dt = 0; | ||
301 | kernel_entry_t kentry; | 292 | kernel_entry_t kentry; |
302 | char cmdline[COMMAND_LINE_SIZE]; | 293 | char cmdline[COMMAND_LINE_SIZE]; |
303 | 294 | ||
@@ -306,15 +297,7 @@ void start(unsigned long a1, unsigned long a2, void *promptr, void *sp) | |||
306 | memset(&dt_ops, 0, sizeof(dt_ops)); | 297 | memset(&dt_ops, 0, sizeof(dt_ops)); |
307 | memset(&console_ops, 0, sizeof(console_ops)); | 298 | memset(&console_ops, 0, sizeof(console_ops)); |
308 | 299 | ||
309 | /* Override the dt_ops and device tree if there was an flat dev | 300 | if (platform_init(promptr, _dtb_start, _dtb_end)) |
310 | * tree attached to the zImage. | ||
311 | */ | ||
312 | if (dt_blob.hdr.magic == OF_DT_HEADER) { | ||
313 | have_dt = 1; | ||
314 | ft_init(&dt_blob); | ||
315 | } | ||
316 | |||
317 | if (platform_init(promptr)) | ||
318 | exit(); | 301 | exit(); |
319 | if (console_ops.open && (console_ops.open() < 0)) | 302 | if (console_ops.open && (console_ops.open() < 0)) |
320 | exit(); | 303 | exit(); |
@@ -342,8 +325,10 @@ void start(unsigned long a1, unsigned long a2, void *promptr, void *sp) | |||
342 | console_ops.close(); | 325 | console_ops.close(); |
343 | 326 | ||
344 | kentry = (kernel_entry_t) vmlinux.addr; | 327 | kentry = (kernel_entry_t) vmlinux.addr; |
345 | if (have_dt) | 328 | if (_dtb_end > _dtb_start) { |
329 | dt_ops.ft_pack(); | ||
346 | kentry(dt_ops.ft_addr(), 0, NULL); | 330 | kentry(dt_ops.ft_addr(), 0, NULL); |
331 | } | ||
347 | else | 332 | else |
348 | /* XXX initrd addr/size should be passed in properties */ | 333 | /* XXX initrd addr/size should be passed in properties */ |
349 | kentry(a1, a2, promptr); | 334 | kentry(a1, a2, promptr); |