From patchwork Fri Dec 22 06:12:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 757460 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp1253224wrw; Thu, 21 Dec 2023 22:13:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IH2GTtaR2rljxBY0piaN7qbHngstm7rtbGxWp9cRTlWdL9orz3IHVWczg0KqXrJHHPJ8Fz5 X-Received: by 2002:a05:600c:4f94:b0:40c:3e0a:692e with SMTP id n20-20020a05600c4f9400b0040c3e0a692emr379711wmq.232.1703225599217; Thu, 21 Dec 2023 22:13:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703225599; cv=none; d=google.com; s=arc-20160816; b=liQ5vPgV7UkP6bWJvlKAgRio3bt5H5Gu7AAgMV4xhp2gf3MRxmUij6OseGFXalRl6f 2LR3RKEuBsvwEXI5e3skHiDJDmQWkSxCMwbwhKx7k5VX5S7hxhM8h8MikVk2iIut5NX3 FDfs/Rb5wfrAHKJdDxKx0Dxl8DPbHv5yb3NomOpDWg83K+DqSG/rGWPMkK6bb//t0bK0 iutVaHxCewTK8J7NQM9I6EL/2U+mRpP2TFejovbLPSaCx8CVs/i0vA7U0nCHi5a5cvGe DgAPZkEhO4tI9UHsqPA5+wJ4BwbmZSY4FKawO6CPDhd67B9CqtiSQ+Fu+2Z4c8OY4vs0 Hpqg== 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=67reddoWyrVbqDX3B/b1zeD5qmhzQrkt4dlItSvlqXo=; fh=VZWdizSVWfhngo19Gt5nLjhnxzdtHBYWvcywp4ujR58=; b=XfBQ7IVAiz8YBWmIznB4la75ohJKV0g8n+x4g7Rt7Alq+sQ6spC47soSTByvkuUpPq CWywqvUu3NTphWXCcucckK6t3iR1xRc6/+h4BErgOsoYxf86SgDCct23ssuHiWhY6MXc WT+3+qh2PJqEiPrlIQE2tv2bRaSXztamTEvrmxquhy9ekZ/VBxgI+lB2W62ISYoYDXeW RckwFWADLFpCFkYK/ZVPKVZuBxqhOPqUrE5edsSFChFDnj9M6OO4gq9SuJLxu/CTGQ9+ WK7vadEVCT7ntmS5Uu8540At/R6AH1b34iih/2ZtetY4a3AdHbS5g4zWRGcQ5UCywC1g Mmqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kbxlhOjq; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id v7-20020a5d5907000000b0033686e64493si1437600wrd.211.2023.12.21.22.13.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 22:13:19 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kbxlhOjq; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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 5FC1687801; Fri, 22 Dec 2023 07:13:05 +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="kbxlhOjq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DCB248780C; Fri, 22 Dec 2023 07:13:03 +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-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) (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 053E287837 for ; Fri, 22 Dec 2023 07:13:00 +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-pf1-x42c.google.com with SMTP id d2e1a72fcca58-6d4bef65786so1413966b3a.2 for ; Thu, 21 Dec 2023 22:12:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703225578; x=1703830378; 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=67reddoWyrVbqDX3B/b1zeD5qmhzQrkt4dlItSvlqXo=; b=kbxlhOjq9yc4+AsRfrP+udg2FSfRT6yVDJfQF7Au9OMpSPDnydFEDrupOmHSfVT8Gu CuA/LeLmVZkbGR9qwOOMd+XvJjNUMdwOL8rPoeBNUpm2zRHpoaBRLZI+UUxRwlpZydbv MJRCFmRq+26mFVKzA3NbjIKq08bzmfDStSG4+uwD1MFO6dA/ptbtGQIkUMcWbzjdc+YF Q2GSWg0mn2PkmE7hJwk2vIcL6LZBkzovzPhz6WWVttWlTzh3zvhnMmQhmUpMge/EymHA 17VRBP6w+Sz16jaj/BcqrDs4DW4QQ5Y+1SHcsvUzdjKcC539LXT32QVTKuGGGqzP2iPl Svlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703225578; x=1703830378; 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=67reddoWyrVbqDX3B/b1zeD5qmhzQrkt4dlItSvlqXo=; b=TaNbEvrUzbfaDyt8X+XTY/GyTGkFDAbAOl7g9xQ1VjSwANOFSIJx/30WEIPuSiuRoB 40t4NOmEJyMopshEtsP3FZqMIAdWuNT9P3zx0DIURBBmpV5kMFeWMW7O76lvC4yoGEGa Nb6ocKLrMUypp0ht0sLovG2LXsTuOkFmEv/Ns0Vfwz2oCz9cdrxcKG4KmJXhaO5nLd6k 19GzIygGr9MDIegJRANj7u12HTR24bTUpP49b/5exLUktXx+JZIHynPAqRzDYH+CkF0m mRXDfn3+c08pSkXLqbV3xAlaFEtLYbKo6i1npWp9eszrPHzb2nfNg5pR9v6gjdB/+8e/ MNSg== X-Gm-Message-State: AOJu0Yy/R2mGoMFUTnfYPaRWSsMpqfy65AySZNp73dWbVeaQhcY/To/v dFtVElDN1eim5kTJcS7gwSwQQnnmBMQfp3LuWNhzC3opm3fWqw== X-Received: by 2002:a05:6a00:80e3:b0:6ce:f6a1:72aa with SMTP id ei35-20020a056a0080e300b006cef6a172aamr796782pfb.4.1703225577899; Thu, 21 Dec 2023 22:12:57 -0800 (PST) Received: from sumit-X1.. ([223.178.212.219]) by smtp.gmail.com with ESMTPSA id h6-20020aa79f46000000b006ce835b77d9sm2602883pfr.20.2023.12.21.22.12.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 22:12:57 -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 v2 4/8] dts: Add alternative location for upstream DTB builds Date: Fri, 22 Dec 2023 11:42:04 +0530 Message-Id: <20231222061208.3009970-5-sumit.garg@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231222061208.3009970-1-sumit.garg@linaro.org> References: <20231222061208.3009970-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..e58c1c6f2ab 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..68daaf45ec7 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/arch/arm64 +else +dt_dir := dts/arch/$(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 \ + ./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