diff options
Diffstat (limited to 'arch/mips/kernel/setup.c')
-rw-r--r-- | arch/mips/kernel/setup.c | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index 2b290d70083e..f9513f9e61d3 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c | |||
@@ -58,8 +58,12 @@ EXPORT_SYMBOL(mips_machtype); | |||
58 | 58 | ||
59 | struct boot_mem_map boot_mem_map; | 59 | struct boot_mem_map boot_mem_map; |
60 | 60 | ||
61 | static char command_line[CL_SIZE]; | 61 | static char __initdata command_line[COMMAND_LINE_SIZE]; |
62 | char arcs_cmdline[CL_SIZE]=CONFIG_CMDLINE; | 62 | char __initdata arcs_cmdline[COMMAND_LINE_SIZE]; |
63 | |||
64 | #ifdef CONFIG_CMDLINE_BOOL | ||
65 | static char __initdata builtin_cmdline[COMMAND_LINE_SIZE] = CONFIG_CMDLINE; | ||
66 | #endif | ||
63 | 67 | ||
64 | /* | 68 | /* |
65 | * mips_io_port_base is the begin of the address space to which x86 style | 69 | * mips_io_port_base is the begin of the address space to which x86 style |
@@ -166,26 +170,8 @@ static unsigned long __init init_initrd(void) | |||
166 | * already set up initrd_start and initrd_end. In these cases | 170 | * already set up initrd_start and initrd_end. In these cases |
167 | * perfom sanity checks and use them if all looks good. | 171 | * perfom sanity checks and use them if all looks good. |
168 | */ | 172 | */ |
169 | if (!initrd_start || initrd_end <= initrd_start) { | 173 | if (!initrd_start || initrd_end <= initrd_start) |
170 | #ifdef CONFIG_PROBE_INITRD_HEADER | ||
171 | u32 *initrd_header; | ||
172 | |||
173 | /* | ||
174 | * See if initrd has been added to the kernel image by | ||
175 | * arch/mips/boot/addinitrd.c. In that case a header is | ||
176 | * prepended to initrd and is made up by 8 bytes. The first | ||
177 | * word is a magic number and the second one is the size of | ||
178 | * initrd. Initrd start must be page aligned in any cases. | ||
179 | */ | ||
180 | initrd_header = __va(PAGE_ALIGN(__pa_symbol(&_end) + 8)) - 8; | ||
181 | if (initrd_header[0] != 0x494E5244) | ||
182 | goto disable; | ||
183 | initrd_start = (unsigned long)(initrd_header + 2); | ||
184 | initrd_end = initrd_start + initrd_header[1]; | ||
185 | #else | ||
186 | goto disable; | 174 | goto disable; |
187 | #endif | ||
188 | } | ||
189 | 175 | ||
190 | if (initrd_start & ~PAGE_MASK) { | 176 | if (initrd_start & ~PAGE_MASK) { |
191 | pr_err("initrd start must be page aligned\n"); | 177 | pr_err("initrd start must be page aligned\n"); |
@@ -476,8 +462,20 @@ static void __init arch_mem_init(char **cmdline_p) | |||
476 | pr_info("Determined physical RAM map:\n"); | 462 | pr_info("Determined physical RAM map:\n"); |
477 | print_memory_map(); | 463 | print_memory_map(); |
478 | 464 | ||
479 | strlcpy(command_line, arcs_cmdline, sizeof(command_line)); | 465 | #ifdef CONFIG_CMDLINE_BOOL |
480 | strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE); | 466 | #ifdef CONFIG_CMDLINE_OVERRIDE |
467 | strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE); | ||
468 | #else | ||
469 | if (builtin_cmdline[0]) { | ||
470 | strlcat(arcs_cmdline, " ", COMMAND_LINE_SIZE); | ||
471 | strlcat(arcs_cmdline, builtin_cmdline, COMMAND_LINE_SIZE); | ||
472 | } | ||
473 | strlcpy(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE); | ||
474 | #endif | ||
475 | #else | ||
476 | strlcpy(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE); | ||
477 | #endif | ||
478 | strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE); | ||
481 | 479 | ||
482 | *cmdline_p = command_line; | 480 | *cmdline_p = command_line; |
483 | 481 | ||