From patchwork Thu Dec 14 13:50:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 753925 Delivered-To: patch@linaro.org Received: by 2002:adf:ff85:0:b0:336:3f68:820c with SMTP id j5csp758179wrr; Thu, 14 Dec 2023 05:52:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IEC8YfN2LFLcTt9nUpklF77ar0v95kZDg1FUdyY+DHJhzHxyKgmtN8p0OOkLoo4U5YtLtYI X-Received: by 2002:a2e:be0c:0:b0:2cc:200f:4392 with SMTP id z12-20020a2ebe0c000000b002cc200f4392mr4098750ljq.46.1702561947218; Thu, 14 Dec 2023 05:52:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702561947; cv=none; d=google.com; s=arc-20160816; b=GwYBH68ZC6bA8e8IYVa/+OiwX1UoRiDJlZCJ3rsY7w++tvFtrfqH+TqlIiD4r3rlQc gtbqDSg5rWrHC2VpVnkJX1sbSME+jQrym+kVz9HEZcikYPlwG4c0TWRUYBPB5itGOL4s ldhOeDbhMGstslAtiFnhdSYfUgxTgzRyFUh5jDOjI4MoID2ezUoaiAZ6q0rf0nOBy1IN kBNo0iijafhg/aUMOrUzdqkiafBouku5FrBXQ/8qEZH8Y+M62kRY7D4t0qAdTsq5HIdH +lQodVG1XOqsigdjJQ94QPyuHNC25XzjZIv/rbPxUf4OXWf3LkkSBKPn6cgFNii0jZjW Oa0Q== 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=1TnzdH67t338vIUJxhhWpafn7v8Et2UIYp9pfQ6QVcw=; fh=VZWdizSVWfhngo19Gt5nLjhnxzdtHBYWvcywp4ujR58=; b=VAb+V4BS7kLSCLXW/SJm0r8V1TunuRz7Csh0d1sFEpkdBeZgE1HSoxjcA+lwt3tykY ZrkXwkMqocDZMr3MR1C9kEd+HcoadDwHwdFuDONw7ADsrXJ4XHhAO0mOAzgs31QLq/fl 3p5h+LKegFv+LiyS/RQGnFeVmcf7oZl34I70t8hwawzOxCOuQnK6YR4IkhAtD1Hj4cEe NLRbRW9ksjDRwyKYA7h/xch+HqG/KE2ecwcbsp6L1gjbtpipL1Mv0wEf5Wbsc9zbGWGw nv1bv4U9et/yE46bXTZ021fUF4t0YPrgZ3+xxOrbFoSAZUBwJHR8touY9iOuKyrHz0Zg sclw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ufeWsX2U; 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 l10-20020a2e99ca000000b002cc4500ff59si317696ljj.49.2023.12.14.05.52.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 05:52:27 -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=ufeWsX2U; 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 D887187A8A; Thu, 14 Dec 2023 14:52:13 +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="ufeWsX2U"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AD1FA87A8B; Thu, 14 Dec 2023 14:52:12 +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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) (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 8570187A8E for ; Thu, 14 Dec 2023 14:52:09 +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-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-2888c80994bso4726684a91.0 for ; Thu, 14 Dec 2023 05:52:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1702561927; x=1703166727; 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=1TnzdH67t338vIUJxhhWpafn7v8Et2UIYp9pfQ6QVcw=; b=ufeWsX2UkeLIMWzKiOB+uyTbR/Z4XMAOVJhOTkONE1XuQb0G1BIYkWsBRjq16semVI aKmuh2tNcVJ+IRdxnQjsLIz24Ng7V5iK2RyQeNVKkD6F0q2HXaKTpgu+QVJfVyklgxCf Jox2x70sHkIugk3JooGDiRP5AIRJ0kZjZSuDOucYicoiMwF4lJMxe97pYjc0/B1rIBdw ii+TKLzsEJnBHj8roWi8KR34kXG42Kl1OXs7D0Cz8gecKUYskUM86UR8Tmxj4Ij6H2s/ 0EXqGl1pPKk2gH1NawuE/wMNAbIPC7mJ2NSP9bdT79pQgr3Sg8p6Lst2cxUv3dpYX+jW 5TLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702561927; x=1703166727; 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=1TnzdH67t338vIUJxhhWpafn7v8Et2UIYp9pfQ6QVcw=; b=V5QG0jrk0mZ/Ee0iU1naQ6i/kUXd8V3zlgAYgq+xPKrc4pES4JXwfV4XOYbkCTwfmv j8W4HNiq7PPAOfLBwyYC25u5nAnWPeqJ9i/Aa3+U2VZ9Ws8b1XhXg0W3b6zVFqIoCOVh 1jVqD0uUzZsazh+2fE0xZw99SK7lKzP+f4ncs/gKi5S5wAHD13MVLSDHDG80SnfxWfMm Ur7zqiVunoKu0zUX7ZAC2YPdBMht3fAuomyhkafTVYiew295pTAUdq5Ii88/Q0yhqVEG t6W+Vo3eVjSgxAev4TnpbIvi3l4WGRqgnrvOD7kAVbI3OTl/+LBxahxpWBhM64dDJQzM PDUg== X-Gm-Message-State: AOJu0YySk6JQv3dreS06M2dmcrMGefdjeLpX5Tw624Li+bzcKUo35N+n DlSBsBzJp2biVCkk+s+A43uvIPjdvhFsuEyc8nIL4g== X-Received: by 2002:a17:902:bb16:b0:1d3:51d3:f8c7 with SMTP id im22-20020a170902bb1600b001d351d3f8c7mr1148141plb.3.1702561927575; Thu, 14 Dec 2023 05:52:07 -0800 (PST) Received: from sumit-X1.. ([223.178.213.6]) by smtp.gmail.com with ESMTPSA id j3-20020a170902c08300b001cfc68125desm12474956pld.203.2023.12.14.05.52.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 05:52:07 -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, Sumit Garg Subject: [PATCH 4/8] dts: Add alternative location for upstream DTB builds Date: Thu, 14 Dec 2023 19:20:59 +0530 Message-Id: <20231214135103.1606605-5-sumit.garg@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231214135103.1606605-1-sumit.garg@linaro.org> References: <20231214135103.1606605-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/arch/$(ARCH) (special case for dts/arch/arm64). Then build then along with any *-u-boot.dtsi file present in arch/$(ARCH)/dts directory. This will help easy migration for platforms which currently are compliant with upstream Linux kernel devicetree files. Signed-off-by: Sumit Garg --- dts/Kconfig | 11 +++++++++++ dts/Makefile | 17 ++++++++++++++--- dts/arch/arm64/Makefile | 14 ++++++++++++++ 3 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 dts/arch/arm64/Makefile diff --git a/dts/Kconfig b/dts/Kconfig index 00c0aeff893..96396f12b67 100644 --- a/dts/Kconfig +++ b/dts/Kconfig @@ -85,6 +85,17 @@ 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. + choice prompt "Provider of DTB for DT control" depends on OF_CONTROL diff --git a/dts/Makefile b/dts/Makefile index 3437e54033d..8098bf8191a 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) +DEVICE_TREE_LOC := dts/arch/arm64 +else +DEVICE_TREE_LOC := dts/arch/$(ARCH) +endif +else +DEVICE_TREE_LOC := arch/$(ARCH)/dts +endif + ifneq ($(EXT_DTB),) DTB := $(EXT_DTB) else -DTB := arch/$(ARCH)/dts/$(DEVICE_TREE).dtb +DTB := $(DEVICE_TREE_LOC)/$(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)=$(DEVICE_TREE_LOC) 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 \ + ./arch/arm64 ./arch/$(ARCH) diff --git a/dts/arch/arm64/Makefile b/dts/arch/arm64/Makefile new file mode 100644 index 00000000000..16e9fea622d --- /dev/null +++ b/dts/arch/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 */*_HS