From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E63CC4346E for ; Tue, 29 Sep 2020 10:42:46 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C05E2207C4 for ; Tue, 29 Sep 2020 10:42:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="GSr25Epu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C05E2207C4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=/sog+LdxgSleWfoEQ/WtFuCAmRGYDoGPqyeZhRA6gG4=; b=GSr25EpuNXNHK+5RGmD8NGtyd ZskgZXTJy5SfEj4HAbW6x70LhNtKhJg5Ao/4fHrqbgRmGHGeK73L87W5WAeYS3zBuzZTBL2BtJMVG nOPVhIryQXjXXSEjcF5RJHL22GmqPwhOGcb+wbF24LIXcOpsICfQZvC3ITH63xd8fnAMjJ07TUrSZ s5/1vQutFUqX1QT2JvimJz6ghYEtzCAAhUiW1tudSxlLL3w7+VshVlrf8KNkGtdmJPXjeymgyooWj Zet24GCC/+o+UoFDmwTerez9qtvuJMQCkkGj5tq07SRqV1j5qFbPVPHr52p5RDy5VsutN+1IdQD5n UBjj91mTQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kND4Z-0001iq-Hl; Tue, 29 Sep 2020 10:41:27 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kND4W-0001iO-GR for linux-arm-kernel@lists.infradead.org; Tue, 29 Sep 2020 10:41:25 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4350131B; Tue, 29 Sep 2020 03:41:23 -0700 (PDT) Received: from arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id ADEA73F6CF; Tue, 29 Sep 2020 03:41:22 -0700 (PDT) Date: Tue, 29 Sep 2020 11:41:20 +0100 From: Dave Martin To: Matija Glavinic Pecotic Subject: Re: [PATCH] arm64: Make CONFIG_CMDLINE behavior configurable Message-ID: <20200929104118.GK6642@arm.com> References: <55be67bb-338c-afa1-d863-7a82f9ba803f@nokia.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <55be67bb-338c-afa1-d863-7a82f9ba803f@nokia.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200929_064124_615511_EDA7C4B9 X-CRM114-Status: GOOD ( 24.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Sverdlin, Alexander \(Nokia - DE/Ulm\)" , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Sep 29, 2020 at 10:46:09AM +0200, Matija Glavinic Pecotic wrote: > arm64 has no means to define behavior if CONFIG_CMDLINE is set as e.g. > arm32 has. Parts of the kernel will ignore CMDLINE if behavior on how > to treat is not specified, e.g.: > > drivers/of/fdt.c:early_init_dt_scan_chosen: > #ifdef CONFIG_CMDLINE > #if defined(CONFIG_CMDLINE_EXTEND) > strlcat(data, " ", COMMAND_LINE_SIZE); > strlcat(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE); > #elif defined(CONFIG_CMDLINE_FORCE) > strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE); > #else > /* No arguments from boot loader, use kernel's cmdl*/ > if (!((char *)data)[0]) > strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE); > #endif > #endif /* CONFIG_CMDLINE */ > > Sync behavior of arm64 with arm32 (and other platforms). > > Signed-off-by: Matija Glavinic Pecotic > --- > arch/arm64/Kconfig | 20 +++++++++++++++++++- > 1 file changed, 19 insertions(+), 1 deletion(-) > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > index 6d232837cbee..0a03db76aa5a 100644 > --- a/arch/arm64/Kconfig > +++ b/arch/arm64/Kconfig > @@ -1824,14 +1824,32 @@ config CMDLINE > entering them here. As a minimum, you should specify the the > root device (e.g. 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" > - depends on CMDLINE != "" > 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 If multiple arches do the same thing, can we factor this out into a common Kconfig file somehow? Cheers ---Dave _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel