Skip to contentSkip to conversation

RISC-V: Update Kconfig to better handle CMDLINE

PATCH New Nick Kossifidis 2 participants 3 messages Oct 4, 2018 – Nov 9, 2018 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RISC-V: Update Kconfig to better handle CMDLINE

Add a menu to chose how the built-in command line will be used and add CMDLINE_EXTEND for compatibility with FDT code.

---
 arch/riscv/Kconfig | 45 ++++++++++++++++++++++++---------------------
 1 file changed, 24 insertions(+), 21 deletions(-)
arch/riscv/Kconfig +24 -21
index 82172bf85..cce141552 100644
@@ -218,39 +218,42 @@ endmenu
 
 menu "Boot options"
 
-config CMDLINE_BOOL
-	bool "Built-in kernel command line"
+config CMDLINE
+	string "Built-in kernel command line"
 	help
 	  For most platforms, it is firmware or second stage bootloader
 	  that by default specifies the kernel command line options.
 	  However, it might be necessary or advantageous to either override
-	  the default kernel command line or add a few extra options to it.
-	  For such cases, this option allows hardcoding command line options
-	  directly into the kernel.
+	  the provided kernel command line or add a few extra options to it.
+	  For such cases, it is possible to define a built-in command line
+	  here and chose how the kernel should use it later on.
 
-	  For that, choose 'Y' here and fill in the extra boot parameters
-	  in CONFIG_CMDLINE.
+choice
+	prompt "Built-in command line usage" if CMDLINE != ""
+	default CMDLINE_FALLBACK
+	help
+	  Chose how the kernel will handle the provided built-in command
+	  line.
 
-	  The built-in options will be concatenated to the default command
-	  line if CMDLINE_FORCE is set to 'N'. Otherwise, the default
-	  command line will be ignored and replaced by the built-in string.
+config CMDLINE_FALLBACK
+	bool "Fallback"
+	help
+	  Use the built-in command line as fallback in case we get nothing
+	  from the boot loader.
 
-config CMDLINE
-	string "Built-in kernel command string"
-	depends on CMDLINE_BOOL
-	default ""
+config CMDLINE_EXTEND
+	bool "Extension"
 	help
-	  Supply command-line options at build time by entering them here.
+	  Use the built-in command line as an extension of the command line
+	  provided by the boot loader.
 
 config CMDLINE_FORCE
-	bool "Built-in command line overrides bootloader arguments"
-	depends on CMDLINE_BOOL
+	bool "Forced"
 	help
-	  Set this option to 'Y' to have the kernel ignore the bootloader
-	  or firmware command line.  Instead, the built-in command line
-	  will be used exclusively.
+	  Use the built-in command line in place of the command line
+	  provided by the boot loader.
 
-	  If you don't know what to do here, say N.
+endchoice
 
 endmenu
 
Signature · 1 line
2.16.4
#1 lore raw

PATCH 1/1 RISC-V: Update Kconfig to better handle CMDLINE

Hello Palmer,

???? 2018-10-04 14:32, Nick Kossifidis ??????:

Quoted 65 lines

Add a menu to chose how the built-in command line will be used and add CMDLINE_EXTEND for compatibility with FDT code.

---
 arch/riscv/Kconfig | 45 ++++++++++++++++++++++++---------------------
 1 file changed, 24 insertions(+), 21 deletions(-)
arch/riscv/Kconfig +21 -17
index 82172bf85..cce141552 100644
@@ -218,39 +218,42 @@ endmenu
 
 menu "Boot options"
 
-config CMDLINE_BOOL
-	bool "Built-in kernel command line"
+config CMDLINE
+	string "Built-in kernel command line"
 	help
 	  For most platforms, it is firmware or second stage bootloader
 	  that by default specifies the kernel command line options.
 	  However, it might be necessary or advantageous to either override
-	  the default kernel command line or add a few extra options to it.
-	  For such cases, this option allows hardcoding command line options
-	  directly into the kernel.
+	  the provided kernel command line or add a few extra options to it.
+	  For such cases, it is possible to define a built-in command line
+	  here and chose how the kernel should use it later on.
 
-	  For that, choose 'Y' here and fill in the extra boot parameters
-	  in CONFIG_CMDLINE.
+choice
+	prompt "Built-in command line usage" if CMDLINE != ""
+	default CMDLINE_FALLBACK
+	help
+	  Chose how the kernel will handle the provided built-in command
+	  line.
 
-	  The built-in options will be concatenated to the default command
-	  line if CMDLINE_FORCE is set to 'N'. Otherwise, the default
-	  command line will be ignored and replaced by the built-in string.
+config CMDLINE_FALLBACK
+	bool "Fallback"
+	help
+	  Use the built-in command line as fallback in case we get nothing
+	  from the boot loader.
 
-config CMDLINE
-	string "Built-in kernel command string"
-	depends on CMDLINE_BOOL
-	default ""
+config CMDLINE_EXTEND
+	bool "Extension"
 	help
-	  Supply command-line options at build time by entering them here.
+	  Use the built-in command line as an extension of the command line
+	  provided by the boot loader.
 
 config CMDLINE_FORCE
-	bool "Built-in command line overrides bootloader arguments"
-	depends on CMDLINE_BOOL
+	bool "Forced"
 	help

arch/riscv/Kconfig endmenu · line 258

Quoted 10 lines
arch/riscv/Kconfig +3 -4
-	  Set this option to 'Y' to have the kernel ignore the bootloader
-	  or firmware command line.  Instead, the built-in command line
-	  will be used exclusively.
+	  Use the built-in command line in place of the command line
+	  provided by the boot loader.
 
-	  If you don't know what to do here, say N.
+endchoice
 
 endmenu

Since we'll be using FDT only for handling cmdline, this one is still needed
because FDT code uses CMDLINE_EXTEND / FALLBACK instead. Do you want me to
re-send ?

#2 lore raw

PATCH 1/1 RISC-V: Update Kconfig to better handle CMDLINE

Quoted 77 lines · mick at ics.forth.gr

Hello Palmer,

???? 2018-10-04 14:32, Nick Kossifidis ??????:

Quoted 74 lines

Add a menu to chose how the built-in command line will be used and add CMDLINE_EXTEND for compatibility with FDT code.

---
 arch/riscv/Kconfig | 45 ++++++++++++++++++++++++---------------------
 1 file changed, 24 insertions(+), 21 deletions(-)
arch/riscv/Kconfig +24 -21
index 82172bf85..cce141552 100644
@@ -218,39 +218,42 @@ endmenu
 
 menu "Boot options"
 
-config CMDLINE_BOOL
-	bool "Built-in kernel command line"
+config CMDLINE
+	string "Built-in kernel command line"
 	help
 	  For most platforms, it is firmware or second stage bootloader
 	  that by default specifies the kernel command line options.
 	  However, it might be necessary or advantageous to either override
-	  the default kernel command line or add a few extra options to it.
-	  For such cases, this option allows hardcoding command line options
-	  directly into the kernel.
+	  the provided kernel command line or add a few extra options to it.
+	  For such cases, it is possible to define a built-in command line
+	  here and chose how the kernel should use it later on.
 
-	  For that, choose 'Y' here and fill in the extra boot parameters
-	  in CONFIG_CMDLINE.
+choice
+	prompt "Built-in command line usage" if CMDLINE != ""
+	default CMDLINE_FALLBACK
+	help
+	  Chose how the kernel will handle the provided built-in command
+	  line.
 
-	  The built-in options will be concatenated to the default command
-	  line if CMDLINE_FORCE is set to 'N'. Otherwise, the default
-	  command line will be ignored and replaced by the built-in string.
+config CMDLINE_FALLBACK
+	bool "Fallback"
+	help
+	  Use the built-in command line as fallback in case we get nothing
+	  from the boot loader.
 
-config CMDLINE
-	string "Built-in kernel command string"
-	depends on CMDLINE_BOOL
-	default ""
+config CMDLINE_EXTEND
+	bool "Extension"
 	help
-	  Supply command-line options at build time by entering them here.
+	  Use the built-in command line as an extension of the command line
+	  provided by the boot loader.
 
 config CMDLINE_FORCE
-	bool "Built-in command line overrides bootloader arguments"
-	depends on CMDLINE_BOOL
+	bool "Forced"
 	help
-	  Set this option to 'Y' to have the kernel ignore the bootloader
-	  or firmware command line.  Instead, the built-in command line
-	  will be used exclusively.
+	  Use the built-in command line in place of the command line
+	  provided by the boot loader.
 
-	  If you don't know what to do here, say N.
+endchoice
 
Quoted 7 lines

arch/riscv/Kconfig endmenu · line 258

Quoted 1 line
arch/riscv/Kconfig +0 -0
 endmenu

Since we'll be using FDT only for handling cmdline, this one is still needed
because FDT code uses CMDLINE_EXTEND / FALLBACK instead. Do you want me to
re-send ?

That would be great, thanks. I lost track of the discussion on the generic fix.