From patchwork Wed Jan 10 10:35:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 761437 Delivered-To: patch@linaro.org Received: by 2002:a5d:6e02:0:b0:337:62d3:c6d5 with SMTP id h2csp1807742wrz; Wed, 10 Jan 2024 02:37:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IHeI4udPeoC4p4YKtz4ZKUsUwEJwGVvjsSyWDCma8dNP3OfPoCLAiqXt+jRnt/LELioZ0N9 X-Received: by 2002:a05:6000:1364:b0:337:507a:5c59 with SMTP id q4-20020a056000136400b00337507a5c59mr579876wrz.12.1704883033061; Wed, 10 Jan 2024 02:37:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704883033; cv=none; d=google.com; s=arc-20160816; b=P4ShQzrCBBfmB8toUh25U7LLwwgt1PI03S03puc17rS7oq2rI56HQVw4IV3Vbr1YIH allLwr+IGV4VOcFJFheAEVYQGMoKIVx7QQk7AIQ8PYXaXQF7UCknA0ItLUqodDTOjGkL 0Nb0HEzHU5eBKzk6E/4qYbDLF2Htq2DfzLSRyhpaRgOZ3OKQ7racuKFMUEWulzVodQ4W Oc75FRdnXyb6JgNDoz9vAPF5VtioyMLOyt7q6Oy7WnsDQOcyYgdB3yDYrvKXxIpRRtZJ DaIvEhxI6otY1rt6NT4B8L42Cniq2EupsqHy+O3AEX+I0wGEf+bFt+GLnb/i9j0fUCR1 MIvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=FsiA+O12iJkpNew60z2Ss9cRy01PCvnIz5NjHTdND8w=; fh=g5mGBYdwcRCvgzx1fsOtMayuItbAc+o2ocuRoBH1vWU=; b=qpvVbyud6hnwQDIrXdj2SksD4/CJ/bS5cKsljAPlhUrG8Ad4yXL3te20xsQ3n1ZDsp K98DEHRcDS5abO+hgiL95HzrK6WMs91eyRzVjF/eUOWB3NLYmJa487qsnXXssFJRhVlm cPsssJmx20VD5mULelsQI+PjrliF9CBYeK1D2eJ0lvq9S7xK1Hv0s0kv4sMwJ4HTiYXr 8M5QHkYlVLAVmHYpH24OQTc7DMsoNryoTD9kGFK5jH7ltkMNdUA7rl7PjHZ9Tne1bqk1 mO23Ia02XGFjdx7blPdG8G/vN1g1hsL/R48VLAk7odBnBKmROqPBdj7Gm7xkBZryQUAH 3UNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DkOXh4Mp; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id s20-20020adf9794000000b00337073a5934si2078169wrb.749.2024.01.10.02.37.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 02:37:13 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DkOXh4Mp; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 933A187AE2; Wed, 10 Jan 2024 11:36:54 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="DkOXh4Mp"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D3A178790F; Wed, 10 Jan 2024 11:36:53 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: * X-Spam-Status: No, score=1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_SBL_CSS,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B1D8687AB7 for ; Wed, 10 Jan 2024 11:36:50 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sumit.garg@linaro.org Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1d3ef33e68dso27755055ad.1 for ; Wed, 10 Jan 2024 02:36:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704883009; x=1705487809; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FsiA+O12iJkpNew60z2Ss9cRy01PCvnIz5NjHTdND8w=; b=DkOXh4MpXsq1rKgvT+wE6yUsHo0qtxYA13NDtf4m2VrCXkhXKiu2xN/JkdcVASIFLH mru3binrvovEBZwrrFPWvqpYAckonFOs7D7cP8sYKVR/yknU2Gjgd67TQWXFqR6AoFg4 iCaBFVMssRGiuIHuEQsVt1lR60wRFo7qGqT68KylykrGvifYEtZ6BM41V31TMKyPYUwt 0TqXEWZcNt1+Blp4KjDcTDzWikMGjsM0RbtiUk135ZDko5zbZcdTJir9syzmydNed2BZ SfNqGLJl+qwFDk9stAnYzIvzaBTInRyMdlUYwHspha7H31ngFlNPBqvzISCR5VRO8QaJ eiSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704883009; x=1705487809; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FsiA+O12iJkpNew60z2Ss9cRy01PCvnIz5NjHTdND8w=; b=lU/uf7p0X1TPmcsy7vYpCDixPrF0eOv1ZMjQUvfSgix24fRFTGKoPQr/ZpENSET2rB wNzXJ/9EgA5MTq6mlAsHWszq0U05l0q8pE/CcNeBL1a1f2Ad///OIUzeHe0V/28tc0jx wUbvNTmpR5GqcBkII2ijlw/IDYwnV+s6+pYCjNy6LAc9RQ5cHPBo7XjNdFDrYhzPaMa5 k+atk60qqacH7li7/+l1M7EnwBbofuv67EecrWiOf8vVvHQkN6dSwnXYp3mPLWFZTxAx SfSHS4FXNdYZ22M7tyrjkXChTXePqVzFoVmV8qbI+8jSJmy8zVl0BP+wfjml/6IhzYtN 7vbg== X-Gm-Message-State: AOJu0YxrnoyoOGLkDtCKdCtlwS4YRwH2FwixmnxR+BZ15VV8ClrPNZ8I CRvkNxi1LuK+C6kpB6wJ5kUosbAw3MOJr1m3F9hlCe339LU= X-Received: by 2002:a17:902:ca11:b0:1d5:6b6c:1ace with SMTP id w17-20020a170902ca1100b001d56b6c1acemr1096120pld.18.1704883008643; Wed, 10 Jan 2024 02:36:48 -0800 (PST) Received: from sumit-X1.. ([223.178.208.66]) by smtp.gmail.com with ESMTPSA id i7-20020a17090332c700b001d38a7e6a30sm3332604plr.70.2024.01.10.02.36.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 02:36:48 -0800 (PST) From: Sumit Garg To: u-boot@lists.denx.de, u-boot-amlogic@groups.io, u-boot-custodians@lists.denx.de Cc: trini@konsulko.com, sjg@chromium.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor@kernel.org, neil.armstrong@linaro.org, caleb.connolly@linaro.org, ff@shokubai.tech, daniel.thompson@linaro.org, dgilmore@fedoraproject.org, pbrobinson@gmail.com, ilias.apalodimas@linaro.org, maxim.uvarov@linaro.org, b.galvani@gmail.com, xypron.glpk@gmx.de, michal.simek@amd.com, seanga2@gmail.com, rasmus.villemoes@prevas.dk, peng.fan@nxp.com, jh80.chung@samsung.com, rfried.dev@gmail.com, marex@denx.de, mibodhi@gmail.com, bb@ti.com, mark.kettenis@xs4all.nl, Sumit Garg Subject: [PATCH v4 05/11] dts: Add alternative location for upstream DTB builds Date: Wed, 10 Jan 2024 16:05:41 +0530 Message-Id: <20240110103547.719757-6-sumit.garg@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240110103547.719757-1-sumit.garg@linaro.org> References: <20240110103547.719757-1-sumit.garg@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Allow platform owners to mirror devicetree files from devitree-rebasing directory into dts/upstream/src/$(ARCH) (special case for arm64). Then build then along with any *-u-boot.dtsi file present in arch/$(ARCH)/dts directory. Also add a new Makefile for arm64. This will help easy migration for platforms which currently are compliant with upstream Linux kernel devicetree files. Signed-off-by: Sumit Garg --- Changes in v4: - Switched subtree to be imported as dts/upstream sub-directory rather than devicetree-rebasing sub-directory to better suite U-Boot directory structure. - Added a note to OF_UPSTREAM Kconfig option. Changes in v3: - Minor commit message update Changes in v2: - s/DEVICE_TREE_LOC/dt_dir/ and s/U-boot/U-Boot/ dts/Kconfig | 16 ++++++++++++++++ dts/Makefile | 17 ++++++++++++++--- dts/upstream/src/arm64/Makefile | 14 ++++++++++++++ 3 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 dts/upstream/src/arm64/Makefile diff --git a/dts/Kconfig b/dts/Kconfig index 00c0aeff893..09789d3e18b 100644 --- a/dts/Kconfig +++ b/dts/Kconfig @@ -85,6 +85,22 @@ config OF_LIVE enables a live tree which is available after relocation, and can be adjusted as needed. +config OF_UPSTREAM + bool "Enable use of devicetree imported from Linux kernel release" + help + Traditionally, U-Boot platforms used to have their custom devicetree + files or copy devicetree files from Linux kernel which are hard to + maintain and can usually get out-of-sync from Linux kernel. This + option enables platforms to migrate to devicetree-rebasing repo where + a regular sync will be maintained every major Linux kernel release + cycle. However, platforms can still have some custom u-boot specific + bits maintained as part of *-u-boot.dtsi files. + + Note: This option should be set in Kconfig, for the SoC as a whole. + However, newer boards whose devicetree source files haven't landed in + the dts/upstream subtree, they can override this option to have the + DT build from existing U-Boot tree location instead. + choice prompt "Provider of DTB for DT control" depends on OF_CONTROL diff --git a/dts/Makefile b/dts/Makefile index 3437e54033d..d6c2c9daf31 100644 --- a/dts/Makefile +++ b/dts/Makefile @@ -10,10 +10,20 @@ ifeq ($(DEVICE_TREE),) DEVICE_TREE := unset endif +ifeq ($(CONFIG_OF_UPSTREAM),y) +ifeq ($(CONFIG_ARM64),y) +dt_dir := dts/upstream/src/arm64 +else +dt_dir := dts/upstream/src/$(ARCH) +endif +else +dt_dir := arch/$(ARCH)/dts +endif + ifneq ($(EXT_DTB),) DTB := $(EXT_DTB) else -DTB := arch/$(ARCH)/dts/$(DEVICE_TREE).dtb +DTB := $(dt_dir)/$(DEVICE_TREE).dtb endif $(obj)/dt-$(SPL_NAME).dtb: dts/dt.dtb $(objtree)/tools/fdtgrep FORCE @@ -41,7 +51,7 @@ $(DTB): arch-dtbs PHONY += arch-dtbs arch-dtbs: - $(Q)$(MAKE) $(build)=arch/$(ARCH)/dts dtbs + $(Q)$(MAKE) $(build)=$(dt_dir) dtbs ifeq ($(CONFIG_SPL_BUILD),y) obj-$(CONFIG_OF_EMBED) := dt-spl.dtb.o @@ -65,4 +75,5 @@ clean-files := dt.dtb.S # Let clean descend into dts directories subdir- += ../arch/arc/dts ../arch/arm/dts ../arch/m68k/dts ../arch/microblaze/dts \ ../arch/mips/dts ../arch/nios2/dts ../arch/powerpc/dts ../arch/riscv/dts \ - ../arch/sandbox/dts ../arch/sh/dts ../arch/x86/dts ../arch/xtensa/dts + ../arch/sandbox/dts ../arch/sh/dts ../arch/x86/dts ../arch/xtensa/dts \ + ./upstream/src/arm64 ./upstream/src/$(ARCH) diff --git a/dts/upstream/src/arm64/Makefile b/dts/upstream/src/arm64/Makefile new file mode 100644 index 00000000000..9a8f6aa3584 --- /dev/null +++ b/dts/upstream/src/arm64/Makefile @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: GPL-2.0+ + +include $(srctree)/scripts/Makefile.dts + +targets += $(dtb-y) + +# Add any required device tree compiler flags here +DTC_FLAGS += -a 0x8 + +PHONY += dtbs +dtbs: $(addprefix $(obj)/, $(dtb-y)) + @: + +clean-files := */*.dtb */*.dtbo