[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <7362e4f6a5f5b79e6ad3fd3cec3183a4a283f7fc.1616765870.git.christophe.leroy@csgroup.eu>
Date: Fri, 26 Mar 2021 13:44:52 +0000 (UTC)
From: Christophe Leroy <christophe.leroy@...roup.eu>
To: will@...nel.org, danielwa@...co.com, robh@...nel.org,
daniel@...pelevich.san-francisco.ca.us
Cc: linux-arch@...r.kernel.org, devicetree@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org,
linux-arm-kernel@...ts.infradead.org,
microblaze <monstr@...str.eu>, linux-mips@...r.kernel.org,
nios2 <ley.foon.tan@...el.com>, openrisc@...ts.librecores.org,
linux-hexagon@...r.kernel.org, linux-riscv@...ts.infradead.org,
x86@...nel.org, linux-xtensa@...ux-xtensa.org,
linux-sh@...r.kernel.org, sparclinux@...r.kernel.org
Subject: [PATCH v3 05/17] arm: Convert to GENERIC_CMDLINE
This converts the architecture to GENERIC_CMDLINE.
Signed-off-by: Christophe Leroy <christophe.leroy@...roup.eu>
---
arch/arm/Kconfig | 38 +----------------------------------
arch/arm/kernel/atags_parse.c | 15 +++++---------
2 files changed, 6 insertions(+), 47 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 5da96f5df48f..67bc75f2da81 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -50,6 +50,7 @@ config ARM
select GENERIC_ARCH_TOPOLOGY if ARM_CPU_TOPOLOGY
select GENERIC_ATOMIC64 if CPU_V7M || CPU_V6 || !CPU_32v6K || !AEABI
select GENERIC_CLOCKEVENTS_BROADCAST if SMP
+ select GENERIC_CMDLINE if ATAGS
select GENERIC_IRQ_IPI if SMP
select GENERIC_CPU_AUTOPROBE
select GENERIC_EARLY_IOREMAP
@@ -1740,43 +1741,6 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND
endchoice
-config CMDLINE
- string "Default kernel command string"
- default ""
- help
- On some architectures (e.g. CATS), 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. As a minimum, you should specify the
- memory size and the root device (e.g., mem=64M root=/dev/nfs).
-
-choice
- prompt "Kernel command line type" if CMDLINE != ""
- default CMDLINE_FROM_BOOTLOADER
- depends on ATAGS
-
-config CMDLINE_FROM_BOOTLOADER
- bool "Use bootloader kernel arguments if available"
- help
- Uses the command-line options passed by the boot loader. If
- the boot loader doesn't provide any, the default kernel command
- string provided in CMDLINE will be used.
-
-config CMDLINE_EXTEND
- bool "Extend bootloader kernel arguments"
- help
- The command-line arguments provided by the boot loader will be
- appended to the default kernel command string.
-
-config CMDLINE_FORCE
- bool "Always use the default kernel command string"
- help
- Always use the default kernel command string, even if the boot
- loader passes other arguments to the kernel.
- This is useful if you cannot or don't want to change the
- command-line options your boot loader passes to the kernel.
-endchoice
-
config XIP_KERNEL
bool "Kernel Execute-In-Place from ROM"
depends on !ARM_LPAE && !ARCH_MULTIPLATFORM
diff --git a/arch/arm/kernel/atags_parse.c b/arch/arm/kernel/atags_parse.c
index 373b61f9a4f0..3d5bd52ee458 100644
--- a/arch/arm/kernel/atags_parse.c
+++ b/arch/arm/kernel/atags_parse.c
@@ -14,6 +14,7 @@
* is not parsed in any way).
*/
+#include <linux/cmdline.h>
#include <linux/init.h>
#include <linux/initrd.h>
#include <linux/kernel.h>
@@ -120,16 +121,10 @@ __tagtable(ATAG_REVISION, parse_tag_revision);
static int __init parse_tag_cmdline(const struct tag *tag)
{
-#if defined(CONFIG_CMDLINE_EXTEND)
- strlcat(default_command_line, " ", COMMAND_LINE_SIZE);
- strlcat(default_command_line, tag->u.cmdline.cmdline,
- COMMAND_LINE_SIZE);
-#elif defined(CONFIG_CMDLINE_FORCE)
- pr_warn("Ignoring tag cmdline (using the default kernel command line)\n");
-#else
- strlcpy(default_command_line, tag->u.cmdline.cmdline,
- COMMAND_LINE_SIZE);
-#endif
+ cmdline_build(default_command_line, tag->u.cmdline.cmdline, COMMAND_LINE_SIZE);
+
+ if IS_ENABLED(CONFIG_CMDLINE_FORCE)
+ pr_warn("Ignoring tag cmdline (using the default kernel command line)\n");
return 0;
}
--
2.25.0
Powered by blists - more mailing lists