From patchwork Thu Feb 22 09:36:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 774847 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp715428wrw; Thu, 22 Feb 2024 03:29:18 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVMWc9ZoEH3HHY9keG8eCLrssaVxjwSQR4GRQNaqR7J6QzaPEgz0uBRBjGRvxw4QWVFlhHjDq1rUUjd7C4V2x/w X-Google-Smtp-Source: AGHT+IHnpeRW/oF1SrBdKPwY+uWsUl54BKmM2Db2lm79KVgYz3aTfPG+7azRvoovPdQyMJuU7oXK X-Received: by 2002:a17:906:b0d9:b0:a3d:2e0e:3f52 with SMTP id bk25-20020a170906b0d900b00a3d2e0e3f52mr15658742ejb.37.1708601358054; Thu, 22 Feb 2024 03:29:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708601358; cv=none; d=google.com; s=arc-20160816; b=IDPZZiv6e2+fBm1z6xKvKwL1KkxI3vpZvaBG+ViAvhaPULTs2XpIJ1DX8kVHgHUzGQ 3Wh2kc2WU2b3xEU0mMVEZWTuim2xX7nq0eOv96B6z2gYXGuVQxQtB4FTiZkfzvnPJZPi qeQY/5cVyxj6/1rkrgaCfE6Diykfh6jRJbcEQmZ+QPTW8922iyq0Q3DzN692+KZ8BoyY +HTuf+Sq5DStUhnWi7Dh8nakhS2aCXZ+qXbAlM7SlCZm6j693l7wAqnf+X7ELzFR+UAu 4s72G/MTjftKmDjpWBVIhtiVYFGZ4WOJI2iw8OeiLHe/QCFYyhtK6UmVVl7Anrt1JOsS goGw== 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=YIv5ND2Plt0jo/md/FZNy91yYgdgPbXjXh3z/SWSsvE=; fh=Yy8GFNbqEhl9MerJz1LfYQ39XksX1Ui9qbEvUBg6hMU=; b=dFHjev1w5eRhTXEwcG7HKlXIp/4NcJ6DG3VeT4g1sij3Alrs7o4kBb7LSMHER1iv1F OJ+muFoEt1TqF9IJls1bXEOs08HE0XyWvOXvSFd7PHYHwmjuYXiHkXFf1yhPIluRkpa/ Wf/2IqcnfOuDkGGoX/90xLwjWAn1/bav+hDv1MzII4ybgqOWfY/FHxUn62IayC4e+I5+ hZxyVFGiVIKUbWVAaMJKWzUyU4VntVSvvq5Y+CVZrbi53Q9UK85PQGyHoqhK0MydXEL1 S9100//G1eR3ECuBxGClFhHFoRibn2APbJDt5g/MR6xMtsi0Ut4McZ72iwD4oDpMt0xO xXKg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kTd7zjUj; 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 ho35-20020a1709070ea300b00a3e7507bfe1si4206220ejc.156.2024.02.22.03.29.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 03:29:18 -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=kTd7zjUj; 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 8DAF5880D3; Thu, 22 Feb 2024 12:25:31 +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="kTd7zjUj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CCEA58809C; Thu, 22 Feb 2024 10:37:21 +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-yb1-xb2d.google.com (mail-yb1-xb2d.google.com [IPv6:2607:f8b0:4864:20::b2d]) (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 8597187E6F for ; Thu, 22 Feb 2024 10:37: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=sumit.garg@linaro.org Received: by mail-yb1-xb2d.google.com with SMTP id 3f1490d57ef6-dc23bf7e5aaso7458694276.0 for ; Thu, 22 Feb 2024 01:37:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708594632; x=1709199432; 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=YIv5ND2Plt0jo/md/FZNy91yYgdgPbXjXh3z/SWSsvE=; b=kTd7zjUj/LL+EDbKsvpGkCf4GhaViMLmaKv43Q936RtMrCsJP10o9pGqnp111rqPoE w6/3Yi2WL+EmWQMwuFaW+nR0XjotaRl2Peb9PHdLV0ZoLehlS98Tm4DqrdkI0DkVjTNH +VrIYAbxAgNLd4jUpab0BEKhQtwpTmfbR3Wx2/d1MeHqk7b0gpsJ2QlGYV8LLLr/LwZa uFRTe9LQGXP3RmiNt6chzdlYMu678y4Mw4qLYul3FBKDkcpK5D+t53SgBSgoLSs9yyUk QTO3sr2pX1WwyCEJ+3F2mLVo5NtNdv66efmvJcaEzoKcKR1nlqhko8Wetj5b9hL0tT0b TT6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708594632; x=1709199432; 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=YIv5ND2Plt0jo/md/FZNy91yYgdgPbXjXh3z/SWSsvE=; b=di9JtuWneqXhdjkZfE+YT8ZJBAUQToo3WONLVkswp2UaVJsqXUnoR+gROpO6HvW5ue IBdMOwGP8IhTI4re+YJNFo2M7DwAVJ6r7jao1/7NhTqXHh0EqeFe+BpAm2D5ujKktyWy 2sV6U0yU9i9G4zj6ZmD3WJMl8Mnwj6Ve/bKbrZCLhE8YgVfC4CTgPgN9JTXyWa9k8fzT SHTlBFyrr0Q55Xuy+G4wpjmIsanVy6IJkcNdC7ZR61GHeBxxQnH4/efhTZFTx3EXMWBt CLdKELIGy9kj/sJR8hoIaOSPFgJ5KilzyzIYJ4z/NxpFoA/2AJE71mt4D6vimMHVKHw0 +TgQ== X-Gm-Message-State: AOJu0YwTlt2APa3nSycXgWZGUXv42OlBN1h523q4x1Jn8O4IstCXg62P E91ffnLa/yrXP6//sDXekBL4oi5Egm0U5AJeg+3rBEtDcoHiIEBtc6Z4ToqPlwzIrVGC+6HYC1l u X-Received: by 2002:a05:6902:5:b0:dc6:ba11:6edd with SMTP id l5-20020a056902000500b00dc6ba116eddmr1907798ybh.8.1708594631731; Thu, 22 Feb 2024 01:37:11 -0800 (PST) Received: from sumit-X1.. ([223.178.212.115]) by smtp.gmail.com with ESMTPSA id u20-20020a056a00099400b006e47300e4edsm6208404pfg.183.2024.02.22.01.37.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 01:37:11 -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, 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, festevam@gmail.com, nm@ti.com, andre.przywara@arm.com, ijc@hellion.org.uk, paul.barker.ct@bp.renesas.com, Sumit Garg Subject: [PATCH v6 05/11] dts: Add alternative location for upstream DTB builds Date: Thu, 22 Feb 2024 15:06:01 +0530 Message-Id: <20240222093607.3085545-6-sumit.garg@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240222093607.3085545-1-sumit.garg@linaro.org> References: <20240222093607.3085545-1-sumit.garg@linaro.org> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 22 Feb 2024 12:24:08 +0100 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 v6: - None Changes in v5: - None 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 00c0aeff893b..09789d3e18b3 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 3437e54033db..d6c2c9daf31d 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 000000000000..9a8f6aa35846 --- /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