diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2006-07-04 03:07:18 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-07-25 11:28:04 -0400 |
commit | 98c82472e98469ef23d7c680a0d6be1429540166 (patch) | |
tree | dd713a1389008d2c19de3f376745f56751cb5ea6 /arch | |
parent | 45507ff3a2c58bc4781688eac1a80979ea972dce (diff) |
[POWERPC] More offb/bootx fixes
There were still some issues with offb when BootX doesn't provide a
proper display node, this fixes them. This also re-instates the
palette hacks that were disabled a couple of kernel versions ago when
I converted to the new OF parsing, and shuffles some functions around
to avoid prototypes.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/platforms/powermac/bootx_init.c | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/arch/powerpc/platforms/powermac/bootx_init.c b/arch/powerpc/platforms/powermac/bootx_init.c index 871b002c9f90..6a026c733f6a 100644 --- a/arch/powerpc/platforms/powermac/bootx_init.c +++ b/arch/powerpc/platforms/powermac/bootx_init.c | |||
@@ -181,13 +181,18 @@ static void __init bootx_add_chosen_props(unsigned long base, | |||
181 | } | 181 | } |
182 | 182 | ||
183 | static void __init bootx_add_display_props(unsigned long base, | 183 | static void __init bootx_add_display_props(unsigned long base, |
184 | unsigned long *mem_end) | 184 | unsigned long *mem_end, |
185 | int has_real_node) | ||
185 | { | 186 | { |
186 | boot_infos_t *bi = bootx_info; | 187 | boot_infos_t *bi = bootx_info; |
187 | u32 tmp; | 188 | u32 tmp; |
188 | 189 | ||
189 | bootx_dt_add_prop("linux,boot-display", NULL, 0, mem_end); | 190 | if (has_real_node) { |
190 | bootx_dt_add_prop("linux,opened", NULL, 0, mem_end); | 191 | bootx_dt_add_prop("linux,boot-display", NULL, 0, mem_end); |
192 | bootx_dt_add_prop("linux,opened", NULL, 0, mem_end); | ||
193 | } else | ||
194 | bootx_dt_add_prop("linux,bootx-noscreen", NULL, 0, mem_end); | ||
195 | |||
191 | tmp = bi->dispDeviceDepth; | 196 | tmp = bi->dispDeviceDepth; |
192 | bootx_dt_add_prop("linux,bootx-depth", &tmp, 4, mem_end); | 197 | bootx_dt_add_prop("linux,bootx-depth", &tmp, 4, mem_end); |
193 | tmp = bi->dispDeviceRect[2] - bi->dispDeviceRect[0]; | 198 | tmp = bi->dispDeviceRect[2] - bi->dispDeviceRect[0]; |
@@ -241,11 +246,6 @@ static void __init bootx_scan_dt_build_strings(unsigned long base, | |||
241 | DBG(" detected display ! adding properties names !\n"); | 246 | DBG(" detected display ! adding properties names !\n"); |
242 | bootx_dt_add_string("linux,boot-display", mem_end); | 247 | bootx_dt_add_string("linux,boot-display", mem_end); |
243 | bootx_dt_add_string("linux,opened", mem_end); | 248 | bootx_dt_add_string("linux,opened", mem_end); |
244 | bootx_dt_add_string("linux,bootx-depth", mem_end); | ||
245 | bootx_dt_add_string("linux,bootx-width", mem_end); | ||
246 | bootx_dt_add_string("linux,bootx-height", mem_end); | ||
247 | bootx_dt_add_string("linux,bootx-linebytes", mem_end); | ||
248 | bootx_dt_add_string("linux,bootx-addr", mem_end); | ||
249 | strncpy(bootx_disp_path, namep, 255); | 249 | strncpy(bootx_disp_path, namep, 255); |
250 | } | 250 | } |
251 | 251 | ||
@@ -329,10 +329,13 @@ static void __init bootx_scan_dt_build_struct(unsigned long base, | |||
329 | ppp = &pp->next; | 329 | ppp = &pp->next; |
330 | } | 330 | } |
331 | 331 | ||
332 | if (node == bootx_node_chosen) | 332 | if (node == bootx_node_chosen) { |
333 | bootx_add_chosen_props(base, mem_end); | 333 | bootx_add_chosen_props(base, mem_end); |
334 | if (node == bootx_info->dispDeviceRegEntryOffset) | 334 | if (bootx_info->dispDeviceRegEntryOffset == 0) |
335 | bootx_add_display_props(base, mem_end); | 335 | bootx_add_display_props(base, mem_end, 0); |
336 | } | ||
337 | else if (node == bootx_info->dispDeviceRegEntryOffset) | ||
338 | bootx_add_display_props(base, mem_end, 1); | ||
336 | 339 | ||
337 | /* do all our children */ | 340 | /* do all our children */ |
338 | cpp = &np->child; | 341 | cpp = &np->child; |
@@ -374,6 +377,14 @@ static unsigned long __init bootx_flatten_dt(unsigned long start) | |||
374 | mem_end += 4; | 377 | mem_end += 4; |
375 | bootx_dt_strend = mem_end; | 378 | bootx_dt_strend = mem_end; |
376 | bootx_scan_dt_build_strings(base, 4, &mem_end); | 379 | bootx_scan_dt_build_strings(base, 4, &mem_end); |
380 | /* Add some strings */ | ||
381 | bootx_dt_add_string("linux,bootx-noscreen", &mem_end); | ||
382 | bootx_dt_add_string("linux,bootx-depth", &mem_end); | ||
383 | bootx_dt_add_string("linux,bootx-width", &mem_end); | ||
384 | bootx_dt_add_string("linux,bootx-height", &mem_end); | ||
385 | bootx_dt_add_string("linux,bootx-linebytes", &mem_end); | ||
386 | bootx_dt_add_string("linux,bootx-addr", &mem_end); | ||
387 | /* Wrap up strings */ | ||
377 | hdr->off_dt_strings = bootx_dt_strbase - mem_start; | 388 | hdr->off_dt_strings = bootx_dt_strbase - mem_start; |
378 | hdr->dt_strings_size = bootx_dt_strend - bootx_dt_strbase; | 389 | hdr->dt_strings_size = bootx_dt_strend - bootx_dt_strbase; |
379 | 390 | ||
@@ -471,6 +482,7 @@ void __init bootx_init(unsigned long r3, unsigned long r4) | |||
471 | if (bi->dispDeviceDepth == 16) | 482 | if (bi->dispDeviceDepth == 16) |
472 | bi->dispDeviceDepth = 15; | 483 | bi->dispDeviceDepth = 15; |
473 | 484 | ||
485 | |||
474 | #ifdef CONFIG_BOOTX_TEXT | 486 | #ifdef CONFIG_BOOTX_TEXT |
475 | ptr = (unsigned long)bi->logicalDisplayBase; | 487 | ptr = (unsigned long)bi->logicalDisplayBase; |
476 | ptr += bi->dispDeviceRect[1] * bi->dispDeviceRowBytes; | 488 | ptr += bi->dispDeviceRect[1] * bi->dispDeviceRowBytes; |
@@ -508,6 +520,7 @@ void __init bootx_init(unsigned long r3, unsigned long r4) | |||
508 | #ifdef CONFIG_BOOTX_TEXT | 520 | #ifdef CONFIG_BOOTX_TEXT |
509 | btext_welcome(bi); | 521 | btext_welcome(bi); |
510 | #endif | 522 | #endif |
523 | |||
511 | /* New BootX enters kernel with MMU off, i/os are not allowed | 524 | /* New BootX enters kernel with MMU off, i/os are not allowed |
512 | * here. This hack will have been done by the boostrap anyway. | 525 | * here. This hack will have been done by the boostrap anyway. |
513 | */ | 526 | */ |