Skip to content

Commit a82765b

Browse files
dwmw2paulusmack
authored andcommitted
[PATCH] powerpc: Fix ppc32 initrd
OK, the Fedora ppc32 and ppc64 kernels should both be arch/powerpc by tomorrow. They're booting on G5, POWER5, and my powerbook. I'll test pmac SMP and Pegasos later -- but pmac smp is known broken in arch/ppc anyway, and I'll live with a potential Pegasos regression for now; it wasn't supported officially in FC4 either. I needed to fix ppc32 initrd -- we were never setting initrd_start. Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
1 parent 24bfb00 commit a82765b

3 files changed

Lines changed: 41 additions & 37 deletions

File tree

‎arch/powerpc/kernel/setup-common.c‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,46 @@ static int __init set_preferred_console(void)
405405
console_initcall(set_preferred_console);
406406
#endif /* CONFIG_PPC_MULTIPLATFORM */
407407

408+
void __init check_for_initrd(void)
409+
{
410+
#ifdef CONFIG_BLK_DEV_INITRD
411+
unsigned long *prop;
412+
413+
DBG(" -> check_for_initrd()\n");
414+
415+
if (of_chosen) {
416+
prop = (unsigned long *)get_property(of_chosen,
417+
"linux,initrd-start", NULL);
418+
if (prop != NULL) {
419+
initrd_start = (unsigned long)__va(*prop);
420+
prop = (unsigned long *)get_property(of_chosen,
421+
"linux,initrd-end", NULL);
422+
if (prop != NULL) {
423+
initrd_end = (unsigned long)__va(*prop);
424+
initrd_below_start_ok = 1;
425+
} else
426+
initrd_start = 0;
427+
}
428+
}
429+
430+
/* If we were passed an initrd, set the ROOT_DEV properly if the values
431+
* look sensible. If not, clear initrd reference.
432+
*/
433+
if (initrd_start >= KERNELBASE && initrd_end >= KERNELBASE &&
434+
initrd_end > initrd_start)
435+
ROOT_DEV = Root_RAM0;
436+
else {
437+
printk("Bogus initrd %08lx %08lx\n", initrd_start, initrd_end);
438+
initrd_start = initrd_end = 0;
439+
}
440+
441+
if (initrd_start)
442+
printk("Found initrd at 0x%lx:0x%lx\n", initrd_start, initrd_end);
443+
444+
DBG(" <- check_for_initrd()\n");
445+
#endif /* CONFIG_BLK_DEV_INITRD */
446+
}
447+
408448
#ifdef CONFIG_SMP
409449

410450
/**

‎arch/powerpc/kernel/setup_32.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ void __init setup_arch(char **cmdline_p)
286286
loops_per_jiffy = 500000000 / HZ;
287287

288288
unflatten_device_tree();
289+
check_for_initrd();
289290
finish_device_tree();
290291

291292
smp_setup_cpu_maps();

‎arch/powerpc/kernel/setup_64.c‎

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -395,43 +395,6 @@ static void __init initialize_cache_info(void)
395395
DBG(" <- initialize_cache_info()\n");
396396
}
397397

398-
static void __init check_for_initrd(void)
399-
{
400-
#ifdef CONFIG_BLK_DEV_INITRD
401-
u64 *prop;
402-
403-
DBG(" -> check_for_initrd()\n");
404-
405-
if (of_chosen) {
406-
prop = (u64 *)get_property(of_chosen,
407-
"linux,initrd-start", NULL);
408-
if (prop != NULL) {
409-
initrd_start = (unsigned long)__va(*prop);
410-
prop = (u64 *)get_property(of_chosen,
411-
"linux,initrd-end", NULL);
412-
if (prop != NULL) {
413-
initrd_end = (unsigned long)__va(*prop);
414-
initrd_below_start_ok = 1;
415-
} else
416-
initrd_start = 0;
417-
}
418-
}
419-
420-
/* If we were passed an initrd, set the ROOT_DEV properly if the values
421-
* look sensible. If not, clear initrd reference.
422-
*/
423-
if (initrd_start >= KERNELBASE && initrd_end >= KERNELBASE &&
424-
initrd_end > initrd_start)
425-
ROOT_DEV = Root_RAM0;
426-
else
427-
initrd_start = initrd_end = 0;
428-
429-
if (initrd_start)
430-
printk("Found initrd at 0x%lx:0x%lx\n", initrd_start, initrd_end);
431-
432-
DBG(" <- check_for_initrd()\n");
433-
#endif /* CONFIG_BLK_DEV_INITRD */
434-
}
435398

436399
/*
437400
* Do some initial setup of the system. The parameters are those which

0 commit comments

Comments
 (0)