diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-09-06 19:32:21 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-09-06 19:32:21 -0700 |
commit | a22a9a90cfbcc91c3e0f8dc8549535e2786d3e7e (patch) | |
tree | 799e60e111e2f5179c7ffd81483abd1d2397003b /arch/mips/kernel/setup.c | |
parent | 70bb08962ea9bd50797ae9f16b2493f5f7c65053 (diff) | |
parent | 0011036beeffeada15acd1936d67988de21ca65e (diff) | |
download | talos-obmc-linux-a22a9a90cfbcc91c3e0f8dc8549535e2786d3e7e.tar.gz talos-obmc-linux-a22a9a90cfbcc91c3e0f8dc8549535e2786d3e7e.zip |
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus:
[MIPS] Probe initrd header only if explicitly specified
[MIPS] TX39xx: Add missing local_flush_icache_range initialization
[MIPS] TXx9: Fix txx9_pcode initialization
[MIPS] Fix WARNING: at kernel/smp.c:290
[MIPS] Fix data bus error recovery
Diffstat (limited to 'arch/mips/kernel/setup.c')
-rw-r--r-- | arch/mips/kernel/setup.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index 2aae76bce293..16f8edfe5cdc 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c @@ -160,30 +160,33 @@ early_param("rd_size", rd_size_early); static unsigned long __init init_initrd(void) { unsigned long end; - u32 *initrd_header; /* * Board specific code or command line parser should have * already set up initrd_start and initrd_end. In these cases * perfom sanity checks and use them if all looks good. */ - if (initrd_start && initrd_end > initrd_start) - goto sanitize; + if (!initrd_start || initrd_end <= initrd_start) { +#ifdef CONFIG_PROBE_INITRD_HEADER + u32 *initrd_header; - /* - * See if initrd has been added to the kernel image by - * arch/mips/boot/addinitrd.c. In that case a header is - * prepended to initrd and is made up by 8 bytes. The fisrt - * word is a magic number and the second one is the size of - * initrd. Initrd start must be page aligned in any cases. - */ - initrd_header = __va(PAGE_ALIGN(__pa_symbol(&_end) + 8)) - 8; - if (initrd_header[0] != 0x494E5244) + /* + * See if initrd has been added to the kernel image by + * arch/mips/boot/addinitrd.c. In that case a header is + * prepended to initrd and is made up by 8 bytes. The first + * word is a magic number and the second one is the size of + * initrd. Initrd start must be page aligned in any cases. + */ + initrd_header = __va(PAGE_ALIGN(__pa_symbol(&_end) + 8)) - 8; + if (initrd_header[0] != 0x494E5244) + goto disable; + initrd_start = (unsigned long)(initrd_header + 2); + initrd_end = initrd_start + initrd_header[1]; +#else goto disable; - initrd_start = (unsigned long)(initrd_header + 2); - initrd_end = initrd_start + initrd_header[1]; +#endif + } -sanitize: if (initrd_start & ~PAGE_MASK) { pr_err("initrd start must be page aligned\n"); goto disable; |