Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp533615pxu; Thu, 7 Jan 2021 11:06:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJzNuX+psI6ABpBRfrSRC9S/9kfa5e+lfC59u5ZWNvIpBzsSR4Kvi5AgT81L5mnXV+UxMiAs X-Received: by 2002:a17:906:cd14:: with SMTP id oz20mr153768ejb.99.1610046382224; Thu, 07 Jan 2021 11:06:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610046382; cv=none; d=google.com; s=arc-20160816; b=05u8YWe4bN5oZ1C665nWMDqs4adUVB5zRh6oWQNLLak70qB5rLLeeotd/caWhw8dhD U4glkC4F/JQGf/q8CDbsOMEM3aOB1f8y3/MGiMzritG4XMwblrD2J1p8DQB5DEfBL0kS 8rdL3vSo7+nI0fvHH5tzXMZ+M0P3gZgtxppP04CJmn7lath9SJKXXcNPu1N2sCJjc17D BLtK6jhf4Jzb1yk8wV94X6xM04i7TgljkZhqhT6/RleH6bZpLn+sxtjV2riWvW1Pypth a/Zd+HIiMSN3M8UQuvyQNb9I1N5JdbLGC806oRMqtRKIsFqR2aZjvt2WUhH2bqeKO3rt YLYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=5nMqhKj4ughdfUYZKyibTph0KZQkmuNAiOQULVI/QOM=; b=rPkf/J7XvWqRxAB7O5Id5y3ZBx3qlDuGtMTJOo4yUCjTKvB27cfaXoKTvQ71k55MOu KRSKqMQQE3I7wWS0YO5Qmo+R1vvj21bFmJ4NwWS/H6AuV172JXOG3+A44RLtmLWlpFgB zfua8gSzJEJZdjVi1V2ZEOifOCioDIxQFKUbdMfxwUvM4Q09XZ6//bf6FZcji8AWijpG DQ9BpTzk/mpicbwc66Kww/6ybiujbJ++TrW6SVodU4Rc47OKCJxCXjnIKSsbv7aOYywB b+q32hA04bVOi6b3w77c0h0tg16DCrF3fIlr4N8fCv0LhE1P3R6mPvT6vWFujl8i/3lk 836Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BTS3AwKf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h22si2845789ejl.73.2021.01.07.11.05.57; Thu, 07 Jan 2021 11:06:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BTS3AwKf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728033AbhAGTDB (ORCPT + 99 others); Thu, 7 Jan 2021 14:03:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:41050 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726326AbhAGTDB (ORCPT ); Thu, 7 Jan 2021 14:03:01 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 45AB723435; Thu, 7 Jan 2021 19:02:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610046140; bh=TZFc2uhAUvgMw7NBM7C6fXOSdHM+P8snV02JquEUOw4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=BTS3AwKfTR0dYLwq+62mTag8GjfkQE4fBld0gDTblX2L/0l7ze+dHXhHSb/zorx27 qQSR+bQ9VC8Jxqcs84UA4jEfxK7bfRAKN41BLnUHXdzn1cd+9ZN80AJyTlmdOelPUD vhuisk5IUBEXTtvBNXs9dyJNd/VVSMST+In3X4PzJl1+GpXhEHJL4MqcJaRXguuIqx AH1sYsCSyxB9uXi1DPb9oomF6U4lH7Q1gvKa7xX6o9rO+QxIHduKhyNf908nAX1ueP kbAY+J2mr03glNJPEpgT97PwdaGqHC+OnYJeqrYYXHR65gyuhfXEV6OmoACBEiSzfK rttUvOPqo/jZA== Received: by mail-ej1-f50.google.com with SMTP id jx16so11115579ejb.10; Thu, 07 Jan 2021 11:02:20 -0800 (PST) X-Gm-Message-State: AOAM530fWx557vdWBUtW3JVQqqEcCxT5rr+/5LOUeN8oq2xnw09fnufj FVj/LWNwiZ9EHvSQK/sBIYaMuuKXn3PcZ1spBQ== X-Received: by 2002:a17:906:4146:: with SMTP id l6mr138538ejk.341.1610046138784; Thu, 07 Jan 2021 11:02:18 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Rob Herring Date: Thu, 7 Jan 2021 12:02:06 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC 0/2] kbuild: Add support to build overlays (%.dtbo) To: Masahiro Yamada , Viresh Kumar Cc: Arnd Bergmann , Olof Johansson , Pantelis Antoniou , Frank Rowand , Michal Marek , DTML , "linux-kernel@vger.kernel.org" , Linux Kbuild mailing list , Vincent Guittot , Bill Mills , tero.kristo@gmail.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 6, 2021 at 10:35 PM Masahiro Yamada wrote: > > On Wed, Jan 6, 2021 at 12:21 AM Rob Herring wrote: > > > > On Tue, Jan 5, 2021 at 4:24 AM Viresh Kumar wrote: > > > > > > Hello, > > > > > > Here is an attempt to make some changes in the kernel to allow building > > > of device tree overlays. > > > > > > While at it, I would also like to discuss about how we should mention > > > the base DT blobs in the Makefiles for the overlays, so they can be > > > build tested to make sure the overlays apply properly. > > > > > > A simple way is to mention that with -base extension, like this: > > > > > > $(overlay-file)-base := platform-base.dtb > > > > > > Any other preference ? > > > > Viresh's patch is not enough. > > We will need to change .gitignore > and scripts/Makefile.dtbinst as well. > > > In my understanding, the build rule is completely the same > between .dtb and .dtbo > As Rob mentioned, I am not sure if we really need/want > a separate extension. > > > A counter approach is to use an extension like '.ovl.dtb' > It clarifies it is an overlay fragment without changing > anything in our build system or the upstream DTC project. > > We use chained extension in some places, for example, > .dt.yaml for schema yaml files. > > > > dtb-$(CONFIG_ARCH_FOO) += \ > foo-board.dtb \ > foo-overlay1.ovl.dtb \ > foo-overlay2.ovl.dtb > > > Overlay DT source file names must end with '.ovl.dts' I like that suggestion as then it's also clear looking at the source files which ones are overlays. Or we'd need .dtso to be consistent. > > I think we'll want something similar to how '-objs' works for modules: > > > > foo-board-1-dtbs := foo-board.dtb foo-overlay1.dtbo > > foo-board-2-dtbs := foo-board.dtb foo-overlay2.dtbo > > foo-board-1-2-dtbs := foo-board.dtb foo-overlay1.dtbo foo-overlay2.dtbo > > dtbs-y += foo-board-1.dtb foo-board-2.dtb foo-board-1-2.dtb > > > > (One difference here is we will want all the intermediate targets > > unlike .o files.) > > > > You wouldn't necessarily have all the above combinations, but you have > > to allow for them. I'm not sure how we'd handle applying any common > > overlays where the base and overlay are in different directories. > > > I guess the motivation for supporting -dtbs is to > add per-board -@ option only when it contains *.dtbo pattern. I hadn't thought that far, but yeah, that would be good. Really, I just want it to be controlled per SoC family at least. > But, as you notice, if the overlay files are located > under drivers/, it is difficult to add -@ per board. Generally, they shouldn't be. The exceptions are what we already have there which are old dt fixups and unittests. We want the stripped DT repo (devicetree-rebasing) to have all this and drivers/ is stripped out. (Which reminds me, the DT repo will need some work to support all this. It's a different build sys.) > Another scenario is, some people may want to compile > downstream overlay files (i.e. similar concept as external modules), > then we have no idea which base board should be given with the -@ flag. > > > I'd rather be tempted to add it globally > > > ifdef CONFIG_OF_OVERLAY > DTC_FLAGS += -@ > endif We've already rejected doing that. Turning on '-@' can grow the dtb size by a significant amount which could be problematic for some boards. > > Another thing here is adding all the above is not really going to > > scale on arm32 where we have a single dts directory. We need to move > > things to per vendor/soc family directories. I have the script to do > > this. We just need to agree on the vendor names and get Arnd/Olof to > > run it. I also want that so we can enable schema checks by default > > once a vendor is warning free (the whole tree is going to take > > forever). > > > If this is a big churn, perhaps we could make it extreme > to decouple DT and Linux-arch. I would be fine with that, but I don't think we'll get agreement there. With that amount of change, we'll be discussing git submodule again. Rereading the thread on vendor directories[1], we may just move boards one vendor at a time. We could just make that a prerequisite for vendor supporting overlays. > arch/*/boot/dts/*.dts > -> dts//*.dts > > Documentation/devicetree/bindings > -> dts/Bindings/ > > include/dt-bindings/ > -> dts/include/dt-bindings/ > > > > Then, other project can take dts/ > to reuse for them. This is already possible with devicetree-rebasing.git. Though it is still by arch. Rob [1] https://lore.kernel.org/linux-devicetree/20181204183649.GA5716@bogus/