The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Michal Simek <michal.simek@amd.com>
To: Masahiro Yamada <masahiroy@kernel.org>, Michal Simek <monstr@monstr.eu>
Cc: Rob Herring <robh@kernel.org>,
	linux-kernel@vger.kernel.org, Conor Dooley <conor+dt@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	devicetree@vger.kernel.org
Subject: Re: [PATCH 4/4] microblaze: remove unnecessary system.dts
Date: Tue, 10 Jun 2025 09:49:00 +0200	[thread overview]
Message-ID: <d27ab8aa-c312-4d1b-9655-65e6dd451da6@amd.com> (raw)
In-Reply-To: <CAK7LNAQqR7rtuCSy895q-WeJR-uhVB_0UH1DrGPNLoz1_cRhtg@mail.gmail.com>



On 5/13/25 06:50, Masahiro Yamada wrote:
> On Mon, Feb 3, 2025 at 8:17 PM Michal Simek <monstr@monstr.eu> wrote:
>>
>>
>>
>> On 2/1/25 04:42, Masahiro Yamada wrote:
>>> On Sat, Feb 1, 2025 at 7:25 AM Rob Herring <robh@kernel.org> wrote:
>>>>
>>>> On Tue, Jan 14, 2025 at 12:15 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>>>>>
>>>>> The default image linux.bin does not contain any DTB, but a separate
>>>>> system.dtb is compiled.
>>>>>
>>>>> Michal Simek clearly explained "system.dtb is really old dtb more for
>>>>> demonstration purpose and nothing else and likely it is not working on
>>>>> any existing board." [1]
>>>>>
>>>>> The system.dts is not necessary even for demonstration purposes. There
>>>>> is no need to compile out-of-tree *.dts under arch/microblaze/boot/dts/
>>>>> unless it is embedded into the kernel. Users can directly use dtc.
>>>>>
>>>>> [1]: https://lore.kernel.org/all/d2bdfbfd-3721-407f-991e-566d48392add@amd.com/
>>>>>
>>>>> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
>>>>> ---
>>>>>
>>>>>    arch/microblaze/boot/dts/Makefile   |   3 +-
>>>>>    arch/microblaze/boot/dts/system.dts | 353 ----------------------------
>>>>>    2 files changed, 1 insertion(+), 355 deletions(-)
>>>>>    delete mode 100644 arch/microblaze/boot/dts/system.dts
>>>>>
>>>>> diff --git a/arch/microblaze/boot/dts/Makefile b/arch/microblaze/boot/dts/Makefile
>>>>> index 932dc7550a1b..fa0a6c0854ca 100644
>>>>> --- a/arch/microblaze/boot/dts/Makefile
>>>>> +++ b/arch/microblaze/boot/dts/Makefile
>>>>> @@ -1,8 +1,6 @@
>>>>>    # SPDX-License-Identifier: GPL-2.0
>>>>>    #
>>>>>
>>>>> -dtb-y := system.dtb
>>>>> -
>>>>>    ifneq ($(DTB),)
>>>>>    obj-y += linked_dtb.o
>>>>>
>>>>> @@ -11,6 +9,7 @@ $(obj)/linked_dtb.o: $(obj)/system.dtb
>>>>>
>>>>>    # Generate system.dtb from $(DTB).dtb
>>>>>    ifneq ($(DTB),system)
>>>>
>>>> Can't this be dropped as setting DTB=system.dtb should work if there's
>>>> not an in-tree system.dts anymore.
>>>
>>> I believe this ifneq is necessary, just in case
>>> a user adds system.dtb to arch/microblaze/boot/dts/.
>>>
>>> 'system.dtb' is a special name because
>>> arch/microblaze/boot/dts/linked_dtb.S wraps it.
>>>
>>> So, $(DTB) is copied to system.dtb, and then
>>> it is wrapped by linked_dtb.S.
>>>
>>> If $(DTB) is already 'system',
>>> we cannot copy system.dtb to itself.
>>>
>>>
>>> See the definition of cmd_copy in scripts/Makefile.lib
>>>
>>> cmd_copy = cat $< > $@
>>>
>>>
>>> "cat system.dtb > system.dtb"
>>> would create an empty system.dtb
>>>
>>
>> I have played with this and pretty much this patch is blocking
>> simpleImage.system build target.
>>
>> I have no issue with patches 1-3 and I would keep system.dts as empty and keep
>> it in the tree because users (including me) just rewrite system.dts with proper
>> DTS and call make simpleImage.system.
> 
> Why is "system" so special?
> 
> You hard-code this line:
>      dtb-y := system.dtb
> 
> 
> "make simpleImage.system" compiles system.dts to system.dtb

yes.



> However,
> 
> "make simpleImage.foo" does not compile foo.dts to foo.dtb
> since "dtb-y := foo.dtb" is missing.

Correct but foo.dts is not in the source code too.
Downstream repos can add multiple dtses to source code based on configurations 
which are supporting and then they add

dtb-y += foo.dtb

there.

> This works only if you drop-in a pre-compiled foo.dtb

as above. It is up to users to decide how they want to do it.

If they add dts to source they have to also add a rule. If they want to just use 
DTB then can just copy it there to get it work.

Another option is also just overwrite system.dts by custom dts file.


> "make simpleImage.<name>" works only when <name> is "system".

With upstream repo yes.
And the reason is that system.dts is just example.
In Microblaze systems you can have unlimited amount of configurations that's why 
make no sense to start to push DTSes to the kernel because it is only supporting 
one particular configuration on one board.

Thanks,
Michal



      reply	other threads:[~2025-06-10  7:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-14 18:13 [PATCH 1/4] microblaze: fix 'FORCE prerequisite is missing' warning Masahiro Yamada
2025-01-14 18:13 ` [PATCH 2/4] microblaze: merge build rules for linux.bin and simpleImage.$(DTB) Masahiro Yamada
2025-01-14 18:13 ` [PATCH 3/4] microblaze: prevent linux.bin from containing a built-in DTB Masahiro Yamada
2025-01-14 18:13 ` [PATCH 4/4] microblaze: remove unnecessary system.dts Masahiro Yamada
2025-01-31 22:25   ` Rob Herring
2025-02-01  3:42     ` Masahiro Yamada
2025-02-03 11:17       ` Michal Simek
2025-05-13  4:50         ` Masahiro Yamada
2025-06-10  7:49           ` Michal Simek [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d27ab8aa-c312-4d1b-9655-65e6dd451da6@amd.com \
    --to=michal.simek@amd.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=monstr@monstr.eu \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox