Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2152438pxb; Mon, 8 Mar 2021 16:04:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJyc92vjHNtd0WedlcTWg5d+ZI+joO/BTdVZ61yhMyhRz51Z56AJUIWVmBEd0y8vzlbWb6p/ X-Received: by 2002:a17:906:4e17:: with SMTP id z23mr17637851eju.439.1615248281120; Mon, 08 Mar 2021 16:04:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615248281; cv=none; d=google.com; s=arc-20160816; b=KtMtgbC9WcWs3LW2YV9XW3SEjTeVwgAFsAeTAoNrGKK3nShfhm1U3/vpJ3cLelPm6/ QCgzz7PpFENrPiAX5JA3NhXH+Q1rD+LMPj92WdJr2lKibepIVmg7bQm/i7xSs/KNIuIU dHEpSvrFcPVDKpJTOquB4sOBKjrniuLwg+5NCTZaSx2FvCusV/z05z1nMlwFqgP8IEip FWMyCMvMA8Kq4bh7JU8ip7s98M62z4ZrkV7rWlGaLgueF/Dp1pP8Hh3m1hPLEcCnukkB rJuMh2aMMUu9lj1klDdwOPB36khT99M4E7zvNTyCQdw8qWGg8Km7oeR/MjkptGkeOcoQ JorA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=06M54fnwPMxHq2cgcF444Lw1xD/JirHaXQuVh80vByA=; b=kznJwbHPoThhktxVZnEgX9CzrHP9fXNkd/DCCqyE0BlDC1pmpWDBtJTjmo+tivkJpZ rEi7zKjTA/bttkO0QQ2N3RSEgJdSbsOlwOZFJ2ieyVzu0QswfJ0PjHJxIXqXG+KnBr+X LE0KLpzCl7Ayrk+yKhT7HxEmJJ0JX5myO62wr77nPRmtNHmbkY5RTl47BxOqHnXc7AIf kCIBNGIZqMgIPPESDCwQl3F+Tztu7UQ25UEz6SiSjVEjxr1AeAB4gTJCXWzezXFL9mkz t6oCaplW/R2B/zueg7esSyJZrjTfNmyikW3v1VjYwbsbMcHMF97lj+6khQ80wlWPswex PClw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cisco.com header.s=iport header.b="K3rY3r/U"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=cisco.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v25si7950431ejw.423.2021.03.08.16.04.18; Mon, 08 Mar 2021 16:04:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cisco.com header.s=iport header.b="K3rY3r/U"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=cisco.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231571AbhCIADY (ORCPT + 99 others); Mon, 8 Mar 2021 19:03:24 -0500 Received: from alln-iport-3.cisco.com ([173.37.142.90]:13293 "EHLO alln-iport-3.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230070AbhCIADC (ORCPT ); Mon, 8 Mar 2021 19:03:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=6015; q=dns/txt; s=iport; t=1615248182; x=1616457782; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=8l0bK94TuqRd/jaDGX0hKXyHwTv+cw8NzkR9I9vUuIo=; b=K3rY3r/UCiVcmx1nEh7q1paUAM/64R+NO8Yoke6gAUxnoTiTpYb66BAF MXBDRyfAGxJuRTbIGQimBghWWE+SRnHjhViEOLAM03JS5CGnLlLUbeWLA FmSYZSDfFnFFyWJ8MC8iUqHf2R0oc3h63ek5s7OXhw/136sd4WJVjfgMw 0=; X-IronPort-AV: E=Sophos;i="5.81,233,1610409600"; d="scan'208";a="658595592" Received: from alln-core-2.cisco.com ([173.36.13.135]) by alln-iport-3.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 09 Mar 2021 00:03:00 +0000 Received: from zorba.cisco.com ([10.24.7.91]) by alln-core-2.cisco.com (8.15.2/8.15.2) with ESMTP id 12902mKg014497; Tue, 9 Mar 2021 00:02:59 GMT From: Daniel Walker To: Will Deacon , Christophe Leroy , Rob Herring , Daniel Gimpelevich , Andrew Morton , x86@kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, xe-linux-external@cisco.com, Thomas Bogendoerfer Cc: Ruslan Ruslichenko , Ruslan Bilovol , linux-kernel@vger.kernel.org Subject: [PATCH v2 6/7] CMDLINE: mips: convert to generic builtin command line Date: Mon, 8 Mar 2021 16:02:42 -0800 Message-Id: <20210309000247.2989531-7-danielwa@cisco.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Auto-Response-Suppress: DR, OOF, AutoReply X-Outbound-SMTP-Client: 10.24.7.91, [10.24.7.91] X-Outbound-Node: alln-core-2.cisco.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This updates the mips code to use the CONFIG_GENERIC_CMDLINE option. This deletes the option for MIPS_CMDLINE_BUILTIN_EXTEND and replaces the functionality with generic code. Cc: xe-linux-external@cisco.com Signed-off-by: Ruslan Ruslichenko Signed-off-by: Ruslan Bilovol Signed-off-by: Daniel Walker --- arch/mips/Kconfig | 4 +--- arch/mips/Kconfig.debug | 44 ---------------------------------------- arch/mips/kernel/setup.c | 36 ++++---------------------------- 3 files changed, 5 insertions(+), 79 deletions(-) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 0a17bedf4f0d..7c07b3bca9fc 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -23,6 +23,7 @@ config MIPS select CPU_NO_EFFICIENT_FFS if (TARGET_ISA_REV < 1) select CPU_PM if CPU_IDLE select GENERIC_ATOMIC64 if !64BIT + select GENERIC_CMDLINE select GENERIC_CMOS_UPDATE select GENERIC_CPU_AUTOPROBE select GENERIC_GETTIMEOFDAY @@ -3171,9 +3172,6 @@ choice config MIPS_CMDLINE_FROM_BOOTLOADER bool "Bootloader kernel arguments if available" - config MIPS_CMDLINE_BUILTIN_EXTEND - depends on CMDLINE_BOOL - bool "Extend builtin kernel arguments with bootloader arguments" endchoice endmenu diff --git a/arch/mips/Kconfig.debug b/arch/mips/Kconfig.debug index 7a8d94cdd493..b5a099c74eb6 100644 --- a/arch/mips/Kconfig.debug +++ b/arch/mips/Kconfig.debug @@ -30,50 +30,6 @@ config EARLY_PRINTK_8250 config USE_GENERIC_EARLY_PRINTK_8250 bool -config CMDLINE_BOOL - bool "Built-in kernel command line" - 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 - help - On some platforms, there is currently no way for the boot loader to - 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 firmware arguments" - 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 SB1XXX_CORELIS bool "Corelis Debugger" depends on SIBYTE_SB1xxx_SOC diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index 7e1f8e277437..8ce763e03792 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -67,12 +68,6 @@ EXPORT_SYMBOL(mips_machtype); static char __initdata command_line[COMMAND_LINE_SIZE]; char __initdata arcs_cmdline[COMMAND_LINE_SIZE]; -#ifdef CONFIG_CMDLINE_BOOL -static const char builtin_cmdline[] __initconst = CONFIG_CMDLINE; -#else -static const char builtin_cmdline[] __initconst = ""; -#endif - /* * mips_io_port_base is the begin of the address space to which x86 style * I/O ports are mapped. @@ -546,27 +541,7 @@ static void __init bootcmdline_init(void) { bool dt_bootargs = false; - /* - * If CMDLINE_OVERRIDE is enabled then initializing the command line is - * trivial - we simply use the built-in command line unconditionally & - * unmodified. - */ - if (IS_ENABLED(CONFIG_CMDLINE_OVERRIDE)) { - strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE); - return; - } - - /* - * If the user specified a built-in command line & - * MIPS_CMDLINE_BUILTIN_EXTEND, then the built-in command line is - * prepended to arguments from the bootloader or DT so we'll copy them - * to the start of boot_command_line here. Otherwise, empty - * boot_command_line to undo anything early_init_dt_scan_chosen() did. - */ - if (IS_ENABLED(CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND)) - strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE); - else - boot_command_line[0] = 0; + boot_command_line[0] = 0; #ifdef CONFIG_OF_EARLY_FLATTREE /* @@ -589,12 +564,9 @@ static void __init bootcmdline_init(void) bootcmdline_append(arcs_cmdline, COMMAND_LINE_SIZE); /* - * If the user specified a built-in command line & we didn't already - * prepend it, we append it to boot_command_line here. + * Use the generic system for builtin prepend and append. */ - if (IS_ENABLED(CONFIG_CMDLINE_BOOL) && - !IS_ENABLED(CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND)) - bootcmdline_append(builtin_cmdline, COMMAND_LINE_SIZE); + cmdline_add_builtin(boot_command_line, NULL, COMMAND_LINE_SIZE); } /* -- 2.25.1