Linux-RISC-V Archive on
 help / color / Atom feed
From: Palmer Dabbelt <>
Cc:, Palmer Dabbelt <>
Subject: [PATCH v4] RISC-V: Update Kconfig to better handle CMDLINE
Date: Mon, 19 Nov 2018 13:04:02 -0800
Message-ID: <> (raw)
Message-ID: <20181119210402.j13QTcfYvfPQwsRf5Q4itFoyo2ZaJc4FdhuPjRof8Z4@z> (raw)

From: Nick Kossifidis <>

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.

Signed-off-by: Nick Kossifidis <>
Signed-off-by: Debbie Maliotaki <>
Signed-off-by: Palmer Dabbelt <>
 arch/riscv/Kconfig | 57 +++++++++++++++++++++++++++-------------------
 1 file changed, 33 insertions(+), 24 deletions(-)

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index 55da93f4e818..808624f6b906 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -227,39 +227,48 @@ endmenu
 menu "Boot options"
-	bool "Built-in kernel command line"
+config CMDLINE
+	string "Built-in kernel command line"
-	  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.
+	  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.
-	  For that, choose 'Y' here and fill in the extra boot parameters
+	  When that occurs, it is possible to define a built-in command
+	  line here and choose how the kernel should use it later on.
-	  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.
+	prompt "Built-in command line usage" if CMDLINE != ""
+	help
+	  Choose how the kernel will handle the provided built-in command
+	  line.
-config CMDLINE
-	string "Built-in kernel command string"
-	depends on CMDLINE_BOOL
-	default ""
+	bool "Fallback"
-	  Supply command-line options at build time by entering them here.
+	  Use the built-in command line as fallback in case we get nothing
+	  during boot. This is the default behaviour.
+	bool "Extension"
+	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.
-	bool "Built-in command line overrides bootloader arguments"
-	depends on CMDLINE_BOOL
+	bool "Forced"
-	  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.
+	  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.
-	  If you don't know what to do here, say N.

linux-riscv mailing list

             reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-19 21:04 palmer [this message]
2018-11-19 21:04 ` Palmer Dabbelt

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-RISC-V Archive on

Archives are clonable:
	git clone --mirror linux-riscv/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-riscv linux-riscv/ \
	public-inbox-index linux-riscv

Newsgroup available over NNTP:

AGPL code for this site: git clone public-inbox