From patchwork Fri Mar 26 13:44:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 12166697 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=-9.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 DDB4CC433C1 for ; Fri, 26 Mar 2021 13:46:00 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 6CB9E6193C for ; Fri, 26 Mar 2021 13:46:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6CB9E6193C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Date:Cc:To:Subject:From:Message-Id: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=3zmTL2k0rp82TpcQJ4ZwQttwM+MjuoM1N2an+E3JSg0=; b=NbYvoEbIDiFVmDDjkKnlO+WosM AnCjoGNumHkE2+l0iPCvrvTV837ubaN/9GWtSRRdUIwYjgZLc551KTj+sqVPrBT+3qlwVcsovl6f7 4/bdXdEOUnZc5Mpo5fNESIS0AShtp5kcEMIebLrgQdlg7yQdPO0F9pk7gHgyda4N5bI7T4A1EkVQ8 iSX0N4JD8B0+0G8ZpJKyW0Nyqcs6aSsL1QqreMRHhClTqBVh4NuZgGK0McM5yhhQtT3n31N633QaO 4mW/OpmEuiBlUNdVljotYsnTPiTIBQUQ4iflA4YhnxpE1g8dVw8jSAnjphuHgzJzGxkrY2OUxDF+j neqkWOgQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lPmmZ-003dOx-An; Fri, 26 Mar 2021 13:45:47 +0000 Received: from pegase1.c-s.fr ([93.17.236.30]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lPmlg-003d5C-FR; Fri, 26 Mar 2021 13:44:55 +0000 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4F6NWL3t9Tz9tyyW; Fri, 26 Mar 2021 14:44:46 +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 kIulHNAnYVH6; Fri, 26 Mar 2021 14:44:46 +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 4F6NWL2lGwz9tyyV; Fri, 26 Mar 2021 14:44:46 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 33E0E8B8C9; Fri, 26 Mar 2021 14:44:47 +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 5JtG0C39F4IQ; Fri, 26 Mar 2021 14:44:47 +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 C055F8B8C7; Fri, 26 Mar 2021 14:44:46 +0100 (CET) Received: by po16121vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 31C9867611; Fri, 26 Mar 2021 13:44:47 +0000 (UTC) Message-Id: From: Christophe Leroy Subject: [PATCH v3 00/17] Implement 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:47 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210326_134452_718052_36761FD6 X-CRM114-Status: UNSURE ( 9.62 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org The purpose of this series is to improve and enhance the handling of kernel boot arguments. It is first focussed on powerpc but also extends the capability for other arches. This is based on suggestion from Daniel Walker Main changes in V3: - Also accept destination equal to source in cmdline_build() by setting a tmp buffer in __initdata. Powerpc provides different source and destination and call __cmdline_build() directly. - Taken comments received from Will and Rob - Converted all architectures (Only tested on powerpc) Christophe Leroy (17): cmdline: Add generic function to build command line. drivers: of: use cmdline building function cmdline: Gives architectures opportunity to use generically defined boot cmdline manipulation powerpc: Convert to GENERIC_CMDLINE arm: Convert to GENERIC_CMDLINE arm64: Convert to GENERIC_CMDLINE hexagon: Convert to GENERIC_CMDLINE microblaze: Convert to GENERIC_CMDLINE nios2: Convert to GENERIC_CMDLINE openrisc: Convert to GENERIC_CMDLINE riscv: Convert to GENERIC_CMDLINE sh: Convert to GENERIC_CMDLINE sparc: Convert to GENERIC_CMDLINE xtensa: Convert to GENERIC_CMDLINE x86: Convert to GENERIC_CMDLINE mips: Convert to GENERIC_CMDLINE cmdline: Remove CONFIG_CMDLINE_EXTEND arch/arm/Kconfig | 38 +------------- arch/arm/kernel/atags_parse.c | 15 ++---- arch/arm64/Kconfig | 33 +----------- arch/arm64/kernel/idreg-override.c | 9 ++-- arch/hexagon/Kconfig | 11 +--- arch/hexagon/kernel/setup.c | 10 +--- arch/microblaze/Kconfig | 24 +-------- arch/microblaze/configs/mmu_defconfig | 2 +- arch/microblaze/kernel/head.S | 4 +- arch/mips/Kconfig | 1 + arch/mips/Kconfig.debug | 44 ---------------- arch/mips/configs/ar7_defconfig | 1 - arch/mips/configs/bcm47xx_defconfig | 1 - arch/mips/configs/bcm63xx_defconfig | 1 - arch/mips/configs/bmips_be_defconfig | 1 - arch/mips/configs/bmips_stb_defconfig | 1 - arch/mips/configs/capcella_defconfig | 1 - arch/mips/configs/ci20_defconfig | 1 - arch/mips/configs/cu1000-neo_defconfig | 1 - arch/mips/configs/cu1830-neo_defconfig | 1 - arch/mips/configs/e55_defconfig | 1 - arch/mips/configs/generic_defconfig | 1 - arch/mips/configs/gpr_defconfig | 1 - arch/mips/configs/loongson3_defconfig | 1 - arch/mips/configs/mpc30x_defconfig | 1 - arch/mips/configs/rt305x_defconfig | 1 - arch/mips/configs/tb0219_defconfig | 1 - arch/mips/configs/tb0226_defconfig | 1 - arch/mips/configs/tb0287_defconfig | 1 - arch/mips/configs/workpad_defconfig | 1 - arch/mips/configs/xway_defconfig | 1 - arch/mips/kernel/relocate.c | 4 +- arch/mips/kernel/setup.c | 40 +-------------- arch/mips/pic32/pic32mzda/early_console.c | 2 +- arch/mips/pic32/pic32mzda/init.c | 2 - arch/nios2/Kconfig | 24 +-------- arch/nios2/kernel/setup.c | 13 ++--- arch/openrisc/Kconfig | 10 +--- arch/powerpc/Kconfig | 37 +------------ arch/powerpc/kernel/prom_init.c | 17 +++--- arch/riscv/Kconfig | 44 +--------------- arch/riscv/kernel/setup.c | 5 +- arch/sh/Kconfig | 30 +---------- arch/sh/configs/ap325rxa_defconfig | 2 +- arch/sh/configs/dreamcast_defconfig | 2 +- arch/sh/configs/ecovec24-romimage_defconfig | 2 +- arch/sh/configs/ecovec24_defconfig | 2 +- arch/sh/configs/edosk7760_defconfig | 2 +- arch/sh/configs/espt_defconfig | 2 +- arch/sh/configs/j2_defconfig | 2 +- arch/sh/configs/kfr2r09-romimage_defconfig | 2 +- arch/sh/configs/kfr2r09_defconfig | 2 +- arch/sh/configs/lboxre2_defconfig | 2 +- arch/sh/configs/microdev_defconfig | 2 +- arch/sh/configs/migor_defconfig | 2 +- arch/sh/configs/polaris_defconfig | 2 +- arch/sh/configs/r7780mp_defconfig | 2 +- arch/sh/configs/r7785rp_defconfig | 2 +- arch/sh/configs/rsk7201_defconfig | 2 +- arch/sh/configs/rsk7203_defconfig | 2 +- arch/sh/configs/rts7751r2d1_defconfig | 2 +- arch/sh/configs/rts7751r2dplus_defconfig | 2 +- arch/sh/configs/sdk7780_defconfig | 2 +- arch/sh/configs/sdk7786_defconfig | 2 +- arch/sh/configs/se7206_defconfig | 2 +- arch/sh/configs/se7343_defconfig | 2 +- arch/sh/configs/se7712_defconfig | 2 +- arch/sh/configs/se7721_defconfig | 2 +- arch/sh/configs/se7724_defconfig | 2 +- arch/sh/configs/se7751_defconfig | 2 +- arch/sh/configs/se7780_defconfig | 2 +- arch/sh/configs/sh03_defconfig | 2 +- arch/sh/configs/sh2007_defconfig | 2 +- arch/sh/configs/sh7757lcr_defconfig | 2 +- arch/sh/configs/sh7763rdp_defconfig | 2 +- arch/sh/configs/shmin_defconfig | 2 +- arch/sh/configs/shx3_defconfig | 2 +- arch/sh/configs/titan_defconfig | 2 +- arch/sh/configs/ul2_defconfig | 2 +- arch/sh/kernel/setup.c | 11 +--- arch/sparc/Kconfig | 18 +------ arch/sparc/prom/bootstr_64.c | 2 +- arch/x86/Kconfig | 45 +--------------- arch/x86/kernel/setup.c | 17 +----- arch/xtensa/Kconfig | 15 +----- arch/xtensa/configs/audio_kc705_defconfig | 1 - arch/xtensa/configs/common_defconfig | 1 - arch/xtensa/configs/generic_kc705_defconfig | 1 - arch/xtensa/configs/iss_defconfig | 1 - arch/xtensa/configs/nommu_kc705_defconfig | 1 - arch/xtensa/configs/smp_lx200_defconfig | 1 - arch/xtensa/configs/virt_defconfig | 1 - arch/xtensa/configs/xip_kc705_defconfig | 1 - arch/xtensa/kernel/setup.c | 10 +--- drivers/firmware/efi/libstub/x86-stub.c | 26 +++++----- drivers/of/fdt.c | 23 ++------- include/linux/cmdline.h | 57 +++++++++++++++++++++ init/Kconfig | 46 +++++++++++++++++ 98 files changed, 209 insertions(+), 580 deletions(-) create mode 100644 include/linux/cmdline.h