--- v4
+++ v3
@@ -2,88 +2,96 @@
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
- arch/microblaze/Kconfig | 24 +-----------------------
- arch/microblaze/configs/mmu_defconfig | 2 +-
- arch/microblaze/kernel/head.S | 4 ++--
- 3 files changed, 4 insertions(+), 26 deletions(-)
+ arch/riscv/Kconfig | 44 +--------------------------------------
+ arch/riscv/kernel/setup.c | 5 ++---
+ 2 files changed, 3 insertions(+), 46 deletions(-)
-diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig
-index 0660f47012bc..1242f34bc2a2 100644
---- a/arch/microblaze/Kconfig
-+++ b/arch/microblaze/Kconfig
-@@ -15,6 +15,7 @@ config MICROBLAZE
- select COMMON_CLK
- select DMA_DIRECT_REMAP
- select GENERIC_ATOMIC64
+diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
+index 87d7b52f278f..3dbd50bed037 100644
+--- a/arch/riscv/Kconfig
++++ b/arch/riscv/Kconfig
+@@ -39,6 +39,7 @@ config RISCV
+ select EDAC_SUPPORT
+ select GENERIC_ARCH_TOPOLOGY if SMP
+ select GENERIC_ATOMIC64 if !64BIT
+ select GENERIC_CMDLINE
- select GENERIC_CPU_DEVICES
- select GENERIC_IDLE_POLL_SETUP
- select GENERIC_IRQ_PROBE
-@@ -93,29 +94,6 @@ source "kernel/Kconfig.hz"
- config MMU
- def_bool y
+ select GENERIC_EARLY_IOREMAP
+ select GENERIC_GETTIMEOFDAY if HAVE_GENERIC_VDSO
+ select GENERIC_IOREMAP
+@@ -390,49 +391,6 @@ endmenu
--comment "Boot options"
+ menu "Boot options"
+
+-config CMDLINE
+- string "Built-in kernel command line"
+- help
+- For most platforms, the arguments for the kernel's command line
+- are provided at run-time, during boot. However, there are cases
+- where either no arguments are being provided or the provided
+- arguments are insufficient or even invalid.
-
--config CMDLINE_BOOL
-- bool "Default bootloader kernel arguments"
+- When that occurs, it is possible to define a built-in command
+- line here and choose how the kernel should use it later on.
-
--config CMDLINE
-- string "Default kernel command string"
-- depends on CMDLINE_BOOL
-- default "console=ttyUL0,115200"
+-choice
+- prompt "Built-in command line usage" if CMDLINE != ""
+- default CMDLINE_FALLBACK
- help
-- On some architectures there is currently no way for the boot loader
-- to pass arguments to the kernel. For these architectures, you should
-- supply some command-line options at build time by entering them
-- here.
+- Choose how the kernel will handle the provided built-in command
+- line.
+-
+-config CMDLINE_FALLBACK
+- bool "Use bootloader kernel arguments if available"
+- help
+- Use the built-in command line as fallback in case we get nothing
+- during boot. This is the default behaviour.
+-
+-config CMDLINE_EXTEND
+- bool "Extend bootloader kernel arguments"
+- help
+- The command-line arguments provided during boot will be
+- appended to the built-in command line. This is useful in
+- cases where the provided arguments are insufficient and
+- you don't want to or cannot modify them.
+-
-
-config CMDLINE_FORCE
-- bool "Force default kernel command string"
-- depends on CMDLINE_BOOL
-- default n
+- bool "Always use the default kernel command string"
- help
-- Set this to have arguments from the default kernel command string
-- override those passed by the boot loader.
+- Always use the built-in command line, even if we get one during
+- boot. This is useful in case you need to override the provided
+- command line on systems where you don't have or want control
+- over it.
-
- endmenu
+-endchoice
+-
+ config EFI_STUB
+ bool
- menu "Kernel features"
-diff --git a/arch/microblaze/configs/mmu_defconfig b/arch/microblaze/configs/mmu_defconfig
-index 51337fffb947..b4d2219d0a8f 100644
---- a/arch/microblaze/configs/mmu_defconfig
-+++ b/arch/microblaze/configs/mmu_defconfig
-@@ -16,7 +16,7 @@ CONFIG_XILINX_MICROBLAZE0_USE_DIV=1
- CONFIG_XILINX_MICROBLAZE0_USE_HW_MUL=2
- CONFIG_XILINX_MICROBLAZE0_USE_FPU=2
- CONFIG_HZ_100=y
--CONFIG_CMDLINE_BOOL=y
-+CONFIG_CMDLINE="console=ttyUL0,115200"
- CONFIG_CMDLINE_FORCE=y
- CONFIG_HIGHMEM=y
- CONFIG_PCI_XILINX=y
-diff --git a/arch/microblaze/kernel/head.S b/arch/microblaze/kernel/head.S
-index ec2fcb545e64..605b18c86ac8 100644
---- a/arch/microblaze/kernel/head.S
-+++ b/arch/microblaze/kernel/head.S
-@@ -105,7 +105,7 @@ _copy_fdt:
- addik r3, r3, -4 /* descrement loop */
- no_fdt_arg:
+diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
+index f8f15332caa2..e7c91ee478d1 100644
+--- a/arch/riscv/kernel/setup.c
++++ b/arch/riscv/kernel/setup.c
+@@ -20,6 +20,7 @@
+ #include <linux/swiotlb.h>
+ #include <linux/smp.h>
+ #include <linux/efi.h>
++#include <linux/cmdline.h>
--#ifndef CONFIG_CMDLINE_BOOL
-+#if CONFIG_CMDLINE == ""
- /*
- * handling command line
- * copy command line directly to cmd_line placed in data section.
-@@ -126,7 +126,7 @@ _copy_command_line:
- addik r5, r4, 0 /* add new space for command line */
- tovirt(r5,r5)
- skip:
--#endif /* CONFIG_CMDLINE_BOOL */
-+#endif /* CONFIG_CMDLINE */
+ #include <asm/cpu_ops.h>
+ #include <asm/early_ioremap.h>
+@@ -228,10 +229,8 @@ static void __init parse_dtb(void)
+ }
- #ifdef NOT_COMPILE
- /* save bram context */
+ pr_err("No DTB passed to the kernel\n");
+-#ifdef CONFIG_CMDLINE_FORCE
+- strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
++ cmdline_build(boot_command_line, NULL, COMMAND_LINE_SIZE);
+ pr_info("Forcing kernel command line to: %s\n", boot_command_line);
+-#endif
+ }
+
+ void __init setup_arch(char **cmdline_p)
--
2.25.0