Skip to contentSkip to conversation

OF_UPSTREAM vs. additional dtbs

DISCUSSION Jan Kiszka 5 participants 23 messages Aug 13, 2024 – Sep 10, 2024 2 messages not in the archive Kbuild

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

Hi all,

I'm trying to migrate the TI AM65x IOT2050 boards to OF_UPSTREAM but I'm facing issues because I need to still build the u-boot-only overlays. It is also a bit weird (but works) having to specify

CONFIG_SPL_OF_LIST="../../../../arch/arm/dts/k3-am65-iot2050-spl"

for our spl dtb.

Are there means to still build certain dtb[o] files in arch/<arch>/dts? I'm a bit lost in the Makefile forest.

Thanks,
Jan

Signature · 2 lines
Siemens AG, Technology
Linux Expert Center
#1 lore raw
Quoted 6 lines · Jan Kiszka

Hi all,

I'm trying to migrate the TI AM65x IOT2050 boards to OF_UPSTREAM but I'm facing issues because I need to still build the u-boot-only overlays. It is also a bit weird (but works) having to specify

Quoted 7 lines

CONFIG_SPL_OF_LIST="../../../../arch/arm/dts/k3-am65-iot2050-spl"

for our spl dtb.

Are there means to still build certain dtb[o] files in arch/<arch>/dts? I'm a bit lost in the Makefile forest.

Sumit: Any suggestions?

Signature · 3 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
author
#2 lore raw
Quoted 9 lines · Nishanth Menon
Quoted 8 lines · Jan Kiszka

Hi all,

I'm trying to migrate the TI AM65x IOT2050 boards to OF_UPSTREAM but I'm facing issues because I need to still build the u-boot-only overlays. It is also a bit weird (but works) having to specify

CONFIG_SPL_OF_LIST="../../../../arch/arm/dts/k3-am65-iot2050-spl"

Actually, this does NOT work: I just had a long morning debugging SPL which no longer started because it picked the non-filtered dtb. The filtered one ended up in a folder outside of the u-boot sources because of all those ../ and hard-wiring to dts/upstream.

Quoted 8 lines
Quoted 5 lines

for our spl dtb.

Are there means to still build certain dtb[o] files in arch/<arch>/dts? I'm a bit lost in the Makefile forest.

Sumit: Any suggestions?

I would really like to hear some better proposals than my local workarounds to far. They don't converge although I already patched some core Makefile (overlays are building now).

Jan

Signature · 2 lines
Siemens AG, Technology
Linux Expert Center
author
#3 lore raw
Quoted 22 lines · Jan Kiszka
Quoted 9 lines · Nishanth Menon
Quoted 8 lines · Jan Kiszka

Hi all,

I'm trying to migrate the TI AM65x IOT2050 boards to OF_UPSTREAM but I'm facing issues because I need to still build the u-boot-only overlays. It is also a bit weird (but works) having to specify

CONFIG_SPL_OF_LIST="../../../../arch/arm/dts/k3-am65-iot2050-spl"

Actually, this does NOT work: I just had a long morning debugging SPL which no longer started because it picked the non-filtered dtb. The filtered one ended up in a folder outside of the u-boot sources because of all those ../ and hard-wiring to dts/upstream.

Quoted 6 lines
Quoted 5 lines

for our spl dtb.

Are there means to still build certain dtb[o] files in arch/<arch>/dts? I'm a bit lost in the Makefile forest.

Quoted 7 lines
Quoted 2 lines

Sumit: Any suggestions?

I would really like to hear some better proposals than my local workarounds to far. They don't converge although I already patched some core Makefile (overlays are building now).

OK, I side-stepped the spl issue by using one of our variant DTBs for spl as well - happens to work.

For the overlays, I need to add

scripts/Makefile.dts +2 -0
@@ -1,5 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 
+include $(srctree)/config.mk
+
 dtb-y += $(patsubst %,%.dtb,$(subst ",,$(CONFIG_DEFAULT_DEVICE_TREE) $(CONFIG_OF_LIST) $(CONFIG_SPL_OF_LIST)))
 
 ifeq ($(CONFIG_OF_UPSTREAM_BUILD_VENDOR),y)

in order to then be able to do

board/siemens/iot2050/config.mk +8 -0
@@ -5,4 +5,12 @@
 # Authors:
 #   Jan Kiszka <[email protected]>
 
+ifneq ($(CONFIG_SPL_BUILD),y)
+dtbo-list = \
+	k3-am6548-iot2050-advanced-m2-bkey-usb3-overlay \
+	k3-am6548-iot2050-advanced-m2-bkey-ekey-pcie-overlay
+
+dtb-y += $(patsubst %,../../../../arch/arm/dts/%.dtbo,$(dtbo-list))
+endif
+
 flash.bin: all

Does that make sense?

Jan

Signature · 2 lines
Siemens AG, Technology
Linux Expert Center
#4 lore raw

Hi,

Quoted 18 lines · Jan Kiszka
Quoted 16 lines · Jan Kiszka
Quoted 9 lines · Nishanth Menon
Quoted 8 lines · Jan Kiszka

Hi all,

I'm trying to migrate the TI AM65x IOT2050 boards to OF_UPSTREAM but I'm facing issues because I need to still build the u-boot-only overlays. It is also a bit weird (but works) having to specify

CONFIG_SPL_OF_LIST="../../../../arch/arm/dts/k3-am65-iot2050-spl"

Actually, this does NOT work: I just had a long morning debugging SPL which no longer started because it picked the non-filtered dtb. The filtered one ended up in a folder outside of the u-boot sources because of all those ../ and hard-wiring to dts/upstream.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

for our spl dtb.

Are there means to still build certain dtb[o] files in arch/<arch>/dts? I'm a bit lost in the Makefile forest.

Sumit: Any suggestions?

Apologies for the delayed reply. I was a bit busy with other high priority stuff.

Quoted 8 lines
Quoted 5 lines

I would really like to hear some better proposals than my local workarounds to far. They don't converge although I already patched some core Makefile (overlays are building now).

OK, I side-stepped the spl issue by using one of our variant DTBs for spl as well - happens to work.

That's good to know.

Quoted 34 lines

For the overlays, I need to add

scripts/Makefile.dts +2 -0
@@ -1,5 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 
+include $(srctree)/config.mk
+
 dtb-y += $(patsubst %,%.dtb,$(subst ",,$(CONFIG_DEFAULT_DEVICE_TREE) $(CONFIG_OF_LIST) $(CONFIG_SPL_OF_LIST)))
 
 ifeq ($(CONFIG_OF_UPSTREAM_BUILD_VENDOR),y)

in order to then be able to do

board/siemens/iot2050/config.mk +8 -0
@@ -5,4 +5,12 @@
 # Authors:
 #   Jan Kiszka <[email protected]>
 
+ifneq ($(CONFIG_SPL_BUILD),y)
+dtbo-list = \
+       k3-am6548-iot2050-advanced-m2-bkey-usb3-overlay \
+       k3-am6548-iot2050-advanced-m2-bkey-ekey-pcie-overlay
+
+dtb-y += $(patsubst %,../../../../arch/arm/dts/%.dtbo,$(dtbo-list))
+endif
+
 flash.bin: all
Quoted 1 line

Does that make sense?

A switch to OF_UPSTREAM means that we build all the DT artifacts from dts/upstream/src/ directory with the only exception that we include U-Boot specific overrides via *-u-boot.dtsi from arch/<arch>/dts. In case of overlays, is there any reason for IOT2050 board overlays not being pushed into Linux kernel repo? AFAIU, overlays are also describing puggable hardware so they shouldn't be referred to as "u-boot-only" overlays.

-Sumit

Quoted 7 lines

Jan

--
Siemens AG, Technology
Linux Expert Center

author
#5 lore raw
Quoted 78 lines · Sumit Garg

Hi,

Quoted 18 lines · Jan Kiszka
Quoted 16 lines · Jan Kiszka
Quoted 9 lines · Nishanth Menon
Quoted 8 lines · Jan Kiszka

Hi all,

I'm trying to migrate the TI AM65x IOT2050 boards to OF_UPSTREAM but I'm facing issues because I need to still build the u-boot-only overlays. It is also a bit weird (but works) having to specify

CONFIG_SPL_OF_LIST="../../../../arch/arm/dts/k3-am65-iot2050-spl"

Actually, this does NOT work: I just had a long morning debugging SPL which no longer started because it picked the non-filtered dtb. The filtered one ended up in a folder outside of the u-boot sources because of all those ../ and hard-wiring to dts/upstream.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

for our spl dtb.

Are there means to still build certain dtb[o] files in arch/<arch>/dts? I'm a bit lost in the Makefile forest.

Sumit: Any suggestions?

Apologies for the delayed reply. I was a bit busy with other high priority stuff.

Quoted 8 lines
Quoted 5 lines

I would really like to hear some better proposals than my local workarounds to far. They don't converge although I already patched some core Makefile (overlays are building now).

OK, I side-stepped the spl issue by using one of our variant DTBs for spl as well - happens to work.

That's good to know.

Quoted 34 lines

For the overlays, I need to add

scripts/Makefile.dts +2 -0
@@ -1,5 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 
+include $(srctree)/config.mk
+
 dtb-y += $(patsubst %,%.dtb,$(subst ",,$(CONFIG_DEFAULT_DEVICE_TREE) $(CONFIG_OF_LIST) $(CONFIG_SPL_OF_LIST)))
 
 ifeq ($(CONFIG_OF_UPSTREAM_BUILD_VENDOR),y)

in order to then be able to do

board/siemens/iot2050/config.mk +8 -0
@@ -5,4 +5,12 @@
 # Authors:
 #   Jan Kiszka <[email protected]>
 
+ifneq ($(CONFIG_SPL_BUILD),y)
+dtbo-list = \
+       k3-am6548-iot2050-advanced-m2-bkey-usb3-overlay \
+       k3-am6548-iot2050-advanced-m2-bkey-ekey-pcie-overlay
+
+dtb-y += $(patsubst %,../../../../arch/arm/dts/%.dtbo,$(dtbo-list))
+endif
+
 flash.bin: all
Quoted 9 lines
Quoted 1 line

Does that make sense?

A switch to OF_UPSTREAM means that we build all the DT artifacts from dts/upstream/src/ directory with the only exception that we include U-Boot specific overrides via *-u-boot.dtsi from arch/<arch>/dts. In case of overlays, is there any reason for IOT2050 board overlays not being pushed into Linux kernel repo? AFAIU, overlays are also describing puggable hardware so they shouldn't be referred to as "u-boot-only" overlays.

We are using the overlay to massage the DT presented to the OS based on firmware configuration. So, those two belong to the firmware logically, but - with some disclaimers, we could also try to upstream them.

Jan

Signature · 2 lines
Siemens AG, Technology
Linux Expert Center
#6 lore raw
Quoted 90 lines · Jan Kiszka
Quoted 78 lines · Sumit Garg

Hi,

Quoted 18 lines · Jan Kiszka
Quoted 16 lines · Jan Kiszka
Quoted 9 lines · Nishanth Menon
Quoted 8 lines · Jan Kiszka

Hi all,

I'm trying to migrate the TI AM65x IOT2050 boards to OF_UPSTREAM but I'm facing issues because I need to still build the u-boot-only overlays. It is also a bit weird (but works) having to specify

CONFIG_SPL_OF_LIST="../../../../arch/arm/dts/k3-am65-iot2050-spl"

Actually, this does NOT work: I just had a long morning debugging SPL which no longer started because it picked the non-filtered dtb. The filtered one ended up in a folder outside of the u-boot sources because of all those ../ and hard-wiring to dts/upstream.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

for our spl dtb.

Are there means to still build certain dtb[o] files in arch/<arch>/dts? I'm a bit lost in the Makefile forest.

Sumit: Any suggestions?

Apologies for the delayed reply. I was a bit busy with other high priority stuff.

Quoted 8 lines
Quoted 5 lines

I would really like to hear some better proposals than my local workarounds to far. They don't converge although I already patched some core Makefile (overlays are building now).

OK, I side-stepped the spl issue by using one of our variant DTBs for spl as well - happens to work.

That's good to know.

Quoted 34 lines

For the overlays, I need to add

scripts/Makefile.dts +2 -0
@@ -1,5 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 
+include $(srctree)/config.mk
+
 dtb-y += $(patsubst %,%.dtb,$(subst ",,$(CONFIG_DEFAULT_DEVICE_TREE) $(CONFIG_OF_LIST) $(CONFIG_SPL_OF_LIST)))
 
 ifeq ($(CONFIG_OF_UPSTREAM_BUILD_VENDOR),y)

in order to then be able to do

board/siemens/iot2050/config.mk +8 -0
@@ -5,4 +5,12 @@
 # Authors:
 #   Jan Kiszka <[email protected]>
 
+ifneq ($(CONFIG_SPL_BUILD),y)
+dtbo-list = \
+       k3-am6548-iot2050-advanced-m2-bkey-usb3-overlay \
+       k3-am6548-iot2050-advanced-m2-bkey-ekey-pcie-overlay
+
+dtb-y += $(patsubst %,../../../../arch/arm/dts/%.dtbo,$(dtbo-list))
+endif
+
 flash.bin: all
Quoted 9 lines
Quoted 1 line

Does that make sense?

A switch to OF_UPSTREAM means that we build all the DT artifacts from dts/upstream/src/ directory with the only exception that we include U-Boot specific overrides via *-u-boot.dtsi from arch/<arch>/dts. In case of overlays, is there any reason for IOT2050 board overlays not being pushed into Linux kernel repo? AFAIU, overlays are also describing puggable hardware so they shouldn't be referred to as "u-boot-only" overlays.

Quoted 2 lines

We are using the overlay to massage the DT presented to the OS based on firmware configuration.

Agree and more than that I prefer the firmware to own the overall DT and present that to the OS.

Quoted 2 lines

So, those two belong to the firmware logically,
but - with some disclaimers, we could also try to upstream them.

For historical reasons, Linux kernel source tree has become the defacto upstream repo for DT sources. So it's better to contribute there and sync back in U-Boot.

-Sumit

Quoted 7 lines

Jan

--
Siemens AG, Technology
Linux Expert Center

author
#7 lore raw
Quoted 97 lines · Sumit Garg
Quoted 90 lines · Jan Kiszka
Quoted 78 lines · Sumit Garg

Hi,

Quoted 18 lines · Jan Kiszka
Quoted 16 lines · Jan Kiszka
Quoted 9 lines · Nishanth Menon
Quoted 8 lines · Jan Kiszka

Hi all,

I'm trying to migrate the TI AM65x IOT2050 boards to OF_UPSTREAM but I'm facing issues because I need to still build the u-boot-only overlays. It is also a bit weird (but works) having to specify

CONFIG_SPL_OF_LIST="../../../../arch/arm/dts/k3-am65-iot2050-spl"

Actually, this does NOT work: I just had a long morning debugging SPL which no longer started because it picked the non-filtered dtb. The filtered one ended up in a folder outside of the u-boot sources because of all those ../ and hard-wiring to dts/upstream.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

for our spl dtb.

Are there means to still build certain dtb[o] files in arch/<arch>/dts? I'm a bit lost in the Makefile forest.

Sumit: Any suggestions?

Apologies for the delayed reply. I was a bit busy with other high priority stuff.

Quoted 8 lines
Quoted 5 lines

I would really like to hear some better proposals than my local workarounds to far. They don't converge although I already patched some core Makefile (overlays are building now).

OK, I side-stepped the spl issue by using one of our variant DTBs for spl as well - happens to work.

That's good to know.

Quoted 34 lines

For the overlays, I need to add

scripts/Makefile.dts +2 -0
@@ -1,5 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 
+include $(srctree)/config.mk
+
 dtb-y += $(patsubst %,%.dtb,$(subst ",,$(CONFIG_DEFAULT_DEVICE_TREE) $(CONFIG_OF_LIST) $(CONFIG_SPL_OF_LIST)))
 
 ifeq ($(CONFIG_OF_UPSTREAM_BUILD_VENDOR),y)

in order to then be able to do

board/siemens/iot2050/config.mk +8 -0
@@ -5,4 +5,12 @@
 # Authors:
 #   Jan Kiszka <[email protected]>
 
+ifneq ($(CONFIG_SPL_BUILD),y)
+dtbo-list = \
+       k3-am6548-iot2050-advanced-m2-bkey-usb3-overlay \
+       k3-am6548-iot2050-advanced-m2-bkey-ekey-pcie-overlay
+
+dtb-y += $(patsubst %,../../../../arch/arm/dts/%.dtbo,$(dtbo-list))
+endif
+
 flash.bin: all
Quoted 9 lines
Quoted 1 line

Does that make sense?

A switch to OF_UPSTREAM means that we build all the DT artifacts from dts/upstream/src/ directory with the only exception that we include U-Boot specific overrides via *-u-boot.dtsi from arch/<arch>/dts. In case of overlays, is there any reason for IOT2050 board overlays not being pushed into Linux kernel repo? AFAIU, overlays are also describing puggable hardware so they shouldn't be referred to as "u-boot-only" overlays.

Quoted 2 lines

We are using the overlay to massage the DT presented to the OS based on firmware configuration.

Agree and more than that I prefer the firmware to own the overall DT and present that to the OS.

Quoted 6 lines
Quoted 2 lines

So, those two belong to the firmware logically,
but - with some disclaimers, we could also try to upstream them.

For historical reasons, Linux kernel source tree has become the defacto upstream repo for DT sources. So it's better to contribute there and sync back in U-Boot.

Will do ASAP, hope to hit at least 6.12 then.

Still, this will delay our next patches for U-Boot by many months. Also for that reason, a plan B for U-Boot local DTs should remain, no left-or-right policy.

Jan

Signature · 2 lines
Siemens AG, Technology
Linux Expert Center
#8 lore raw
Quoted 106 lines · Jan Kiszka
Quoted 97 lines · Sumit Garg
Quoted 90 lines · Jan Kiszka
Quoted 78 lines · Sumit Garg

Hi,

Quoted 18 lines · Jan Kiszka
Quoted 16 lines · Jan Kiszka
Quoted 9 lines · Nishanth Menon
Quoted 8 lines · Jan Kiszka

Hi all,

I'm trying to migrate the TI AM65x IOT2050 boards to OF_UPSTREAM but I'm facing issues because I need to still build the u-boot-only overlays. It is also a bit weird (but works) having to specify

CONFIG_SPL_OF_LIST="../../../../arch/arm/dts/k3-am65-iot2050-spl"

Actually, this does NOT work: I just had a long morning debugging SPL which no longer started because it picked the non-filtered dtb. The filtered one ended up in a folder outside of the u-boot sources because of all those ../ and hard-wiring to dts/upstream.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

for our spl dtb.

Are there means to still build certain dtb[o] files in arch/<arch>/dts? I'm a bit lost in the Makefile forest.

Sumit: Any suggestions?

Apologies for the delayed reply. I was a bit busy with other high priority stuff.

Quoted 8 lines
Quoted 5 lines

I would really like to hear some better proposals than my local workarounds to far. They don't converge although I already patched some core Makefile (overlays are building now).

OK, I side-stepped the spl issue by using one of our variant DTBs for spl as well - happens to work.

That's good to know.

Quoted 34 lines

For the overlays, I need to add

scripts/Makefile.dts +2 -0
@@ -1,5 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 
+include $(srctree)/config.mk
+
 dtb-y += $(patsubst %,%.dtb,$(subst ",,$(CONFIG_DEFAULT_DEVICE_TREE) $(CONFIG_OF_LIST) $(CONFIG_SPL_OF_LIST)))
 
 ifeq ($(CONFIG_OF_UPSTREAM_BUILD_VENDOR),y)

in order to then be able to do

board/siemens/iot2050/config.mk +8 -0
@@ -5,4 +5,12 @@
 # Authors:
 #   Jan Kiszka <[email protected]>
 
+ifneq ($(CONFIG_SPL_BUILD),y)
+dtbo-list = \
+       k3-am6548-iot2050-advanced-m2-bkey-usb3-overlay \
+       k3-am6548-iot2050-advanced-m2-bkey-ekey-pcie-overlay
+
+dtb-y += $(patsubst %,../../../../arch/arm/dts/%.dtbo,$(dtbo-list))
+endif
+
 flash.bin: all
Quoted 9 lines
Quoted 1 line

Does that make sense?

A switch to OF_UPSTREAM means that we build all the DT artifacts from dts/upstream/src/ directory with the only exception that we include U-Boot specific overrides via *-u-boot.dtsi from arch/<arch>/dts. In case of overlays, is there any reason for IOT2050 board overlays not being pushed into Linux kernel repo? AFAIU, overlays are also describing puggable hardware so they shouldn't be referred to as "u-boot-only" overlays.

Quoted 2 lines

We are using the overlay to massage the DT presented to the OS based on firmware configuration.

Agree and more than that I prefer the firmware to own the overall DT and present that to the OS.

Quoted 6 lines
Quoted 2 lines

So, those two belong to the firmware logically,
but - with some disclaimers, we could also try to upstream them.

For historical reasons, Linux kernel source tree has become the defacto upstream repo for DT sources. So it's better to contribute there and sync back in U-Boot.

Quoted 5 lines

Will do ASAP, hope to hit at least 6.12 then.

Still, this will delay our next patches for U-Boot by many months. Also for that reason, a plan B for U-Boot local DTs should remain, no left-or-right policy.

Yeah, the U-Boot local DTs should be used until the board is fully supported by the dts/upstream directory.

-Sumit

Quoted 7 lines

Jan

--
Siemens AG, Technology
Linux Expert Center

author
#9 lore raw
Quoted 107 lines · Sumit Garg
Quoted 106 lines · Jan Kiszka
Quoted 103 lines · Sumit Garg
Quoted 90 lines · Jan Kiszka
Quoted 78 lines · Sumit Garg

Hi,

Quoted 18 lines · Jan Kiszka
Quoted 16 lines · Jan Kiszka
Quoted 9 lines · Nishanth Menon
Quoted 8 lines · Jan Kiszka

Hi all,

I'm trying to migrate the TI AM65x IOT2050 boards to OF_UPSTREAM but I'm facing issues because I need to still build the u-boot-only overlays. It is also a bit weird (but works) having to specify

CONFIG_SPL_OF_LIST="../../../../arch/arm/dts/k3-am65-iot2050-spl"

Actually, this does NOT work: I just had a long morning debugging SPL which no longer started because it picked the non-filtered dtb. The filtered one ended up in a folder outside of the u-boot sources because of all those ../ and hard-wiring to dts/upstream.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

for our spl dtb.

Are there means to still build certain dtb[o] files in arch/<arch>/dts? I'm a bit lost in the Makefile forest.

Sumit: Any suggestions?

Apologies for the delayed reply. I was a bit busy with other high priority stuff.

Quoted 8 lines
Quoted 5 lines

I would really like to hear some better proposals than my local workarounds to far. They don't converge although I already patched some core Makefile (overlays are building now).

OK, I side-stepped the spl issue by using one of our variant DTBs for spl as well - happens to work.

That's good to know.

Quoted 34 lines

For the overlays, I need to add

scripts/Makefile.dts +2 -0
@@ -1,5 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 
+include $(srctree)/config.mk
+
 dtb-y += $(patsubst %,%.dtb,$(subst ",,$(CONFIG_DEFAULT_DEVICE_TREE) $(CONFIG_OF_LIST) $(CONFIG_SPL_OF_LIST)))
 
 ifeq ($(CONFIG_OF_UPSTREAM_BUILD_VENDOR),y)

in order to then be able to do

board/siemens/iot2050/config.mk +8 -0
@@ -5,4 +5,12 @@
 # Authors:
 #   Jan Kiszka <[email protected]>
 
+ifneq ($(CONFIG_SPL_BUILD),y)
+dtbo-list = \
+       k3-am6548-iot2050-advanced-m2-bkey-usb3-overlay \
+       k3-am6548-iot2050-advanced-m2-bkey-ekey-pcie-overlay
+
+dtb-y += $(patsubst %,../../../../arch/arm/dts/%.dtbo,$(dtbo-list))
+endif
+
 flash.bin: all
Quoted 9 lines
Quoted 1 line

Does that make sense?

A switch to OF_UPSTREAM means that we build all the DT artifacts from dts/upstream/src/ directory with the only exception that we include U-Boot specific overrides via *-u-boot.dtsi from arch/<arch>/dts. In case of overlays, is there any reason for IOT2050 board overlays not being pushed into Linux kernel repo? AFAIU, overlays are also describing puggable hardware so they shouldn't be referred to as "u-boot-only" overlays.

Quoted 2 lines

We are using the overlay to massage the DT presented to the OS based on firmware configuration.

Agree and more than that I prefer the firmware to own the overall DT and present that to the OS.

Quoted 2 lines

So, those two belong to the firmware logically,
but - with some disclaimers, we could also try to upstream them.

For historical reasons, Linux kernel source tree has become the defacto upstream repo for DT sources. So it's better to contribute there and sync back in U-Boot.

Quoted 9 lines
Quoted 5 lines

Will do ASAP, hope to hit at least 6.12 then.

Still, this will delay our next patches for U-Boot by many months. Also for that reason, a plan B for U-Boot local DTs should remain, no left-or-right policy.

Yeah, the U-Boot local DTs should be used until the board is fully supported by the dts/upstream directory.

This is not what I mean and won't help: Given the longer pipeline, it should remain possible to carry also local changes after switching to OF_UPSTREAM and while waiting for upstreaming to be done - if ever. We are missing middle ground.

Jan

Signature · 2 lines
Siemens AG, Technology
Linux Expert Center
#10 lore raw
Quoted 115 lines · Jan Kiszka
Quoted 113 lines · Sumit Garg
Quoted 111 lines · Jan Kiszka
Quoted 97 lines · Sumit Garg
Quoted 90 lines · Jan Kiszka
Quoted 78 lines · Sumit Garg

Hi,

Quoted 18 lines · Jan Kiszka
Quoted 16 lines · Jan Kiszka
Quoted 9 lines · Nishanth Menon
Quoted 8 lines · Jan Kiszka

Hi all,

I'm trying to migrate the TI AM65x IOT2050 boards to OF_UPSTREAM but I'm facing issues because I need to still build the u-boot-only overlays. It is also a bit weird (but works) having to specify

CONFIG_SPL_OF_LIST="../../../../arch/arm/dts/k3-am65-iot2050-spl"

Actually, this does NOT work: I just had a long morning debugging SPL which no longer started because it picked the non-filtered dtb. The filtered one ended up in a folder outside of the u-boot sources because of all those ../ and hard-wiring to dts/upstream.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

for our spl dtb.

Are there means to still build certain dtb[o] files in arch/<arch>/dts? I'm a bit lost in the Makefile forest.

Sumit: Any suggestions?

Apologies for the delayed reply. I was a bit busy with other high priority stuff.

Quoted 8 lines
Quoted 5 lines

I would really like to hear some better proposals than my local workarounds to far. They don't converge although I already patched some core Makefile (overlays are building now).

OK, I side-stepped the spl issue by using one of our variant DTBs for spl as well - happens to work.

That's good to know.

Quoted 34 lines

For the overlays, I need to add

scripts/Makefile.dts +2 -0
@@ -1,5 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 
+include $(srctree)/config.mk
+
 dtb-y += $(patsubst %,%.dtb,$(subst ",,$(CONFIG_DEFAULT_DEVICE_TREE) $(CONFIG_OF_LIST) $(CONFIG_SPL_OF_LIST)))
 
 ifeq ($(CONFIG_OF_UPSTREAM_BUILD_VENDOR),y)

in order to then be able to do

board/siemens/iot2050/config.mk +8 -0
@@ -5,4 +5,12 @@
 # Authors:
 #   Jan Kiszka <[email protected]>
 
+ifneq ($(CONFIG_SPL_BUILD),y)
+dtbo-list = \
+       k3-am6548-iot2050-advanced-m2-bkey-usb3-overlay \
+       k3-am6548-iot2050-advanced-m2-bkey-ekey-pcie-overlay
+
+dtb-y += $(patsubst %,../../../../arch/arm/dts/%.dtbo,$(dtbo-list))
+endif
+
 flash.bin: all
Quoted 9 lines
Quoted 1 line

Does that make sense?

A switch to OF_UPSTREAM means that we build all the DT artifacts from dts/upstream/src/ directory with the only exception that we include U-Boot specific overrides via *-u-boot.dtsi from arch/<arch>/dts. In case of overlays, is there any reason for IOT2050 board overlays not being pushed into Linux kernel repo? AFAIU, overlays are also describing puggable hardware so they shouldn't be referred to as "u-boot-only" overlays.

Quoted 2 lines

We are using the overlay to massage the DT presented to the OS based on firmware configuration.

Agree and more than that I prefer the firmware to own the overall DT and present that to the OS.

Quoted 6 lines
Quoted 2 lines

So, those two belong to the firmware logically,
but - with some disclaimers, we could also try to upstream them.

For historical reasons, Linux kernel source tree has become the defacto upstream repo for DT sources. So it's better to contribute there and sync back in U-Boot.

Will do ASAP, hope to hit at least 6.12 then.

Still, this will delay our next patches for U-Boot by many months. Also for that reason, a plan B for U-Boot local DTs should remain, no left-or-right policy.

Quoted 8 lines
Quoted 3 lines

Yeah, the U-Boot local DTs should be used until the board is fully supported by the dts/upstream directory.

This is not what I mean and won't help: Given the longer pipeline, it should remain possible to carry also local changes after switching to OF_UPSTREAM and while waiting for upstreaming to be done - if ever. We are missing middle ground.

For local changes we already have the middle ground as *-u-boot.dtsi. Also, cherry-picking [1] from upstream rc* releases is pretty effective in shortening that pipeline. However, building DTB artifacts from multiple directories is going to make Makefiles messy and in turn will be difficult to be consumed by packaging tools like binman. Your Makefile change demonstrates it too. But if you can come up with a cleaner solution then I will be happy to review that.

[1] https://docs.u-boot.org/en/latest/develop/devicetree/control.html#resyncing-with-devicetree-rebasing

-Sumit

Quoted 7 lines

Jan

--
Siemens AG, Technology
Linux Expert Center

author
#11 lore raw
Quoted 133 lines · Sumit Garg
Quoted 115 lines · Jan Kiszka
Quoted 113 lines · Sumit Garg
Quoted 111 lines · Jan Kiszka
Quoted 97 lines · Sumit Garg
Quoted 90 lines · Jan Kiszka
Quoted 78 lines · Sumit Garg

Hi,

Quoted 18 lines · Jan Kiszka
Quoted 16 lines · Jan Kiszka
Quoted 9 lines · Nishanth Menon
Quoted 8 lines · Jan Kiszka

Hi all,

I'm trying to migrate the TI AM65x IOT2050 boards to OF_UPSTREAM but I'm facing issues because I need to still build the u-boot-only overlays. It is also a bit weird (but works) having to specify

CONFIG_SPL_OF_LIST="../../../../arch/arm/dts/k3-am65-iot2050-spl"

Actually, this does NOT work: I just had a long morning debugging SPL which no longer started because it picked the non-filtered dtb. The filtered one ended up in a folder outside of the u-boot sources because of all those ../ and hard-wiring to dts/upstream.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

for our spl dtb.

Are there means to still build certain dtb[o] files in arch/<arch>/dts? I'm a bit lost in the Makefile forest.

Sumit: Any suggestions?

Apologies for the delayed reply. I was a bit busy with other high priority stuff.

Quoted 8 lines
Quoted 5 lines

I would really like to hear some better proposals than my local workarounds to far. They don't converge although I already patched some core Makefile (overlays are building now).

OK, I side-stepped the spl issue by using one of our variant DTBs for spl as well - happens to work.

That's good to know.

Quoted 34 lines

For the overlays, I need to add

scripts/Makefile.dts +2 -0
@@ -1,5 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 
+include $(srctree)/config.mk
+
 dtb-y += $(patsubst %,%.dtb,$(subst ",,$(CONFIG_DEFAULT_DEVICE_TREE) $(CONFIG_OF_LIST) $(CONFIG_SPL_OF_LIST)))
 
 ifeq ($(CONFIG_OF_UPSTREAM_BUILD_VENDOR),y)

in order to then be able to do

board/siemens/iot2050/config.mk +8 -0
@@ -5,4 +5,12 @@
 # Authors:
 #   Jan Kiszka <[email protected]>
 
+ifneq ($(CONFIG_SPL_BUILD),y)
+dtbo-list = \
+       k3-am6548-iot2050-advanced-m2-bkey-usb3-overlay \
+       k3-am6548-iot2050-advanced-m2-bkey-ekey-pcie-overlay
+
+dtb-y += $(patsubst %,../../../../arch/arm/dts/%.dtbo,$(dtbo-list))
+endif
+
 flash.bin: all
Quoted 9 lines
Quoted 1 line

Does that make sense?

A switch to OF_UPSTREAM means that we build all the DT artifacts from dts/upstream/src/ directory with the only exception that we include U-Boot specific overrides via *-u-boot.dtsi from arch/<arch>/dts. In case of overlays, is there any reason for IOT2050 board overlays not being pushed into Linux kernel repo? AFAIU, overlays are also describing puggable hardware so they shouldn't be referred to as "u-boot-only" overlays.

Quoted 2 lines

We are using the overlay to massage the DT presented to the OS based on firmware configuration.

Agree and more than that I prefer the firmware to own the overall DT and present that to the OS.

Quoted 6 lines
Quoted 2 lines

So, those two belong to the firmware logically,
but - with some disclaimers, we could also try to upstream them.

For historical reasons, Linux kernel source tree has become the defacto upstream repo for DT sources. So it's better to contribute there and sync back in U-Boot.

Will do ASAP, hope to hit at least 6.12 then.

Still, this will delay our next patches for U-Boot by many months. Also for that reason, a plan B for U-Boot local DTs should remain, no left-or-right policy.

Quoted 8 lines
Quoted 3 lines

Yeah, the U-Boot local DTs should be used until the board is fully supported by the dts/upstream directory.

This is not what I mean and won't help: Given the longer pipeline, it should remain possible to carry also local changes after switching to OF_UPSTREAM and while waiting for upstreaming to be done - if ever. We are missing middle ground.

For local changes we already have the middle ground as *-u-boot.dtsi. Also, cherry-picking [1] from upstream rc* releases is pretty effective in shortening that pipeline. However, building DTB artifacts from multiple directories is going to make Makefiles messy and in turn will be difficult to be consumed by packaging tools like binman. Your Makefile change demonstrates it too. But if you can come up with a cleaner solution then I will be happy to review that.

Quoted 2 lines

[1] https://docs.u-boot.org/en/latest/develop/devicetree/control.html#resyncing-with-devicetree-rebasing

OK, our overlay sources are on their way into mainline, will only take until 6.12-rc1 to get them here. To accelerate the preparation, I ported that change to a local branch - just to find out that OF_UPSTREAM has no clue about DT overlays so far. And it is not just that there are no build rules for them (that was quickly fixed). It's also that there is no way to trigger their build for your u-boot proper.

Are there plans for addressing this? I'm inclined to revive my patch that allows to augment dtb-y from the board's config.mk. Better suggestions?

Jan

Signature · 2 lines
Siemens AG, Technology
Linux Expert Center
#12 lore raw
Quoted 11 lines

Gesendet: Mittwoch, 04. September 2024 um 19:16 Uhr
Von: "Jan Kiszka" <[email protected]>
OK, our overlay sources are on their way into mainline, will only take until 6.12-rc1 to get them here. To accelerate the preparation, I ported that change to a local branch - just to find out that OF_UPSTREAM has no clue about DT overlays so far. And it is not just that there are no build rules for them (that was quickly fixed). It's also that there is no way to trigger their build for your u-boot proper.

Quoted 2 lines

Are there plans for addressing this? I'm inclined to revive my patch that allows to augment dtb-y from the board's config.mk. Better suggestions?

Hi

i hang also on this part, in my case i build the dtbos for the vendor and try to use fdtoverlay to merge base-dt with the defined overlays.

see commits till July 11th

https://github.com/frank-w/u-boot/commits/2024-07-bpi-ofupstream-all/

this fails because the target for fdtoverlays needs targets for the dtbos (have used the fdtoverlay target from linux)... but i build then without dedicated target (while building the basedt).

maybe you can help solving the "small" problem in makefile.

regards Frank

Quoted 1 line

Jan

author
#13 lore raw
Quoted 18 lines · Frank Wunderlich
Quoted 11 lines

Gesendet: Mittwoch, 04. September 2024 um 19:16 Uhr
Von: "Jan Kiszka" <[email protected]>
OK, our overlay sources are on their way into mainline, will only take until 6.12-rc1 to get them here. To accelerate the preparation, I ported that change to a local branch - just to find out that OF_UPSTREAM has no clue about DT overlays so far. And it is not just that there are no build rules for them (that was quickly fixed). It's also that there is no way to trigger their build for your u-boot proper.

Quoted 2 lines

Are there plans for addressing this? I'm inclined to revive my patch that allows to augment dtb-y from the board's config.mk. Better suggestions?

Hi

i hang also on this part, in my case i build the dtbos for the vendor and try to use fdtoverlay to merge base-dt with the defined overlays.

Quoted 9 lines

see commits till July 11th

https://github.com/frank-w/u-boot/commits/2024-07-bpi-ofupstream-all/

this fails because the target for fdtoverlays needs targets for the dtbos (have used the fdtoverlay target from linux)... but i build then without dedicated target (while building the basedt).

maybe you can help solving the "small" problem in makefile.

This is close but not quite the same scenario because I only need "our" dtbos, and there is no need to create dtbs with them applied (they will be used during dt fixup in our case).

What I've now done is this:

dts/Kconfig +2 -2
index 569d4be338e..7ea4fd5a79b 100644
@@ -226,11 +226,11 @@ config OF_LIST
 
 config OF_OVERLAY_LIST
 	string "List of device tree overlays to include for DT control"
-	depends on SPL_LOAD_FIT_APPLY_OVERLAY
 	help
 	  This option specifies a list of device tree overlays to use for DT
 	  control. This option can then be used by a FIT generator to include
-	  the overlays in the FIT image.
+	  the overlays in the FIT image or by binman when assembling an image
+	  that uses overlays during DT fixup.
 
 choice
 	prompt "OF LIST compression"
scripts/Makefile.dts +1 -0
index 790f3c508f1..dc181240a21 100644
@@ -1,6 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 
 dtb-y += $(patsubst %,%.dtb,$(subst ",,$(CONFIG_DEFAULT_DEVICE_TREE) $(CONFIG_OF_LIST) $(CONFIG_SPL_OF_LIST)))
+dtb-y += $(patsubst %,%.dtbo,$(subst ",,$(CONFIG_OF_OVERLAY_LIST)))
 
 ifeq ($(CONFIG_OF_UPSTREAM_BUILD_VENDOR),y)
 ifeq ($(CONFIG_ARM64),y)

I will also provide a patch to enhance the machinery in dts/upstream /Makefile. This apparently plays no role when building U-Boot, but it would still be useful for validation purposes to have overlay support there.

Jan

Signature · 2 lines
Siemens AG, Technology
Linux Expert Center
#14 lore raw

Hi Jan,

Quoted 8 lines · Jan Kiszka
Quoted 6 lines · Frank Wunderlich
Quoted 6 lines

Gesendet: Mittwoch, 04. September 2024 um 19:16 Uhr
Von: "Jan Kiszka" <[email protected]>
OK, our overlay sources are on their way into mainline, will only take until 6.12-rc1 to get them here.

Glad to hear that.

Quoted 53 lines
Quoted 13 lines
Quoted 8 lines

To accelerate the preparation, I ported
that change to a local branch - just to find out that OF_UPSTREAM has no clue about DT overlays so far. And it is not just that there are no build rules for them (that was quickly fixed). It's also that there is no way to trigger their build for your u-boot proper.

Are there plans for addressing this? I'm inclined to revive my patch that allows to augment dtb-y from the board's config.mk. Better suggestions?

Hi

i hang also on this part, in my case i build the dtbos for the vendor and try to use fdtoverlay to merge base-dt with the defined overlays.

Quoted 9 lines

see commits till July 11th

https://github.com/frank-w/u-boot/commits/2024-07-bpi-ofupstream-all/

this fails because the target for fdtoverlays needs targets for the dtbos (have used the fdtoverlay target from linux)... but i build then without dedicated target (while building the basedt).

maybe you can help solving the "small" problem in makefile.

This is close but not quite the same scenario because I only need "our" dtbos, and there is no need to create dtbs with them applied (they will be used during dt fixup in our case).

What I've now done is this:

dts/Kconfig +2 -2
index 569d4be338e..7ea4fd5a79b 100644
@@ -226,11 +226,11 @@ config OF_LIST
 
 config OF_OVERLAY_LIST
        string "List of device tree overlays to include for DT control"
-       depends on SPL_LOAD_FIT_APPLY_OVERLAY
        help
          This option specifies a list of device tree overlays to use for DT
          control. This option can then be used by a FIT generator to include
-         the overlays in the FIT image.
+         the overlays in the FIT image or by binman when assembling an image
+         that uses overlays during DT fixup.
 
 choice
        prompt "OF LIST compression"
scripts/Makefile.dts +0 -0
index 790f3c508f1..dc181240a21 100644

scripts/Makefile.dts line 7

Quoted 7 lines
scripts/Makefile.dts +1 -0
@@ -1,6 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 
 dtb-y += $(patsubst %,%.dtb,$(subst ",,$(CONFIG_DEFAULT_DEVICE_TREE) $(CONFIG_OF_LIST) $(CONFIG_SPL_OF_LIST)))
+dtb-y += $(patsubst %,%.dtbo,$(subst ",,$(CONFIG_OF_OVERLAY_LIST)))
 
 ifeq ($(CONFIG_OF_UPSTREAM_BUILD_VENDOR),y)
 ifeq ($(CONFIG_ARM64),y)

Yeah that's all you need to build DT overlays from dts/upstream subtree. Care to send a proper patch for this?

Quoted 5 lines

I will also provide a patch to enhance the machinery in dts/upstream /Makefile. This apparently plays no role when building U-Boot, but it would still be useful for validation purposes to have overlay support there.

As you mentioned we don't use Makefile for U-Boot builds. So it's better to directly send that patch for inclusion in the DT rebasing tree.

-Sumit

Quoted 7 lines

Jan

--
Siemens AG, Technology
Linux Expert Center

author
#15 lore raw
Quoted 71 lines · Sumit Garg

Hi Jan,

Quoted 8 lines · Jan Kiszka
Quoted 6 lines · Frank Wunderlich
Quoted 6 lines

Gesendet: Mittwoch, 04. September 2024 um 19:16 Uhr
Von: "Jan Kiszka" <[email protected]>
OK, our overlay sources are on their way into mainline, will only take until 6.12-rc1 to get them here.

Glad to hear that.

Quoted 57 lines
Quoted 13 lines
Quoted 8 lines

To accelerate the preparation, I ported
that change to a local branch - just to find out that OF_UPSTREAM has no clue about DT overlays so far. And it is not just that there are no build rules for them (that was quickly fixed). It's also that there is no way to trigger their build for your u-boot proper.

Are there plans for addressing this? I'm inclined to revive my patch that allows to augment dtb-y from the board's config.mk. Better suggestions?

Hi

i hang also on this part, in my case i build the dtbos for the vendor and try to use fdtoverlay to merge base-dt with the defined overlays.

Quoted 9 lines

see commits till July 11th

https://github.com/frank-w/u-boot/commits/2024-07-bpi-ofupstream-all/

this fails because the target for fdtoverlays needs targets for the dtbos (have used the fdtoverlay target from linux)... but i build then without dedicated target (while building the basedt).

maybe you can help solving the "small" problem in makefile.

This is close but not quite the same scenario because I only need "our" dtbos, and there is no need to create dtbs with them applied (they will be used during dt fixup in our case).

What I've now done is this:

dts/Kconfig +2 -2
index 569d4be338e..7ea4fd5a79b 100644
@@ -226,11 +226,11 @@ config OF_LIST
 
 config OF_OVERLAY_LIST
        string "List of device tree overlays to include for DT control"
-       depends on SPL_LOAD_FIT_APPLY_OVERLAY
        help
          This option specifies a list of device tree overlays to use for DT
          control. This option can then be used by a FIT generator to include
-         the overlays in the FIT image.
+         the overlays in the FIT image or by binman when assembling an image
+         that uses overlays during DT fixup.
 
 choice
        prompt "OF LIST compression"
scripts/Makefile.dts +1 -0
index 790f3c508f1..dc181240a21 100644
@@ -1,6 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 
 dtb-y += $(patsubst %,%.dtb,$(subst ",,$(CONFIG_DEFAULT_DEVICE_TREE) $(CONFIG_OF_LIST) $(CONFIG_SPL_OF_LIST)))
+dtb-y += $(patsubst %,%.dtbo,$(subst ",,$(CONFIG_OF_OVERLAY_LIST)))
 
Quoted 7 lines

scripts/Makefile.dts line 7

Quoted 3 lines
scripts/Makefile.dts +0 -0
 ifeq ($(CONFIG_OF_UPSTREAM_BUILD_VENDOR),y)
 ifeq ($(CONFIG_ARM64),y)

Yeah that's all you need to build DT overlays from dts/upstream subtree. Care to send a proper patch for this?

Can do if you already want this [1]. Our tree [2] where it is currently included still has to wait for upstream 6.12, possibly even 6.13 as we need one more overlay now.

Quoted 9 lines
Quoted 5 lines

I will also provide a patch to enhance the machinery in dts/upstream /Makefile. This apparently plays no role when building U-Boot, but it would still be useful for validation purposes to have overlay support there.

As you mentioned we don't use Makefile for U-Boot builds. So it's better to directly send that patch for inclusion in the DT rebasing tree.

No, this is about our shadow Makefiles, see [3].

Jan

[1] https://github.com/siemens/u-boot/commit/2be0393b1718990abf2feb0b13dbaf79629ce692
[2] https://github.com/siemens/u-boot/commits/jan/iot2050
[3] https://github.com/siemens/u-boot/commit/de3df1fed47d2075bb3f9ecccfaa93a368b58924

Signature · 2 lines
Siemens AG, Technology
Linux Expert Center
#16 lore raw

Am 10. September 2024 14:08:07 MESZ schrieb Jan Kiszka <[email protected]>:

Quoted 35 lines · Sumit Garg
Quoted 34 lines

Hi Jan,

Quoted 8 lines · Jan Kiszka
Quoted 6 lines · Frank Wunderlich
Quoted 6 lines

Gesendet: Mittwoch, 04. September 2024 um 19:16 Uhr
Von: "Jan Kiszka" <[email protected]>
OK, our overlay sources are on their way into mainline, will only take until 6.12-rc1 to get them here.

Glad to hear that.

Quoted 20 lines
Quoted 20 lines
Quoted 8 lines

To accelerate the preparation, I ported
that change to a local branch - just to find out that OF_UPSTREAM has no clue about DT overlays so far. And it is not just that there are no build rules for them (that was quickly fixed). It's also that there is no way to trigger their build for your u-boot proper.

Are there plans for addressing this? I'm inclined to revive my patch that allows to augment dtb-y from the board's config.mk. Better suggestions?

Hi

i hang also on this part, in my case i build the dtbos for the vendor and try to use fdtoverlay to merge base-dt with the defined overlays.

see commits till July 11th

https://github.com/frank-w/u-boot/commits/2024-07-bpi-ofupstream-all/

this fails because the target for fdtoverlays needs targets for the dtbos (have used the fdtoverlay target from linux)... but i build then without dedicated target (while building the basedt).

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines

maybe you can help solving the "small" problem in makefile.

This is close but not quite the same scenario because I only need "our" dtbos, and there is no need to create dtbs with them applied (they will be used during dt fixup in our case).

Where do you apply the dtbos? In my case it is necessary to build the dtb with overlay as we have no way to detect which overlay needs to be applied.

We have overlays for different mmc (sdmmc/emmc)
and spi (nand/ nor) settings which cannot be probed at runtime (or at least we have not found a way to do this).

Maybe someone can help getting ftdoverlay target working in uboot with the dtbo list.

Quoted 52 lines
Quoted 30 lines
Quoted 30 lines

What I've now done is this:

dts/Kconfig +2 -2
index 569d4be338e..7ea4fd5a79b 100644
@@ -226,11 +226,11 @@ config OF_LIST
 
 config OF_OVERLAY_LIST
        string "List of device tree overlays to include for DT control"
-       depends on SPL_LOAD_FIT_APPLY_OVERLAY
        help
          This option specifies a list of device tree overlays to use for DT
          control. This option can then be used by a FIT generator to include
-         the overlays in the FIT image.
+         the overlays in the FIT image or by binman when assembling an image
+         that uses overlays during DT fixup.
 
 choice
        prompt "OF LIST compression"
scripts/Makefile.dts +1 -0
index 790f3c508f1..dc181240a21 100644
@@ -1,6 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 
 dtb-y += $(patsubst %,%.dtb,$(subst ",,$(CONFIG_DEFAULT_DEVICE_TREE) $(CONFIG_OF_LIST) $(CONFIG_SPL_OF_LIST)))
+dtb-y += $(patsubst %,%.dtbo,$(subst ",,$(CONFIG_OF_OVERLAY_LIST)))
 
Quoted 7 lines

scripts/Makefile.dts line 7

Quoted 3 lines
scripts/Makefile.dts +0 -0
 ifeq ($(CONFIG_OF_UPSTREAM_BUILD_VENDOR),y)
 ifeq ($(CONFIG_ARM64),y)

Yeah that's all you need to build DT overlays from dts/upstream subtree. Care to send a proper patch for this?

Can do if you already want this [1]. Our tree [2] where it is currently included still has to wait for upstream 6.12, possibly even 6.13 as we need one more overlay now.

Quoted 9 lines
Quoted 5 lines

I will also provide a patch to enhance the machinery in dts/upstream /Makefile. This apparently plays no role when building U-Boot, but it would still be useful for validation purposes to have overlay support there.

As you mentioned we don't use Makefile for U-Boot builds. So it's better to directly send that patch for inclusion in the DT rebasing tree.

Quoted 8 lines

No, this is about our shadow Makefiles, see [3].

Jan

[1] https://github.com/siemens/u-boot/commit/2be0393b1718990abf2feb0b13dbaf79629ce692
[2] https://github.com/siemens/u-boot/commits/jan/iot2050
[3] https://github.com/siemens/u-boot/commit/de3df1fed47d2075bb3f9ecccfaa93a368b58924

regards Frank

author
#17 lore raw
Quoted 39 lines · Frank Wunderlich

Am 10. September 2024 14:08:07 MESZ schrieb Jan Kiszka <[email protected]>:

Quoted 38 lines · Sumit Garg
Quoted 37 lines

Hi Jan,

Quoted 8 lines · Jan Kiszka
Quoted 6 lines · Frank Wunderlich
Quoted 6 lines

Gesendet: Mittwoch, 04. September 2024 um 19:16 Uhr
Von: "Jan Kiszka" <[email protected]>
OK, our overlay sources are on their way into mainline, will only take until 6.12-rc1 to get them here.

Glad to hear that.

Quoted 23 lines
Quoted 22 lines
Quoted 8 lines

To accelerate the preparation, I ported
that change to a local branch - just to find out that OF_UPSTREAM has no clue about DT overlays so far. And it is not just that there are no build rules for them (that was quickly fixed). It's also that there is no way to trigger their build for your u-boot proper.

Are there plans for addressing this? I'm inclined to revive my patch that allows to augment dtb-y from the board's config.mk. Better suggestions?

Hi

i hang also on this part, in my case i build the dtbos for the vendor and try to use fdtoverlay to merge base-dt with the defined overlays.

see commits till July 11th

https://github.com/frank-w/u-boot/commits/2024-07-bpi-ofupstream-all/

this fails because the target for fdtoverlays needs targets for the dtbos (have used the fdtoverlay target from linux)... but i build then without dedicated target (while building the basedt).

maybe you can help solving the "small" problem in makefile.

Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

This is close but not quite the same scenario because I only need "our" dtbos, and there is no need to create dtbs with them applied (they will be used during dt fixup in our case).

Where do you apply the dtbos? In my case it is necessary to build the dtb with overlay as we have no way to detect which overlay needs to be applied.

In our case, during ft_board_setup, thus dynamically:

https://source.denx.de/u-boot/u-boot/-/blob/7b2d4ecd7f6593771dd3118c8bab525d727a91e0/board/siemens/iot2050/board.c#L474

Quoted 7 lines

We have overlays for different mmc (sdmmc/emmc)
and spi (nand/ nor) settings which cannot be probed at runtime (or at least we have not found a way to do this).

Maybe someone can help getting ftdoverlay target working in uboot with the dtbo list.

Yeah, that would be another path that requires additional work. Sorry, I'm not familiar with those details myself.

Jan

Signature · 2 lines
Siemens AG, Technology
Linux Expert Center
#18 lore raw
In reply to Sumit Garg

Hi Sumit,

Quoted 78 lines · Sumit Garg

Hi,

Quoted 18 lines · Jan Kiszka
Quoted 16 lines · Jan Kiszka
Quoted 9 lines · Nishanth Menon
Quoted 8 lines · Jan Kiszka

Hi all,

I'm trying to migrate the TI AM65x IOT2050 boards to OF_UPSTREAM but I'm facing issues because I need to still build the u-boot-only overlays. It is also a bit weird (but works) having to specify

CONFIG_SPL_OF_LIST="../../../../arch/arm/dts/k3-am65-iot2050-spl"

Actually, this does NOT work: I just had a long morning debugging SPL which no longer started because it picked the non-filtered dtb. The filtered one ended up in a folder outside of the u-boot sources because of all those ../ and hard-wiring to dts/upstream.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

for our spl dtb.

Are there means to still build certain dtb[o] files in arch/<arch>/dts? I'm a bit lost in the Makefile forest.

Sumit: Any suggestions?

Apologies for the delayed reply. I was a bit busy with other high priority stuff.

Quoted 8 lines
Quoted 5 lines

I would really like to hear some better proposals than my local workarounds to far. They don't converge although I already patched some core Makefile (overlays are building now).

OK, I side-stepped the spl issue by using one of our variant DTBs for spl as well - happens to work.

That's good to know.

Quoted 34 lines

For the overlays, I need to add

scripts/Makefile.dts +2 -0
@@ -1,5 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 
+include $(srctree)/config.mk
+
 dtb-y += $(patsubst %,%.dtb,$(subst ",,$(CONFIG_DEFAULT_DEVICE_TREE) $(CONFIG_OF_LIST) $(CONFIG_SPL_OF_LIST)))
 
 ifeq ($(CONFIG_OF_UPSTREAM_BUILD_VENDOR),y)

in order to then be able to do

board/siemens/iot2050/config.mk +8 -0
@@ -5,4 +5,12 @@
 # Authors:
 #   Jan Kiszka <[email protected]>
 
+ifneq ($(CONFIG_SPL_BUILD),y)
+dtbo-list = \
+       k3-am6548-iot2050-advanced-m2-bkey-usb3-overlay \
+       k3-am6548-iot2050-advanced-m2-bkey-ekey-pcie-overlay
+
+dtb-y += $(patsubst %,../../../../arch/arm/dts/%.dtbo,$(dtbo-list))
+endif
+
 flash.bin: all
Quoted 9 lines
Quoted 1 line

Does that make sense?

A switch to OF_UPSTREAM means that we build all the DT artifacts from dts/upstream/src/ directory with the only exception that we include U-Boot specific overrides via *-u-boot.dtsi from arch/<arch>/dts. In case of overlays, is there any reason for IOT2050 board overlays not being pushed into Linux kernel repo? AFAIU, overlays are also describing puggable hardware so they shouldn't be referred to as "u-boot-only" overlays.

I have a related issue where I would like to build board DT from dts/upstream, however there is also a need for a limited U-Boot specific DT that only is intended for initial boot so that U-Boot at runtime can determine what hw revision is booting and select correct DT to use for U-Boot proper and OS.

For now I have just set the board target to use OF_UPSTREAM=n and instead created minimal .dts-files in arch/<arch>/dts that include the full .dts-file from dts/upstream.

Any suggestion on how we better can support having a U-Boot only .dts-file together with OF_UPSTREAM=y ?

Please see following for more details:
https://source.denx.de/u-boot/u-boot/-/commit/a52099b4a2ae9e8cafc79268325249bcad308012
https://source.denx.de/u-boot/u-boot/-/blob/master/arch/arm/dts/rk3566-orangepi-3b.dts
https://source.denx.de/u-boot/u-boot/-/blob/master/arch/arm/dts/rk3566-orangepi-3b-v1.1.dts
https://source.denx.de/u-boot/u-boot/-/blob/master/arch/arm/dts/rk3566-orangepi-3b-v2.1.dts

Regards,
Jonas

Quoted 10 lines

-Sumit

Quoted 7 lines

Jan

--
Siemens AG, Technology
Linux Expert Center

A message that is not in the archive (sent off-list or not yet received): [email protected]

#20 lore raw

Hi Jonas,

Quoted 98 lines · Jonas Karlman

Hi Sumit,

Quoted 78 lines · Sumit Garg

Hi,

Quoted 18 lines · Jan Kiszka
Quoted 16 lines · Jan Kiszka
Quoted 9 lines · Nishanth Menon
Quoted 8 lines · Jan Kiszka

Hi all,

I'm trying to migrate the TI AM65x IOT2050 boards to OF_UPSTREAM but I'm facing issues because I need to still build the u-boot-only overlays. It is also a bit weird (but works) having to specify

CONFIG_SPL_OF_LIST="../../../../arch/arm/dts/k3-am65-iot2050-spl"

Actually, this does NOT work: I just had a long morning debugging SPL which no longer started because it picked the non-filtered dtb. The filtered one ended up in a folder outside of the u-boot sources because of all those ../ and hard-wiring to dts/upstream.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

for our spl dtb.

Are there means to still build certain dtb[o] files in arch/<arch>/dts? I'm a bit lost in the Makefile forest.

Sumit: Any suggestions?

Apologies for the delayed reply. I was a bit busy with other high priority stuff.

Quoted 8 lines
Quoted 5 lines

I would really like to hear some better proposals than my local workarounds to far. They don't converge although I already patched some core Makefile (overlays are building now).

OK, I side-stepped the spl issue by using one of our variant DTBs for spl as well - happens to work.

That's good to know.

Quoted 34 lines

For the overlays, I need to add

scripts/Makefile.dts +2 -0
@@ -1,5 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 
+include $(srctree)/config.mk
+
 dtb-y += $(patsubst %,%.dtb,$(subst ",,$(CONFIG_DEFAULT_DEVICE_TREE) $(CONFIG_OF_LIST) $(CONFIG_SPL_OF_LIST)))
 
 ifeq ($(CONFIG_OF_UPSTREAM_BUILD_VENDOR),y)

in order to then be able to do

board/siemens/iot2050/config.mk +8 -0
@@ -5,4 +5,12 @@
 # Authors:
 #   Jan Kiszka <[email protected]>
 
+ifneq ($(CONFIG_SPL_BUILD),y)
+dtbo-list = \
+       k3-am6548-iot2050-advanced-m2-bkey-usb3-overlay \
+       k3-am6548-iot2050-advanced-m2-bkey-ekey-pcie-overlay
+
+dtb-y += $(patsubst %,../../../../arch/arm/dts/%.dtbo,$(dtbo-list))
+endif
+
 flash.bin: all
Quoted 9 lines
Quoted 1 line

Does that make sense?

A switch to OF_UPSTREAM means that we build all the DT artifacts from dts/upstream/src/ directory with the only exception that we include U-Boot specific overrides via *-u-boot.dtsi from arch/<arch>/dts. In case of overlays, is there any reason for IOT2050 board overlays not being pushed into Linux kernel repo? AFAIU, overlays are also describing puggable hardware so they shouldn't be referred to as "u-boot-only" overlays.

I have a related issue where I would like to build board DT from dts/upstream, however there is also a need for a limited U-Boot specific DT that only is intended for initial boot so that U-Boot at runtime can determine what hw revision is booting and select correct DT to use for U-Boot proper and OS.

Quoted 6 lines

For now I have just set the board target to use OF_UPSTREAM=n and instead created minimal .dts-files in arch/<arch>/dts that include the full .dts-file from dts/upstream.

Any suggestion on how we better can support having a U-Boot only .dts-file together with OF_UPSTREAM=y ?

The motivation is rather to avoid any U-Boot specific DT files. Shouldn't you be able to create a DT overlay of v2.1 board over v1.1 and push that upstream? The runtime DT choice sounds pretty similar to how you can choose to apply the DT overlay or not with common boot DT. Also, bundling multiple DT within U-Boot proper FIT image can be an alternative too.

-Sumit

Quoted 21 lines

Please see following for more details:
https://source.denx.de/u-boot/u-boot/-/commit/a52099b4a2ae9e8cafc79268325249bcad308012
https://source.denx.de/u-boot/u-boot/-/blob/master/arch/arm/dts/rk3566-orangepi-3b.dts
https://source.denx.de/u-boot/u-boot/-/blob/master/arch/arm/dts/rk3566-orangepi-3b-v1.1.dts
https://source.denx.de/u-boot/u-boot/-/blob/master/arch/arm/dts/rk3566-orangepi-3b-v2.1.dts

Regards,
Jonas

Quoted 10 lines

-Sumit

Quoted 7 lines

Jan

--
Siemens AG, Technology
Linux Expert Center

#21 lore raw

Hi Sumit,

Quoted 108 lines · Sumit Garg

Hi Jonas,

Quoted 98 lines · Jonas Karlman

Hi Sumit,

Quoted 78 lines · Sumit Garg

Hi,

Quoted 18 lines · Jan Kiszka
Quoted 16 lines · Jan Kiszka
Quoted 9 lines · Nishanth Menon
Quoted 8 lines · Jan Kiszka

Hi all,

I'm trying to migrate the TI AM65x IOT2050 boards to OF_UPSTREAM but I'm facing issues because I need to still build the u-boot-only overlays. It is also a bit weird (but works) having to specify

CONFIG_SPL_OF_LIST="../../../../arch/arm/dts/k3-am65-iot2050-spl"

Actually, this does NOT work: I just had a long morning debugging SPL which no longer started because it picked the non-filtered dtb. The filtered one ended up in a folder outside of the u-boot sources because of all those ../ and hard-wiring to dts/upstream.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

for our spl dtb.

Are there means to still build certain dtb[o] files in arch/<arch>/dts? I'm a bit lost in the Makefile forest.

Sumit: Any suggestions?

Apologies for the delayed reply. I was a bit busy with other high priority stuff.

Quoted 8 lines
Quoted 5 lines

I would really like to hear some better proposals than my local workarounds to far. They don't converge although I already patched some core Makefile (overlays are building now).

OK, I side-stepped the spl issue by using one of our variant DTBs for spl as well - happens to work.

That's good to know.

Quoted 34 lines

For the overlays, I need to add

scripts/Makefile.dts +2 -0
@@ -1,5 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 
+include $(srctree)/config.mk
+
 dtb-y += $(patsubst %,%.dtb,$(subst ",,$(CONFIG_DEFAULT_DEVICE_TREE) $(CONFIG_OF_LIST) $(CONFIG_SPL_OF_LIST)))
 
 ifeq ($(CONFIG_OF_UPSTREAM_BUILD_VENDOR),y)

in order to then be able to do

board/siemens/iot2050/config.mk +8 -0
@@ -5,4 +5,12 @@
 # Authors:
 #   Jan Kiszka <[email protected]>
 
+ifneq ($(CONFIG_SPL_BUILD),y)
+dtbo-list = \
+       k3-am6548-iot2050-advanced-m2-bkey-usb3-overlay \
+       k3-am6548-iot2050-advanced-m2-bkey-ekey-pcie-overlay
+
+dtb-y += $(patsubst %,../../../../arch/arm/dts/%.dtbo,$(dtbo-list))
+endif
+
 flash.bin: all
Quoted 9 lines
Quoted 1 line

Does that make sense?

A switch to OF_UPSTREAM means that we build all the DT artifacts from dts/upstream/src/ directory with the only exception that we include U-Boot specific overrides via *-u-boot.dtsi from arch/<arch>/dts. In case of overlays, is there any reason for IOT2050 board overlays not being pushed into Linux kernel repo? AFAIU, overlays are also describing puggable hardware so they shouldn't be referred to as "u-boot-only" overlays.

I have a related issue where I would like to build board DT from dts/upstream, however there is also a need for a limited U-Boot specific DT that only is intended for initial boot so that U-Boot at runtime can determine what hw revision is booting and select correct DT to use for U-Boot proper and OS.

Quoted 6 lines

For now I have just set the board target to use OF_UPSTREAM=n and instead created minimal .dts-files in arch/<arch>/dts that include the full .dts-file from dts/upstream.

Any suggestion on how we better can support having a U-Boot only .dts-file together with OF_UPSTREAM=y ?

Quoted 6 lines

The motivation is rather to avoid any U-Boot specific DT files. Shouldn't you be able to create a DT overlay of v2.1 board over v1.1 and push that upstream? The runtime DT choice sounds pretty similar to how you can choose to apply the DT overlay or not with common boot DT. Also, bundling multiple DT within U-Boot proper FIT image can be an alternative too.

Both rk3566-orangepi-3b-v1.1.dts and rk3566-orangepi-3b-v2.1.dts are in/from upstream Linux, and they are both included in the same FIT along with the default U-Boot specific DT (rk3566-orangepi-3b.dtb):

CONFIG_OF_LIST="rk3566-orangepi-3b rk3566-orangepi-3b-v1.1 rk3566-orangepi-3b-v2.1"

Default Configuration: 'config-1'
Configuration 0 (config-1)

  Description:  rk3566-orangepi-3b.dtb
  Kernel:       unavailable
  Firmware:     atf-1
  FDT:          fdt-1
  Loadables:    u-boot
                atf-2
                atf-3
                atf-4
                atf-5
                atf-6
 Configuration 1 (config-2)
  Description:  rk3566-orangepi-3b-v1.1.dtb
  Kernel:       unavailable
  Firmware:     atf-1
  FDT:          fdt-2
  Loadables:    u-boot
                atf-2
                atf-3
                atf-4
                atf-5
                atf-6
 Configuration 2 (config-3)
  Description:  rk3566-orangepi-3b-v2.1.dtb
  Kernel:       unavailable
  Firmware:     atf-1
  FDT:          fdt-3
  Loadables:    u-boot
                atf-2
                atf-3
                atf-4
                atf-5
                atf-6

Main reason why a U-Boot specific DT is used is because the hw revisions use different voltage for Ethernet PHY, and we want to avoid causing damage to a board when runtime cannot determine what hw revision is running, and thus we use a safe U-Boot specific DT.

I do not see any reason to try and upstream this u-boot only DT to Linux, since it's only purpose is to assist boot firmware to select correct DT.

Regards,
Jonas

Quoted 24 lines

-Sumit

Quoted 21 lines

Please see following for more details:
https://source.denx.de/u-boot/u-boot/-/commit/a52099b4a2ae9e8cafc79268325249bcad308012
https://source.denx.de/u-boot/u-boot/-/blob/master/arch/arm/dts/rk3566-orangepi-3b.dts
https://source.denx.de/u-boot/u-boot/-/blob/master/arch/arm/dts/rk3566-orangepi-3b-v1.1.dts
https://source.denx.de/u-boot/u-boot/-/blob/master/arch/arm/dts/rk3566-orangepi-3b-v2.1.dts

Regards,
Jonas

Quoted 10 lines

-Sumit

Quoted 7 lines

Jan

--
Siemens AG, Technology
Linux Expert Center

A message that is not in the archive (sent off-list or not yet received): [email protected]

#23 lore raw
Quoted 160 lines · Jonas Karlman

Hi Sumit,

Quoted 108 lines · Sumit Garg

Hi Jonas,

Quoted 98 lines · Jonas Karlman

Hi Sumit,

Quoted 78 lines · Sumit Garg

Hi,

Quoted 18 lines · Jan Kiszka
Quoted 16 lines · Jan Kiszka
Quoted 9 lines · Nishanth Menon
Quoted 8 lines · Jan Kiszka

Hi all,

I'm trying to migrate the TI AM65x IOT2050 boards to OF_UPSTREAM but I'm facing issues because I need to still build the u-boot-only overlays. It is also a bit weird (but works) having to specify

CONFIG_SPL_OF_LIST="../../../../arch/arm/dts/k3-am65-iot2050-spl"

Actually, this does NOT work: I just had a long morning debugging SPL which no longer started because it picked the non-filtered dtb. The filtered one ended up in a folder outside of the u-boot sources because of all those ../ and hard-wiring to dts/upstream.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

for our spl dtb.

Are there means to still build certain dtb[o] files in arch/<arch>/dts? I'm a bit lost in the Makefile forest.

Sumit: Any suggestions?

Apologies for the delayed reply. I was a bit busy with other high priority stuff.

Quoted 8 lines
Quoted 5 lines

I would really like to hear some better proposals than my local workarounds to far. They don't converge although I already patched some core Makefile (overlays are building now).

OK, I side-stepped the spl issue by using one of our variant DTBs for spl as well - happens to work.

That's good to know.

Quoted 34 lines

For the overlays, I need to add

scripts/Makefile.dts +2 -0
@@ -1,5 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 
+include $(srctree)/config.mk
+
 dtb-y += $(patsubst %,%.dtb,$(subst ",,$(CONFIG_DEFAULT_DEVICE_TREE) $(CONFIG_OF_LIST) $(CONFIG_SPL_OF_LIST)))
 
 ifeq ($(CONFIG_OF_UPSTREAM_BUILD_VENDOR),y)

in order to then be able to do

board/siemens/iot2050/config.mk +8 -0
@@ -5,4 +5,12 @@
 # Authors:
 #   Jan Kiszka <[email protected]>
 
+ifneq ($(CONFIG_SPL_BUILD),y)
+dtbo-list = \
+       k3-am6548-iot2050-advanced-m2-bkey-usb3-overlay \
+       k3-am6548-iot2050-advanced-m2-bkey-ekey-pcie-overlay
+
+dtb-y += $(patsubst %,../../../../arch/arm/dts/%.dtbo,$(dtbo-list))
+endif
+
 flash.bin: all
Quoted 9 lines
Quoted 1 line

Does that make sense?

A switch to OF_UPSTREAM means that we build all the DT artifacts from dts/upstream/src/ directory with the only exception that we include U-Boot specific overrides via *-u-boot.dtsi from arch/<arch>/dts. In case of overlays, is there any reason for IOT2050 board overlays not being pushed into Linux kernel repo? AFAIU, overlays are also describing puggable hardware so they shouldn't be referred to as "u-boot-only" overlays.

I have a related issue where I would like to build board DT from dts/upstream, however there is also a need for a limited U-Boot specific DT that only is intended for initial boot so that U-Boot at runtime can determine what hw revision is booting and select correct DT to use for U-Boot proper and OS.

Quoted 6 lines

For now I have just set the board target to use OF_UPSTREAM=n and instead created minimal .dts-files in arch/<arch>/dts that include the full .dts-file from dts/upstream.

Any suggestion on how we better can support having a U-Boot only .dts-file together with OF_UPSTREAM=y ?

Quoted 6 lines

The motivation is rather to avoid any U-Boot specific DT files. Shouldn't you be able to create a DT overlay of v2.1 board over v1.1 and push that upstream? The runtime DT choice sounds pretty similar to how you can choose to apply the DT overlay or not with common boot DT. Also, bundling multiple DT within U-Boot proper FIT image can be an alternative too.

Both rk3566-orangepi-3b-v1.1.dts and rk3566-orangepi-3b-v2.1.dts are in/from upstream Linux, and they are both included in the same FIT along with the default U-Boot specific DT (rk3566-orangepi-3b.dtb):

CONFIG_OF_LIST="rk3566-orangepi-3b rk3566-orangepi-3b-v1.1 rk3566-orangepi-3b-v2.1"

Default Configuration: 'config-1'
Configuration 0 (config-1)

  Description:  rk3566-orangepi-3b.dtb
  Kernel:       unavailable
  Firmware:     atf-1
  FDT:          fdt-1
  Loadables:    u-boot
                atf-2
                atf-3
                atf-4
                atf-5
                atf-6
 Configuration 1 (config-2)
  Description:  rk3566-orangepi-3b-v1.1.dtb
  Kernel:       unavailable
  Firmware:     atf-1
  FDT:          fdt-2
  Loadables:    u-boot
                atf-2
                atf-3
                atf-4
                atf-5
                atf-6
 Configuration 2 (config-3)
  Description:  rk3566-orangepi-3b-v2.1.dtb
  Kernel:       unavailable
  Firmware:     atf-1
  FDT:          fdt-3
  Loadables:    u-boot
                atf-2
                atf-3
                atf-4
                atf-5
                atf-6
Quoted 4 lines

Main reason why a U-Boot specific DT is used is because the hw revisions use different voltage for Ethernet PHY, and we want to avoid causing damage to a board when runtime cannot determine what hw revision is running, and thus we use a safe U-Boot specific DT.

Okay so the runtime check for hw revision isn't stable. If that's the case then I am unsure if we should enable it at all. IIUC in case a fallback to safe U-Boot DT is made then the ethernet won't be functional. I would rather favour separate U-Boot images for each board with corresponding DT to provide a fully functional system.

Quoted 3 lines

I do not see any reason to try and upstream this u-boot only DT to Linux, since it's only purpose is to assist boot firmware to select correct DT.

I suppose similar functionality would be needed if any other bootloader/firmware has to be enabled for these boards. So we can't say it's particularly specific to U-Boot but it is rather a dowsized DT which can boot on both boards with ethernet non-functional. You can also rather have a single downsized DT supported upstream with 2 overlays one for each board which can be applied on successful detection of hw revision.

-Sumit

Quoted 29 lines

Regards,
Jonas

Quoted 24 lines

-Sumit

Quoted 21 lines

Please see following for more details:
https://source.denx.de/u-boot/u-boot/-/commit/a52099b4a2ae9e8cafc79268325249bcad308012
https://source.denx.de/u-boot/u-boot/-/blob/master/arch/arm/dts/rk3566-orangepi-3b.dts
https://source.denx.de/u-boot/u-boot/-/blob/master/arch/arm/dts/rk3566-orangepi-3b-v1.1.dts
https://source.denx.de/u-boot/u-boot/-/blob/master/arch/arm/dts/rk3566-orangepi-3b-v2.1.dts

Regards,
Jonas

Quoted 10 lines

-Sumit

Quoted 7 lines

Jan

--
Siemens AG, Technology
Linux Expert Center

#24 lore raw

Hi Sumit,

Quoted 166 lines · Sumit Garg
Quoted 160 lines · Jonas Karlman

Hi Sumit,

Quoted 108 lines · Sumit Garg

Hi Jonas,

Quoted 98 lines · Jonas Karlman

Hi Sumit,

Quoted 78 lines · Sumit Garg

Hi,

Quoted 18 lines · Jan Kiszka
Quoted 16 lines · Jan Kiszka
Quoted 9 lines · Nishanth Menon
Quoted 8 lines · Jan Kiszka

Hi all,

I'm trying to migrate the TI AM65x IOT2050 boards to OF_UPSTREAM but I'm facing issues because I need to still build the u-boot-only overlays. It is also a bit weird (but works) having to specify

CONFIG_SPL_OF_LIST="../../../../arch/arm/dts/k3-am65-iot2050-spl"

Actually, this does NOT work: I just had a long morning debugging SPL which no longer started because it picked the non-filtered dtb. The filtered one ended up in a folder outside of the u-boot sources because of all those ../ and hard-wiring to dts/upstream.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

for our spl dtb.

Are there means to still build certain dtb[o] files in arch/<arch>/dts? I'm a bit lost in the Makefile forest.

Sumit: Any suggestions?

Apologies for the delayed reply. I was a bit busy with other high priority stuff.

Quoted 8 lines
Quoted 5 lines

I would really like to hear some better proposals than my local workarounds to far. They don't converge although I already patched some core Makefile (overlays are building now).

OK, I side-stepped the spl issue by using one of our variant DTBs for spl as well - happens to work.

That's good to know.

Quoted 34 lines

For the overlays, I need to add

scripts/Makefile.dts +2 -0
@@ -1,5 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 
+include $(srctree)/config.mk
+
 dtb-y += $(patsubst %,%.dtb,$(subst ",,$(CONFIG_DEFAULT_DEVICE_TREE) $(CONFIG_OF_LIST) $(CONFIG_SPL_OF_LIST)))
 
 ifeq ($(CONFIG_OF_UPSTREAM_BUILD_VENDOR),y)

in order to then be able to do

board/siemens/iot2050/config.mk +8 -0
@@ -5,4 +5,12 @@
 # Authors:
 #   Jan Kiszka <[email protected]>
 
+ifneq ($(CONFIG_SPL_BUILD),y)
+dtbo-list = \
+       k3-am6548-iot2050-advanced-m2-bkey-usb3-overlay \
+       k3-am6548-iot2050-advanced-m2-bkey-ekey-pcie-overlay
+
+dtb-y += $(patsubst %,../../../../arch/arm/dts/%.dtbo,$(dtbo-list))
+endif
+
 flash.bin: all
Quoted 9 lines
Quoted 1 line

Does that make sense?

A switch to OF_UPSTREAM means that we build all the DT artifacts from dts/upstream/src/ directory with the only exception that we include U-Boot specific overrides via *-u-boot.dtsi from arch/<arch>/dts. In case of overlays, is there any reason for IOT2050 board overlays not being pushed into Linux kernel repo? AFAIU, overlays are also describing puggable hardware so they shouldn't be referred to as "u-boot-only" overlays.

I have a related issue where I would like to build board DT from dts/upstream, however there is also a need for a limited U-Boot specific DT that only is intended for initial boot so that U-Boot at runtime can determine what hw revision is booting and select correct DT to use for U-Boot proper and OS.

Quoted 6 lines

For now I have just set the board target to use OF_UPSTREAM=n and instead created minimal .dts-files in arch/<arch>/dts that include the full .dts-file from dts/upstream.

Any suggestion on how we better can support having a U-Boot only .dts-file together with OF_UPSTREAM=y ?

Quoted 6 lines

The motivation is rather to avoid any U-Boot specific DT files. Shouldn't you be able to create a DT overlay of v2.1 board over v1.1 and push that upstream? The runtime DT choice sounds pretty similar to how you can choose to apply the DT overlay or not with common boot DT. Also, bundling multiple DT within U-Boot proper FIT image can be an alternative too.

Both rk3566-orangepi-3b-v1.1.dts and rk3566-orangepi-3b-v2.1.dts are in/from upstream Linux, and they are both included in the same FIT along with the default U-Boot specific DT (rk3566-orangepi-3b.dtb):

CONFIG_OF_LIST="rk3566-orangepi-3b rk3566-orangepi-3b-v1.1 rk3566-orangepi-3b-v2.1"

Default Configuration: 'config-1'
Configuration 0 (config-1)

  Description:  rk3566-orangepi-3b.dtb
  Kernel:       unavailable
  Firmware:     atf-1
  FDT:          fdt-1
  Loadables:    u-boot
                atf-2
                atf-3
                atf-4
                atf-5
                atf-6
 Configuration 1 (config-2)
  Description:  rk3566-orangepi-3b-v1.1.dtb
  Kernel:       unavailable
  Firmware:     atf-1
  FDT:          fdt-2
  Loadables:    u-boot
                atf-2
                atf-3
                atf-4
                atf-5
                atf-6
 Configuration 2 (config-3)
  Description:  rk3566-orangepi-3b-v2.1.dtb
  Kernel:       unavailable
  Firmware:     atf-1
  FDT:          fdt-3
  Loadables:    u-boot
                atf-2
                atf-3
                atf-4
                atf-5
                atf-6
Quoted 4 lines

Main reason why a U-Boot specific DT is used is because the hw revisions use different voltage for Ethernet PHY, and we want to avoid causing damage to a board when runtime cannot determine what hw revision is running, and thus we use a safe U-Boot specific DT.

Quoted 5 lines

Okay so the runtime check for hw revision isn't stable. If that's the case then I am unsure if we should enable it at all. IIUC in case a fallback to safe U-Boot DT is made then the ethernet won't be functional. I would rather favour separate U-Boot images for each board with corresponding DT to provide a fully functional system.

The runtime check is stable, at least for current hw revisions, however the vendor is known to make minor revision changes. End-users may change Kconfig options or future U-Boot changes may break the runtime detection.

Also there is history that wrong U-Boot vendor image has been used by end-users and that has resulted in damage to Ethernet, so for mainline I specifically wanted to avoid such issue by using a single U-Boot target and play it safe if the runtime detection for whatever reason is not fully working.

Quoted 5 lines
Quoted 4 lines

I do not see any reason to try and upstream this u-boot only DT to Linux, since it's only purpose is to assist boot firmware to select correct DT.

Quoted 7 lines

I suppose similar functionality would be needed if any other bootloader/firmware has to be enabled for these boards. So we can't say it's particularly specific to U-Boot but it is rather a dowsized DT which can boot on both boards with ethernet non-functional. You can also rather have a single downsized DT supported upstream with 2 overlays one for each board which can be applied on successful detection of hw revision.

Providing different firmware images for each hw revission can be an option for other bootloaders, or they can provide similar runtime detection as U-Boot.

So I still see a valid need for having U-Boot only DT together with main DTs from dts/upstream. It can also be protected behind a new Kconfig symbol, e.g. OF_UPSTREAM_MIXED or similar.

Regards,
Jonas

Quoted 32 lines

-Sumit

Quoted 29 lines

Regards,
Jonas

Quoted 24 lines

-Sumit

Quoted 21 lines

Please see following for more details:
https://source.denx.de/u-boot/u-boot/-/commit/a52099b4a2ae9e8cafc79268325249bcad308012
https://source.denx.de/u-boot/u-boot/-/blob/master/arch/arm/dts/rk3566-orangepi-3b.dts
https://source.denx.de/u-boot/u-boot/-/blob/master/arch/arm/dts/rk3566-orangepi-3b-v1.1.dts
https://source.denx.de/u-boot/u-boot/-/blob/master/arch/arm/dts/rk3566-orangepi-3b-v2.1.dts

Regards,
Jonas

Quoted 10 lines

-Sumit

Quoted 7 lines

Jan

--
Siemens AG, Technology
Linux Expert Center