Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1375385pxf; Fri, 26 Mar 2021 06:49:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJmcbNcu3V3gj91MspREsyUFD6na3Hb/PvwRDt7EdKho5hPq6V3DUNBz0/g2cJ149wklkN X-Received: by 2002:a17:906:af91:: with SMTP id mj17mr15080024ejb.230.1616766592123; Fri, 26 Mar 2021 06:49:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616766592; cv=none; d=google.com; s=arc-20160816; b=cSBRBrRKTiwDIfFpOWui74w2+ka/omMuozPoewfJOMi4tp7C2AwRdU0It8tcqF1fVk piMR+4IHskuEnZ+tkOI2j4uYbFs5J7zdumn+5Lzmceac6744Odp8y/QpfwJvUnPdMzB1 m6VwVH0iFncjgxaWalcmr5v/f1w/M8/jkJ/+fvfFF23EY/gfFpgUWHK2BJmexmIx1/vR G+N30fC6GbV5axobA2KvApzUvQKfAAHueHczA88QsYJjb2a4SuQ6X/E6z0dfG+GHjHoq 734wX/6+uoqRJ01PdXdElGAK4t2anXAspkn2AseNqxute0noos/CekQhc7xy7tkpmWrD d98w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:cc:to:subject:from:references:in-reply-to :message-id; bh=TkGO7ykQY90iHuwXwyJ+f9EbPXfZ+uPiLVOcyJA8xTw=; b=PG9pSTjzPRm3naQ33CULNXbJ3vTpbft6qMyPvfoEKOkbCied31B4lzCPWd1u9CdFfv lWIpXpHLgms585xgeric+MX8O2iVyg9wrbKtUWqAybDhmcb7de8hNpE9ptGwTdEcdXx/ rN3GMcy53wcbsoLU7+siVOZRc2wMp3xM6Kf+0f7Yu/RjZD3+t53Z8H0AKf3PtYw2XpX6 fxz4ivROQfIW5W4AosPnRJIOaKsYOAdkTML5akuZpU4hPe46OgIilPdzufugjsFvO1fm CUQOGBb45Q9JLvL6mrU4ADWUHO3EPynn7guW8QORnnlRt/tUDsmQribWOJXSk0nNGQXV 7F7Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g16si7423609ejf.292.2021.03.26.06.49.29; Fri, 26 Mar 2021 06:49:52 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230080AbhCZNrd (ORCPT + 99 others); Fri, 26 Mar 2021 09:47:33 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:58830 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230218AbhCZNp1 (ORCPT ); Fri, 26 Mar 2021 09:45:27 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4F6NWW4kcBz9v03H; Fri, 26 Mar 2021 14:44:55 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id X6tAOk3XRuAU; Fri, 26 Mar 2021 14:44:55 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4F6NWW3rR4z9v03B; Fri, 26 Mar 2021 14:44:55 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 665048B8C9; Fri, 26 Mar 2021 14:44:56 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id pdElShztt2nj; Fri, 26 Mar 2021 14:44:56 +0100 (CET) Received: from po16121vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 0CE3F8B8C7; Fri, 26 Mar 2021 14:44:56 +0100 (CET) Received: by po16121vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 8E34E67611; Fri, 26 Mar 2021 13:44:56 +0000 (UTC) Message-Id: <85b1dc6339351cbc46d179e8fdb9dfc398e58303.1616765870.git.christophe.leroy@csgroup.eu> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v3 09/17] nios2: Convert to GENERIC_CMDLINE To: will@kernel.org, danielwa@cisco.com, robh@kernel.org, daniel@gimpelevich.san-francisco.ca.us Cc: linux-arch@vger.kernel.org, devicetree@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, microblaze , linux-mips@vger.kernel.org, nios2 , openrisc@lists.librecores.org, linux-hexagon@vger.kernel.org, linux-riscv@lists.infradead.org, x86@kernel.org, linux-xtensa@linux-xtensa.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org Date: Fri, 26 Mar 2021 13:44:56 +0000 (UTC) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This converts the architecture to GENERIC_CMDLINE. Signed-off-by: Christophe Leroy --- arch/nios2/Kconfig | 24 +----------------------- arch/nios2/kernel/setup.c | 13 ++++--------- 2 files changed, 5 insertions(+), 32 deletions(-) diff --git a/arch/nios2/Kconfig b/arch/nios2/Kconfig index c24955c81c92..f66c97b15813 100644 --- a/arch/nios2/Kconfig +++ b/arch/nios2/Kconfig @@ -90,31 +90,9 @@ config NIOS2_ALIGNMENT_TRAP comment "Boot options" -config CMDLINE_BOOL - bool "Default bootloader kernel arguments" - default y - -config CMDLINE - string "Default kernel command string" - default "" - 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, 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. - -config CMDLINE_FORCE - bool "Force default kernel command string" - depends on CMDLINE_BOOL - help - Set this to have arguments from the default kernel command string - override those passed by the boot loader. - config NIOS2_CMDLINE_IGNORE_DTB bool "Ignore kernel command string from DTB" - depends on CMDLINE_BOOL + depends on CMDLINE != "" depends on !CMDLINE_FORCE default y help diff --git a/arch/nios2/kernel/setup.c b/arch/nios2/kernel/setup.c index d2f21957e99c..42464f457a6d 100644 --- a/arch/nios2/kernel/setup.c +++ b/arch/nios2/kernel/setup.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -108,7 +109,7 @@ asmlinkage void __init nios2_boot_init(unsigned r4, unsigned r5, unsigned r6, unsigned r7) { unsigned dtb_passed = 0; - char cmdline_passed[COMMAND_LINE_SIZE] __maybe_unused = { 0, }; + char cmdline_passed[COMMAND_LINE_SIZE] = { 0, }; #if defined(CONFIG_NIOS2_PASS_CMDLINE) if (r4 == 0x534f494e) { /* r4 is magic NIOS */ @@ -127,14 +128,8 @@ asmlinkage void __init nios2_boot_init(unsigned r4, unsigned r5, unsigned r6, early_init_devtree((void *)dtb_passed); -#ifndef CONFIG_CMDLINE_FORCE - if (cmdline_passed[0]) - strlcpy(boot_command_line, cmdline_passed, COMMAND_LINE_SIZE); -#ifdef CONFIG_NIOS2_CMDLINE_IGNORE_DTB - else - strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE); -#endif -#endif + if (cmdline_passed[0] || IS_ENABLED(CONFIG_NIOS2_CMDLINE_IGNORE_DTB)) + cmdline_build(boot_command_line, cmdline_passed, COMMAND_LINE_SIZE); parse_early_param(); } -- 2.25.0