mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-20 00:50:02 +01:00
MIPS: Make the kernel arguments from dtb available
Similar to how arm allows using selecting between bootloader arguments, dtb arguments and both, allow to select them on mips. But since we have less control over the place of the dtb do not modify it but instead use the boot_command_line for merging them. The default is "use bootloader arguments" to keep the current behaviour as default. Signed-off-by: Jonas Gorski <[email protected]> Cc: [email protected] Cc: Kevin Cernekee <[email protected]> Cc: Florian Fainelli <[email protected]> Cc: Zubair Lutfullah Kakakhel <[email protected]> Cc: James Hogan <[email protected]> Cc: John Crispin <[email protected]> Cc: Ganesan Ramalingam <[email protected]> Cc: Jayachandran C <[email protected]> Cc: Andrew Bresticker <[email protected]> Cc: James Hartley <[email protected]> Patchwork: https://patchwork.linux-mips.org/patch/11284/ Signed-off-by: Ralf Baechle <[email protected]>
This commit is contained in:
1 parent
5b24d52ce2
commit
2024972ef5
2 files changed
+33
-7
No files matched your search
@@ -2749,6 +2749,22 @@ choice
|
||||
if you don't intend to always append a DTB.
|
||||
endchoice
|
||||
|
||||
choice
|
||||
prompt "Kernel command line type" if !CMDLINE_OVERRIDE
|
||||
default MIPS_CMDLINE_FROM_BOOTLOADER
|
||||
|
||||
config MIPS_CMDLINE_FROM_DTB
|
||||
depends on USE_OF
|
||||
bool "Dtb kernel arguments if available"
|
||||
|
||||
config MIPS_CMDLINE_DTB_EXTEND
|
||||
depends on USE_OF
|
||||
bool "Extend dtb kernel arguments with bootloader arguments"
|
||||
|
||||
config MIPS_CMDLINE_FROM_BOOTLOADER
|
||||
bool "Bootloader kernel arguments if available"
|
||||
endchoice
|
||||
|
||||
endmenu
|
||||
|
||||
config LOCKDEP_SUPPORT
|
||||
|
||||
@@ -617,6 +617,10 @@ static void __init request_crashkernel(struct resource *res)
|
||||
}
|
||||
#endif /* !defined(CONFIG_KEXEC) */
|
||||
|
||||
#define USE_PROM_CMDLINE IS_ENABLED(CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER)
|
||||
#define USE_DTB_CMDLINE IS_ENABLED(CONFIG_MIPS_CMDLINE_FROM_DTB)
|
||||
#define EXTEND_WITH_PROM IS_ENABLED(CONFIG_MIPS_CMDLINE_EXTEND)
|
||||
|
||||
static void __init arch_mem_init(char **cmdline_p)
|
||||
{
|
||||
struct memblock_region *reg;
|
||||
@@ -641,18 +645,24 @@ static void __init arch_mem_init(char **cmdline_p)
|
||||
pr_info("Determined physical RAM map:\n");
|
||||
print_memory_map();
|
||||
|
||||
#ifdef CONFIG_CMDLINE_BOOL
|
||||
#ifdef CONFIG_CMDLINE_OVERRIDE
|
||||
#if defined(CONFIG_CMDLINE_BOOL) && defined(CONFIG_CMDLINE_OVERRIDE)
|
||||
strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE);
|
||||
#else
|
||||
if ((USE_PROM_CMDLINE && arcs_cmdline[0]) ||
|
||||
(USE_DTB_CMDLINE && !boot_command_line[0]))
|
||||
strlcpy(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE);
|
||||
|
||||
if (EXTEND_WITH_PROM && arcs_cmdline[0]) {
|
||||
strlcat(boot_command_line, " ", COMMAND_LINE_SIZE);
|
||||
strlcat(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE);
|
||||
}
|
||||
|
||||
#if defined(CONFIG_CMDLINE_BOOL)
|
||||
if (builtin_cmdline[0]) {
|
||||
strlcat(arcs_cmdline, " ", COMMAND_LINE_SIZE);
|
||||
strlcat(arcs_cmdline, builtin_cmdline, COMMAND_LINE_SIZE);
|
||||
strlcat(boot_command_line, " ", COMMAND_LINE_SIZE);
|
||||
strlcat(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE);
|
||||
}
|
||||
strlcpy(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE);
|
||||
#endif
|
||||
#else
|
||||
strlcpy(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE);
|
||||
#endif
|
||||
strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE);
|
||||
|
||||
|
||||
Reference in new issue
Block a user