From patchwork Mon Nov 19 21:09:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 10689473 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B2EAD16B1 for ; Mon, 19 Nov 2018 21:10:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A4B892A653 for ; Mon, 19 Nov 2018 21:10:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9959D2A67A; Mon, 19 Nov 2018 21:10:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 130692A653 for ; Mon, 19 Nov 2018 21:10:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:To:From:Message-Id: Date:Subject:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=GMJwDSMPZjquQy8vq8YusaIvzr6sf9aFtfC5iSiDnA0=; b=TFTQ2BXmt0AmE2 rOO7OhuJZ8hfNYfyAC4iWjYv3/fn2BWYibwahH7QqjOIccqarA9OUYzD0i3/RwSrl0w0UrEXCVBB0 0Zy0rJRvX/I2ghw0lXS/f8G2c7VHqcDQRQGgfSX/9WwumIccJ9e8dASwGZGuEauAkMhcbh0WXNuPo 6DBEhGA4YqCvFWGoG4O/exBuHhtuvKzo0CdSC6xp6/drjAHFLjwep8L7SuxK0yF7dR/bor1pXHpVx DSdFsz44ZO/oJDr+0VQ2nuIVfAYQwSe4ZcWHgKED2p7mbwNMDt15XuMuXeeMXXZjDSoxb5vEDg9SS VtRTPWDezAlgvYy+aTew==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOqoL-0005RY-C7; Mon, 19 Nov 2018 21:10:25 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOqoJ-0005RC-42 for linux-riscv@lists.infradead.org; Mon, 19 Nov 2018 21:10:24 +0000 Received: by mail-pg1-x541.google.com with SMTP id y4so14365003pgc.12 for ; Mon, 19 Nov 2018 13:10:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=subject:date:message-id:cc:from:to; bh=wk6r2f4GWrgKqHlnQOzVKEkbQRO1v+ZVi/qyPedHjBA=; b=mCg3k6Ne0PZePc1J5GrJdT9V9e+3nr1h3Vjj/oezOR8Nxz30mcDkPjtmMoI2eY7yTn LZUXHiOkgDoaWLFKybIuFaoPX+yql8fP9Pa3xqBmy5DgqfCaWiKPxDaPDIjHyQuXFAaS bxYYrKqdiGa3Odghuk+WgwcjTntavAULNcHtPPPJ5fPV5mtM4oZdr0DNKTAhJVQU4RKT dT3kMjZN1rPlS8G37oMEs1BO6CSnBIMF1FZbvjUBk8OHrNH+hnlBMxD8FFW9x1SY/fx6 y/JbRsflggNlYSaLuc4Klch2YyDrSEhQt17iMnqAlNrV9uSBcwPCZSGrO9w6I2Mvnqgj ai2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:date:message-id:cc:from:to; bh=wk6r2f4GWrgKqHlnQOzVKEkbQRO1v+ZVi/qyPedHjBA=; b=nDJQ+m44A7Sy2UMvPs896eQ0d0VyN4bL0507lPt/32zHY6KppzMeUup+ZpxVUtyOPJ cufZFguToS7oPNnu1DvIn8jPSL98LI6XnUZdDyz6VTLv+14cM82LVoi5yRy/YTKikeIn qctLZIE3XdJ9QLQ4tk1xLVTbcCKEkzs+YuTLwghkgmvkL6PccBVzITni6JIUrwGS00Zb zD4eNYuBUxjlxWbJl7QrJxjFYig1F+/ovYnZOb03HCj6i5o9jCaqdddCWPEYukW85shF 0lzOMZrhT8/Hnwd62KoaPkEwTEnqPS6VfLdmJnHisRx9vGkoy5T/Ev55mIAfr3Tm0I1l XCvw== X-Gm-Message-State: AGRZ1gJvmZHll9CLkF0Pz5qVCO+UvuJpsUnrzd+w8cYxDoKLIvjskofZ E39ZrR6Khiw3j7HrLwE1R+DUjATL8zE= X-Google-Smtp-Source: AJdET5cV+PNV9mNtY4oWum/fwdWlclYtqvJLAra25hJLmRuN4pXw5btyO+9DzC/eo67GWH6GZ97pow== X-Received: by 2002:a63:2447:: with SMTP id k68-v6mr20920152pgk.156.1542661811641; Mon, 19 Nov 2018 13:10:11 -0800 (PST) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id a16-v6sm35224535pfh.107.2018.11.19.13.10.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Nov 2018 13:10:10 -0800 (PST) Subject: [PATCH v5] RISC-V: Update Kconfig to better handle CMDLINE Date: Mon, 19 Nov 2018 13:09:07 -0800 Message-Id: <20181119210907.12040-1-palmer@sifive.com> X-Mailer: git-send-email 2.18.1 From: Palmer Dabbelt To: mick@ics.forth.gr, dmaliotaki@gmail.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181119_131023_184639_C311725D X-CRM114-Status: GOOD ( 17.41 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-riscv@lists.infradead.org, Palmer Dabbelt MIME-Version: 1.0 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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. v5: Actually 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..23ac6d6f9ab2 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -227,39 +227,48 @@ endmenu menu "Boot options" -config CMDLINE_BOOL - bool "Built-in kernel command line" +config CMDLINE + string "Built-in kernel command line" help - 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 - in CONFIG_CMDLINE. + 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. +choice + prompt "Built-in command line usage" if CMDLINE != "" + default CMDLINE_FALLBACK + 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 "" +config CMDLINE_FALLBACK + bool "Use bootloader kernel arguments if available" help - 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. + +config CMDLINE_EXTEND + bool "Extend bootloader kernel arguments" + 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. + config CMDLINE_FORCE - bool "Built-in command line overrides bootloader arguments" - depends on CMDLINE_BOOL + bool "Always use the default kernel command string" help - 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. +endchoice endmenu