Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6acc7d48 authored by Dmitri Vorobiev's avatar Dmitri Vorobiev Committed by Ralf Baechle
Browse files

MIPS: Fix and enhance built-in kernel command line



Currently, MIPS kernels silently overwrite kernel command-line parameters
hardcoded in CONFIG_CMDLINE by the ones received from firmware.  Therefore,
using firmware remains the only reliable method to transfer the
command-line parameters, which is not always desirable or convenient, and
the CONFIG_CMDLINE option is thereby effectively rendered useless.

This patch fixes the problem described above and introduces a more flexible
scheme of handling the kernel command line, in a manner identical to what is
currently used for x86.  The default behavior, i.e. when CONFIG_CMDLINE_BOOL
is not defined, retains the existing semantics, and firmware command-line
arguments override the hardcoded ones.

[Ralf: I fixed up all the defconfig files so the stay unaffected by this
change.]

Signed-off-by: default avatarDmitri Vorobiev <dmitri.vorobiev@movial.com>
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/689/


Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent de4148f3
Loading
Loading
Loading
Loading
+41 −4
Original line number Diff line number Diff line
@@ -20,15 +20,52 @@ config EARLY_PRINTK
	  doesn't cooperate with an X server. You should normally say N here,
	  unless you want to debug such a crash.

config CMDLINE_BOOL
	bool "Built-in kernel command line"
	default n
	help
	  For most systems, 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 you to hardcode your own
	  command line options directly into the kernel.  For that, you
	  should choose 'Y' here, and fill in the extra boot arguments
	  in CONFIG_CMDLINE.

	  The built-in options will be concatenated to the default command
	  line if CMDLINE_OVERRIDE is set to 'N'. Otherwise, the default
	  command line will be ignored and replaced by the built-in string.

	  Most MIPS systems will normally expect 'N' here and rely upon
	  the command line from the firmware or the second-stage bootloader.

config CMDLINE
	string "Default kernel command string"
	depends on CMDLINE_BOOL
	default ""
	help
	  On some platforms, there is currently no way for the boot loader to
	  pass arguments to the kernel. For these platforms, you can supply
	  some command-line options at build time by entering them here.  In
	  other cases you can specify kernel args so that you don't have
	  to set them up in board prom initialization routines.
	  pass arguments to the kernel.  For these platforms, and for the cases
	  when you want to add some extra options to the command line or ignore
	  the default command line, you can supply some command-line options at
	  build time by entering them here.  In other cases you can specify
	  kernel args so that you don't have to set them up in board prom
	  initialization routines.

	  For more information, see the CMDLINE_BOOL and CMDLINE_OVERRIDE
	  options.

config CMDLINE_OVERRIDE
	bool "Built-in command line overrides firware arguments"
	default n
	depends on CMDLINE_BOOL
	help
	  By setting this option to 'Y' you will have your kernel ignore
	  command line arguments from firmware or second stage bootloader.
	  Instead, the built-in command line will be used exclusively.

	  Normally, you will choose 'N' here.

config DEBUG_STACK_USAGE
	bool "Enable stack utilization instrumentation"
+2 −0
Original line number Diff line number Diff line
@@ -1051,7 +1051,9 @@ CONFIG_TRACING_SUPPORT=y
# CONFIG_DYNAMIC_DEBUG is not set
# CONFIG_SAMPLES is not set
CONFIG_HAVE_ARCH_KGDB=y
CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="rootfstype=squashfs,jffs2"
# CONFIG_CMDLINE_OVERRIDE is not set

#
# Security options
+1 −1
Original line number Diff line number Diff line
@@ -1852,7 +1852,7 @@ CONFIG_DEBUG_FS=y
# CONFIG_HEADERS_CHECK is not set
# CONFIG_DEBUG_KERNEL is not set
# CONFIG_SAMPLES is not set
CONFIG_CMDLINE=""
# CONFIG_CMDLINE_BOOL is not set

#
# Security options
+2 −0
Original line number Diff line number Diff line
@@ -941,7 +941,9 @@ CONFIG_TRACING_SUPPORT=y
# CONFIG_BLK_DEV_IO_TRACE is not set
# CONFIG_SAMPLES is not set
CONFIG_HAVE_ARCH_KGDB=y
CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="console=ttyS0,115200"
# CONFIG_CMDLINE_OVERRIDE is not set

#
# Security options
+1 −1
Original line number Diff line number Diff line
@@ -1236,7 +1236,7 @@ CONFIG_DEBUG_MUTEXES=y
# CONFIG_BACKTRACE_SELF_TEST is not set
# CONFIG_FAULT_INJECTION is not set
# CONFIG_SAMPLES is not set
CONFIG_CMDLINE=""
# CONFIG_CMDLINE_BOOL is not set
# CONFIG_DEBUG_STACK_USAGE is not set
# CONFIG_SB1XXX_CORELIS is not set
# CONFIG_RUNTIME_DEBUG is not set
Loading