From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B10DC433EF for ; Sat, 16 Oct 2021 00:32:21 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E7C0B61027 for ; Sat, 16 Oct 2021 00:32:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E7C0B61027 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 99A7083656; Sat, 16 Oct 2021 02:32:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="laXPzhrI"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BEF168369F; Sat, 16 Oct 2021 02:32:14 +0200 (CEST) Received: from mail-vk1-xa31.google.com (mail-vk1-xa31.google.com [IPv6:2607:f8b0:4864:20::a31]) (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 818FB834E8 for ; Sat, 16 Oct 2021 02:32:06 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-vk1-xa31.google.com with SMTP id n201so5926689vkn.12 for ; Fri, 15 Oct 2021 17:32:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=osLMKMptv0iEURciJGdw5AyFFFN4sBAguVvNqu8Jqg0=; b=laXPzhrIhk+jZTHh6OuVWY5MwBJJYU4lCN+XRfwrUHxxN20YpQgqG/yz5FpFe1Oybq 2gk2LIiDuy8oBW3rnokBf/3pq92xJ1FR2JOWIMc4AyTm8LRsP4jsxdG/Y3ayQXPCMQQj tkaBwcmR+UqZu8CZ8JFqM7EKgg8hoj35IL52k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=osLMKMptv0iEURciJGdw5AyFFFN4sBAguVvNqu8Jqg0=; b=c+xUDeWEvVxNsoyUqixGleiYkSC/Ed29tny1n/6tHyV0IZTTWh/CA9Nksx9XB+/cSf l6m5U6c5nzANSci2o2bVsoQ5FZLzha85kVa2VWIW7eWWCriDTxPuEHVEbIgqGISma3r5 Q2+AkRAsfBHaVbxsb69vtwgBGsJ6/kOvQEL6CVjEN/QUnvnSaKRI8hcVt0GCGQ8iwWz2 SLcooL7AqHObwvbaZ48Jth+udcUTOtuyv8jfzNCiyyTUZMidke7hUtPIGZJH/ewUiDt+ u1H2WxkKZj5wiE4xR/1jgTMZpl1xYbNmAo8rwyd3DX8mH+ASeXnTOVEy+19h7RLN5I9a 5/Ow== X-Gm-Message-State: AOAM530nv2Ki9yrWevBowt0WLSRseANPOwomDl1da91VsWp5wx4OLXuZ rDewYhdCi/gBxHptjCK1Pqwew+0BHQuQCl2FJgX3MA== X-Google-Smtp-Source: ABdhPJzwE9BJc1yF4XqtrdtADGiPhPrEiVGcTQEnQeEnaJ9HtfwpOPjhNzWQEAj5xLBeUfdP16sxjBYAaBMpNlkp/7Q= X-Received: by 2002:a1f:5c46:: with SMTP id q67mr16052152vkb.24.1634344324911; Fri, 15 Oct 2021 17:32:04 -0700 (PDT) MIME-Version: 1.0 References: <619B8C04-19A5-4D9F-89E3-B28876AF6474@benettiengineering.com> In-Reply-To: <619B8C04-19A5-4D9F-89E3-B28876AF6474@benettiengineering.com> From: Simon Glass Date: Fri, 15 Oct 2021 18:31:53 -0600 Message-ID: Subject: Re: External dts building To: Giulio Benetti , Masahiro Yamada Cc: Tom Rini , U-Boot Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean Hi Giulio, On Thu, 14 Oct 2021 at 21:06, Giulio Benetti wrote: > > Hi Simon, > > > Il giorno 15 ott 2021, alle ore 02:53, Simon Glass h= a scritto: > > > > =EF=BB=BFHi Giulio, > > > >> On Thu, 14 Oct 2021 at 15:12, Giulio Benetti > >> wrote: > >> > >> Hi Simon, > >> > >> Il giorno 14 ott 2021, alle ore 22:43, Simon Glass = ha scritto: > >> > >> =EF=BB=BFHi Giulio, > >> > >> On Thu, 14 Oct 2021 at 13:23, Giulio Benetti > >> wrote: > >> > >> > >> Hi Simon, > >> > >> > >> Il giorno 14 ott 2021, alle ore 20:24, Simon Glass = ha scritto: > >> > >> > >> =EF=BB=BFHi, > >> > >> > >> On Thu, 14 Oct 2021 at 07:46, Tom Rini wrote: > >> > >> > >> On Thu, Oct 14, 2021 at 02:53:30AM +0200, Giulio Benetti wrote: > >> > >> > >> Hello All, > >> > >> > >> is there a way to pass a dts file without touching the arch/arm/boot/d= ts/Makefile? > >> > >> > >> On Buildroot we support the possibility to pass an external dts by cop= ying it to the uboot sources to > >> > >> be built but since uboot version 2020.01 it doesn=E2=80=99t work anymo= re. > >> > >> > >> So I=E2=80=99ve proposed a patch to prepend the dts file in the Makefi= le above, but this has drawbacks, like we reconfigure(it keeps adding files= every time). > >> > >> > >> So I ask you, is there a more canonical way already to achieve this? > >> > >> > >> Not exactly, and it's something we're very much actively discussing > >> > >> right now. > >> > >> > >> Are you using 'make DEVICE_TREE=3Dxxx' ? > >> > >> > >> Yes but it doesn=E2=80=99t work if you don=E2=80=99t add an entry into= arch/arm/dts/Makefile > >> > >> Before version 2020.01 worked, but not after it. > >> > >> > >> What board are you building? > >> > >> > >> A20-OLinuXino-Lime_defconfig for but without CONFIG_DEFAULT_DEVICE_TRE= E undefined, > >> so if you try to pass DEVICE_TREE=3D pointing to an external .dts file= copied to arch/arm/dts/ make doesn=E2=80=99t find the entry in Makefile an= d it can=E2=80=99t build it. > >> > >> This is useful in build systems like Buildroot where you can provide a= n external defconfig as well as an external .dts file. > >> > >> So here the solution I see is to create an entry in arch/arm/dts/Makef= ile on the top of the file afte copying the .dts file we want to build. > >> But on Buildroot they=E2=80=99ve pointed me to ask upstream(here) if t= here=E2=80=99s a more canonical way or to work together to achieve the goal= : > >> > >> https://patchwork.ozlabs.org/project/buildroot/patch/20210209201303.19= 5093-1-giulio.benetti@benettiengineering.com/ > > > > How about not disabling CONFIG_DEFAULT_DEVICE_TREE ? That should work O= K. > > But if I=E2=80=99m not wrong the problem of the dts/Makefile remains. If = .dts file is not assigned to dtb-y it won=E2=80=99t be built. > > And in the case of Buildroot we have 2 ways to use external dts files: > 1) patch uboot adding the dts and the entry in dts/Makefile > 2) copy .dts file(let=E2=80=99s say located in ~/my-folder/my.dts) to arc= h/arm/dts/my.dts and prepend > the dtb-y +=3D my.dts in arch/arm/dts/Makefile and here problem arises. > Because it can work once but we need to make it possible to have =E2=80= =98make uboot-rebuild/reconfigure=E2=80=99 > (Buildroot has such targets). This way is not easy at all to prepend the = dtb-y at the top of the file without re-prepending it again and again. > > It worked up to uboot < 2020.01, but I still haven=E2=80=99t bisected to = see the =E2=80=9Coffending=E2=80=9D commit. > Maybe I can try and find out why it behaves like that. > > What about that? Have you tried EXT_DTB? It looks like DEVICE_TREE is designed for changing the name of the file. EXT_DTB=3D/tmp/b/sandbox/u-boot.dtb CROSS_COMPILE=3D/home/sglass/.buildman-toolchains/gcc-9.2.0-nolibc/arm-linu= x-gnueabi/bin/arm-linux-gnueabi- make O=3D/tmp/b/snow -j30 snow_defconfig all You need to compile it first though. For your case, I did a bisect with: git bisect run make -s DEVICE_TREE=3Dtry CROSS_COMPILE=3D/home/sglass/.buildman-toolchains/gcc-9.2.0-nolibc/arm-linu= x-gnueabi/bin/arm-linux-gnueabi- O=3D/tmp/b/snow -j30 mrproper snow_defconfig all and got: a3444bd09af (refs/bisect/bad) Revert "Ensure device tree DTS is compiled" +Masahiro Yamada who might know BTW if you rely on this feature, once it is working again, we should add a test for it. Regards, Simon