Skip to content

Commit 3aed8c4

Browse files
mickflemmpalmer-dabbelt
authored andcommitted
RISC-V: Update Kconfig to better handle CMDLINE
Added a menu to choose how the built-in command line will be used and CMDLINE_EXTEND for compatibility with FDT code. v2: Improved help messages, removed references to bootloader and made them more descriptive. I also asked help from a friend who's a language expert just in case. v3: This time used the corrected text v4: Copy the config strings from the arm32 port. v5: Actually copy the config strings from the arm32 port. Signed-off-by: Nick Kossifidis <mick@ics.forth.gr> Signed-off-by: Debbie Maliotaki <dmaliotaki@gmail.com> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
1 parent 397182e commit 3aed8c4

File tree

1 file changed

+33
-24
lines changed

1 file changed

+33
-24
lines changed

arch/riscv/Kconfig

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -227,39 +227,48 @@ endmenu
227227

228228
menu "Boot options"
229229

230-
config CMDLINE_BOOL
231-
bool "Built-in kernel command line"
230+
config CMDLINE
231+
string "Built-in kernel command line"
232232
help
233-
For most platforms, it is firmware or second stage bootloader
234-
that by default specifies the kernel command line options.
235-
However, it might be necessary or advantageous to either override
236-
the default kernel command line or add a few extra options to it.
237-
For such cases, this option allows hardcoding command line options
238-
directly into the kernel.
233+
For most platforms, the arguments for the kernel's command line
234+
are provided at run-time, during boot. However, there are cases
235+
where either no arguments are being provided or the provided
236+
arguments are insufficient or even invalid.
239237

240-
For that, choose 'Y' here and fill in the extra boot parameters
241-
in CONFIG_CMDLINE.
238+
When that occurs, it is possible to define a built-in command
239+
line here and choose how the kernel should use it later on.
242240

243-
The built-in options will be concatenated to the default command
244-
line if CMDLINE_FORCE is set to 'N'. Otherwise, the default
245-
command line will be ignored and replaced by the built-in string.
241+
choice
242+
prompt "Built-in command line usage" if CMDLINE != ""
243+
default CMDLINE_FALLBACK
244+
help
245+
Choose how the kernel will handle the provided built-in command
246+
line.
246247

247-
config CMDLINE
248-
string "Built-in kernel command string"
249-
depends on CMDLINE_BOOL
250-
default ""
248+
config CMDLINE_FALLBACK
249+
bool "Use bootloader kernel arguments if available"
251250
help
252-
Supply command-line options at build time by entering them here.
251+
Use the built-in command line as fallback in case we get nothing
252+
during boot. This is the default behaviour.
253+
254+
config CMDLINE_EXTEND
255+
bool "Extend bootloader kernel arguments"
256+
help
257+
The command-line arguments provided during boot will be
258+
appended to the built-in command line. This is useful in
259+
cases where the provided arguments are insufficient and
260+
you don't want to or cannot modify them.
261+
253262

254263
config CMDLINE_FORCE
255-
bool "Built-in command line overrides bootloader arguments"
256-
depends on CMDLINE_BOOL
264+
bool "Always use the default kernel command string"
257265
help
258-
Set this option to 'Y' to have the kernel ignore the bootloader
259-
or firmware command line. Instead, the built-in command line
260-
will be used exclusively.
266+
Always use the built-in command line, even if we get one during
267+
boot. This is useful in case you need to override the provided
268+
command line on systems where you don't have or want control
269+
over it.
261270

262-
If you don't know what to do here, say N.
271+
endchoice
263272

264273
endmenu
265274

0 commit comments

Comments
 (0)