From patchwork Mon Nov 19 21:04:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 10689451 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 0D91713B5 for ; Mon, 19 Nov 2018 21:06:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0B7A2A4C7 for ; Mon, 19 Nov 2018 21:06:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E0C782A60B; Mon, 19 Nov 2018 21:06:20 +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 551912A4C7 for ; Mon, 19 Nov 2018 21:06:20 +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=xorGm/ggFY0d6/rDuq/GrX37CCBhL1FUbPvNxAxiEmg=; b=i2PAkcn/SuA9W8 /2r3M8YSvc4Cgr6G1CH124jynpmmERs0fqO4UCs4FxyX7fc9DmXg108P6pajM+tDgSHi//Zq5H4oH ikIOc+mxBU+4VlwCrHhiabsqp3Wk3zU3LbU+x8fMYgtYnqqBAXZiMP3emnxfwsj+9MNU5tLD5OQFj kHOm1WdmWpjEUgJzYTppVIM4J2sqOzNks8wviaSXPKS8V1ZLi0mjYY5qVrnqIhxuWRk2LNJ5v5I6R FyahK3XjAGaGFxDY9+BxtF00B7dC/d2Eu+k8RK77+VhMfnO+KTBw7sO6j6xzVpr+Swlu7fhJbjNZ4 16HnkoZadhvjLOe/jBdg==; 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 1gOqkC-0002fm-2T; Mon, 19 Nov 2018 21:06:08 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOqk4-0002Tc-My for linux-riscv@lists.infradead.org; Mon, 19 Nov 2018 21:06:02 +0000 Received: by mail-pf1-x443.google.com with SMTP id b7so2206001pfi.8 for ; Mon, 19 Nov 2018 13:05:50 -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=L5wwL34PyGgziVwXHLMgtJ9ExyAFaIYBQz/zqSoClbQ=; b=jeoV0Q6aujVbRyVxYh91E1XGfPzssLWAE04uK27j2LhMqlapvBwwl5/ms6ZayZbCNx 4u2PVHRFT8Ji8cVG8X5Tkxl7c7tExmujZPwJmXagLLfgXNITwkKTILjcNgdVTdNwqycQ hv/51B+IdUJAyr/c9iZNfbNnJ7fi9mtUKqsmD2AQAHvpvhJhV1D8460747SNoAnxrsbK q1WfH3oSlippF0nurpxogRAgxj2PofR82a9fRFbZSyF2Um4ydKlZreKJ4nu/IpIZYW9B hs2Z4iyA1DpSjJTABuIcmc/S+yoMhxYbrSBQs8cDyW2oJ8vCuGSAQD8K9ttQFywq4W53 WTIA== 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=L5wwL34PyGgziVwXHLMgtJ9ExyAFaIYBQz/zqSoClbQ=; b=NkDP7vKVdQq4Fir/7nKdTZtgUqhfQc6LWWQCQKhoDDY1Jdof+HetaC8I1aYqzqEDF5 pnkC0gOnYfpNHrs7PIVjboNe0HJesMSbKOyo7w34J28TX/AKJf9oA0HbttCzBJNctxcM HJfCvNhzzr08GWx4xJl/k6FuiOZHjX/fjJ8dIVDbtzv/JtLyn06z6Y8hQ8ZRbIk6NKz4 +aJiCTZbqf+M3QEBXXPhL5ECWuSUTSL0sgzc/1OW9351o7Xp6l1CyjcefBvUpBjk3RrN h9XMU+t9EG8p6TEBwzTWbYLoo2y74Jhf6Zf9/bk9R52WJty8gm2WyUPHF2sw73iUAtb9 oOxA== X-Gm-Message-State: AGRZ1gJouHS/faR2uJjmm0IEY8g1cnqXqpcS1INI6377yiLl7pN5wGIb dRfosvWZLYV6t8FuByzKq5l5U98gZvc= X-Google-Smtp-Source: AJdET5fzJq/y0S3WszGVKXyL4yNS0yWlsTo7Euf/zsSyvPg7iBuv5Y26kb2725qQsiTLhd2Yrr8lGQ== X-Received: by 2002:a63:5a57:: with SMTP id k23mr21339648pgm.5.1542661549676; Mon, 19 Nov 2018 13:05:49 -0800 (PST) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id 123sm43698387pgd.75.2018.11.19.13.05.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Nov 2018 13:05:48 -0800 (PST) Subject: [PATCH v4] RISC-V: Update Kconfig to better handle CMDLINE Date: Mon, 19 Nov 2018 13:04:02 -0800 Message-Id: <20181119210402.8176-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_130600_844835_A3DE8BD8 X-CRM114-Status: GOOD ( 16.99 ) 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. 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..808624f6b906 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 "Fallback" 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 "Extension" + 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 "Forced" 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