diff mbox series

[1/9] microblaze: dts: Use the normal build rule

Message ID 20231227082405.2202246-2-sjg@chromium.org
State Changes Requested
Delegated to: Tom Rini
Headers show
Series dts: Move to SoC-specific build rules | expand

Commit Message

Simon Glass Dec. 27, 2023, 8:23 a.m. UTC
Build devicetree files using the normal SoC-generic rule. For
microblaze there is actually only one SoC and one board.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 arch/microblaze/dts/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tom Rini Dec. 27, 2023, 1:20 p.m. UTC | #1
On Wed, Dec 27, 2023 at 08:23:57AM +0000, Simon Glass wrote:
> Build devicetree files using the normal SoC-generic rule. For
> microblaze there is actually only one SoC and one board.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> 
>  arch/microblaze/dts/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/microblaze/dts/Makefile b/arch/microblaze/dts/Makefile
> index 427a8f9aaca..adc76ddf21f 100644
> --- a/arch/microblaze/dts/Makefile
> +++ b/arch/microblaze/dts/Makefile
> @@ -1,6 +1,6 @@
>  # SPDX-License-Identifier: GPL-2.0+
>  
> -dtb-y += $(shell echo $(CONFIG_DEFAULT_DEVICE_TREE)).dtb
> +dtb-$(CONFIG_MICROBLAZE) += microblaze-generic.dtb
>  
>  include $(srctree)/scripts/Makefile.dts

This (and nios2 and perhaps a few other arches) show that it would be
easier to just drop the dts- line as it adds nothing over what
scripts/Makefile.dts gives us. I wonder how this will interact with
OF_UPSTREAM and how it compares with arch/microblaze/boot/dts/system.dts
in the linux kernel.
Simon Glass Dec. 28, 2023, 1:37 p.m. UTC | #2
Hi Tom,

On Wed, Dec 27, 2023 at 1:20 PM Tom Rini <trini@konsulko.com> wrote:
>
> On Wed, Dec 27, 2023 at 08:23:57AM +0000, Simon Glass wrote:
> > Build devicetree files using the normal SoC-generic rule. For
> > microblaze there is actually only one SoC and one board.
> >
> > Signed-off-by: Simon Glass <sjg@chromium.org>
> > ---
> >
> >  arch/microblaze/dts/Makefile | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/microblaze/dts/Makefile b/arch/microblaze/dts/Makefile
> > index 427a8f9aaca..adc76ddf21f 100644
> > --- a/arch/microblaze/dts/Makefile
> > +++ b/arch/microblaze/dts/Makefile
> > @@ -1,6 +1,6 @@
> >  # SPDX-License-Identifier: GPL-2.0+
> >
> > -dtb-y += $(shell echo $(CONFIG_DEFAULT_DEVICE_TREE)).dtb
> > +dtb-$(CONFIG_MICROBLAZE) += microblaze-generic.dtb
> >
> >  include $(srctree)/scripts/Makefile.dts
>
> This (and nios2 and perhaps a few other arches) show that it would be
> easier to just drop the dts- line as it adds nothing over what
> scripts/Makefile.dts gives us.

For consistency I like to see a rule for each .dtb in the directory.

> I wonder how this will interact with
> OF_UPSTREAM and how it compares with arch/microblaze/boot/dts/system.dts
> in the linux kernel.

I don't see any interaction. Perhaps the maintainer can move this to
OF_UPSTREAM?

Regards,
Simon
Tom Rini Dec. 28, 2023, 2:26 p.m. UTC | #3
On Thu, Dec 28, 2023 at 01:37:49PM +0000, Simon Glass wrote:
> Hi Tom,
> 
> On Wed, Dec 27, 2023 at 1:20 PM Tom Rini <trini@konsulko.com> wrote:
> >
> > On Wed, Dec 27, 2023 at 08:23:57AM +0000, Simon Glass wrote:
> > > Build devicetree files using the normal SoC-generic rule. For
> > > microblaze there is actually only one SoC and one board.
> > >
> > > Signed-off-by: Simon Glass <sjg@chromium.org>
> > > ---
> > >
> > >  arch/microblaze/dts/Makefile | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/arch/microblaze/dts/Makefile b/arch/microblaze/dts/Makefile
> > > index 427a8f9aaca..adc76ddf21f 100644
> > > --- a/arch/microblaze/dts/Makefile
> > > +++ b/arch/microblaze/dts/Makefile
> > > @@ -1,6 +1,6 @@
> > >  # SPDX-License-Identifier: GPL-2.0+
> > >
> > > -dtb-y += $(shell echo $(CONFIG_DEFAULT_DEVICE_TREE)).dtb
> > > +dtb-$(CONFIG_MICROBLAZE) += microblaze-generic.dtb
> > >
> > >  include $(srctree)/scripts/Makefile.dts
> >
> > This (and nios2 and perhaps a few other arches) show that it would be
> > easier to just drop the dts- line as it adds nothing over what
> > scripts/Makefile.dts gives us.
> 
> For consistency I like to see a rule for each .dtb in the directory.

Yes, and for consistency I'd like to see Makefiles be as minimal as
required.

> > I wonder how this will interact with
> > OF_UPSTREAM and how it compares with arch/microblaze/boot/dts/system.dts
> > in the linux kernel.
> 
> I don't see any interaction. Perhaps the maintainer can move this to
> OF_UPSTREAM?

Well, that's the big question here, how exactly does microblaze work
with device trees? The U-Boot one is basically empty. I think we're both
going to be waiting on Michal now :)
Michal Simek Jan. 2, 2024, 12:58 p.m. UTC | #4
On 12/28/23 15:26, Tom Rini wrote:
> On Thu, Dec 28, 2023 at 01:37:49PM +0000, Simon Glass wrote:
>> Hi Tom,
>>
>> On Wed, Dec 27, 2023 at 1:20 PM Tom Rini <trini@konsulko.com> wrote:
>>>
>>> On Wed, Dec 27, 2023 at 08:23:57AM +0000, Simon Glass wrote:
>>>> Build devicetree files using the normal SoC-generic rule. For
>>>> microblaze there is actually only one SoC and one board.
>>>>
>>>> Signed-off-by: Simon Glass <sjg@chromium.org>
>>>> ---
>>>>
>>>>   arch/microblaze/dts/Makefile | 2 +-
>>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/arch/microblaze/dts/Makefile b/arch/microblaze/dts/Makefile
>>>> index 427a8f9aaca..adc76ddf21f 100644
>>>> --- a/arch/microblaze/dts/Makefile
>>>> +++ b/arch/microblaze/dts/Makefile
>>>> @@ -1,6 +1,6 @@
>>>>   # SPDX-License-Identifier: GPL-2.0+
>>>>
>>>> -dtb-y += $(shell echo $(CONFIG_DEFAULT_DEVICE_TREE)).dtb
>>>> +dtb-$(CONFIG_MICROBLAZE) += microblaze-generic.dtb
>>>>
>>>>   include $(srctree)/scripts/Makefile.dts
>>>
>>> This (and nios2 and perhaps a few other arches) show that it would be
>>> easier to just drop the dts- line as it adds nothing over what
>>> scripts/Makefile.dts gives us.
>>
>> For consistency I like to see a rule for each .dtb in the directory.
> 
> Yes, and for consistency I'd like to see Makefiles be as minimal as
> required.
> 
>>> I wonder how this will interact with
>>> OF_UPSTREAM and how it compares with arch/microblaze/boot/dts/system.dts
>>> in the linux kernel.
>>
>> I don't see any interaction. Perhaps the maintainer can move this to
>> OF_UPSTREAM?
> 
> Well, that's the big question here, how exactly does microblaze work
> with device trees? The U-Boot one is basically empty. I think we're both
> going to be waiting on Michal now :)

U-Boot and Linux DT is just for reference. There is no really golden DT to use. 
Every design is different and I am fine with completely remove their content but 
I would like to keep just one empty DT as we have now in u-boot.
The reason is that when you have your own design and you want to test it quickly 
you can just cp your new file over microblaze-generic.dts with existing makefile 
rule and build u-boot with OF embed and just test it.

In Linux there is very old DT and I should likely remove it completely. It 
targets designed which were used a lot of years ago and definitely not passing 
any dt schema validation.

Thanks,
Michal
Michal Simek Jan. 2, 2024, 1:01 p.m. UTC | #5
On 12/27/23 09:23, Simon Glass wrote:
> Build devicetree files using the normal SoC-generic rule. For
> microblaze there is actually only one SoC and one board.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> 
>   arch/microblaze/dts/Makefile | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/microblaze/dts/Makefile b/arch/microblaze/dts/Makefile
> index 427a8f9aaca..adc76ddf21f 100644
> --- a/arch/microblaze/dts/Makefile
> +++ b/arch/microblaze/dts/Makefile
> @@ -1,6 +1,6 @@
>   # SPDX-License-Identifier: GPL-2.0+
>   
> -dtb-y += $(shell echo $(CONFIG_DEFAULT_DEVICE_TREE)).dtb
> +dtb-$(CONFIG_MICROBLAZE) += microblaze-generic.dtb
>   
>   include $(srctree)/scripts/Makefile.dts
>   

This feature was added by Nathan likely for yocto purpose.

commit 41f59f6853915291c7451c9e38c196fd5a90bf6a
Author:     Michal Simek <michal.simek@amd.com>
AuthorDate: Wed Feb 15 08:22:04 2017 +0100
Commit:     Michal Simek <michal.simek@amd.com>
CommitDate: Mon Jun 19 15:52:39 2017 +0200

     microblaze: Build only DTBs for selected target

     Adding more targets to repository requires some additional
     changes not simply just adding config file, defconfig and dts.
     This patch makes this process easier by building only
     particular DTB which is selected via defconfig
     that Makefile doesn't need to contain all dts files in the repository.

     Reported-by: Nathan Rossi <nathan@nathanrossi.com>
     Signed-off-by: Michal Simek <michal.simek@xilinx.com>

Mark: Can you please double check what Yocto is doing for supporting multiple 
microblaze based DTs? If you are copying dtses to u-boot source code and then 
using CONFIG_DEFAULT_DEVICE_TREE to select DT to build?

Thanks,
Michal
diff mbox series

Patch

diff --git a/arch/microblaze/dts/Makefile b/arch/microblaze/dts/Makefile
index 427a8f9aaca..adc76ddf21f 100644
--- a/arch/microblaze/dts/Makefile
+++ b/arch/microblaze/dts/Makefile
@@ -1,6 +1,6 @@ 
 # SPDX-License-Identifier: GPL-2.0+
 
-dtb-y += $(shell echo $(CONFIG_DEFAULT_DEVICE_TREE)).dtb
+dtb-$(CONFIG_MICROBLAZE) += microblaze-generic.dtb
 
 include $(srctree)/scripts/Makefile.dts