Skip to contentSkip to conversation

ARM: SPL: FIT: fix DTC warnings on FIT generation

PATCH New Andre Przywara 6 participants 12 messages Oct 4, 2017 – Oct 24, 2017 Arm/Allwinner sunXi SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: SPL: FIT: fix DTC warnings on FIT generation

Newer versions of the device tree compiler (rightfully) complain about mismatches between attributed node names (name@<addr>) and a missing reg property in that node.
Adjust the FIT build script for 64-bit Allwinner boards to remove the bogus addresses from the node names and avoid the warnings.

---
 board/sunxi/mksunxi_fit_atf.sh | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
board/sunxi/mksunxi_fit_atf.sh +8 -8
index b1d6e0e16a..36abe9efed 100755
@@ -21,7 +21,7 @@ cat << __HEADER_EOF
 	#address-cells = <1>;
 
 	images {
-		uboot at 1 {
+		uboot {
 			description = "U-Boot (64-bit)";
 			data = /incbin/("u-boot-nodtb.bin");
 			type = "standalone";
@@ -29,7 +29,7 @@ cat << __HEADER_EOF
 			compression = "none";
 			load = <0x4a000000>;
 		};
-		atf at 1 {
+		atf {
 			description = "ARM Trusted Firmware";
 			data = /incbin/("$BL31");
 			type = "firmware";
@@ -44,7 +44,7 @@ cnt=1
 for dtname in $*
 do
 	cat << __FDT_IMAGE_EOF
-		fdt@$cnt {
+		fdt_$cnt {
 			description = "$(basename $dtname .dtb)";
 			data = /incbin/("$dtname");
 			type = "flat_dt";
@@ -57,7 +57,7 @@ done
 cat << __CONF_HEADER_EOF
 	};
 	configurations {
-		default = "config at 1";
+		default = "config_1";
 
 __CONF_HEADER_EOF
 
@@ -65,11 +65,11 @@ cnt=1
 for dtname in $*
 do
 	cat << __CONF_SECTION_EOF
-		config@$cnt {
+		config_$cnt {
 			description = "$(basename $dtname .dtb)";
-			firmware = "uboot at 1";
-			loadables = "atf@1";
-			fdt = "fdt@$cnt";
+			firmware = "uboot";
+			loadables = "atf";
+			fdt = "fdt_$cnt";
 		};
 __CONF_SECTION_EOF
 	cnt=$((cnt+1))
Signature · 1 line
2.14.1
#1 lore raw

PATCH 1/1 ARM: SPL: FIT: fix DTC warnings on FIT generation

Hi Andre,

Quoted 10 lines · Andre Przywara

Newer versions of the device tree compiler (rightfully) complain about mismatches between attributed node names (name@<addr>) and a missing reg property in that node.
Adjust the FIT build script for 64-bit Allwinner boards to remove the bogus addresses from the node names and avoid the warnings.

---
 board/sunxi/mksunxi_fit_atf.sh | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

It looks like we have this problem all over the place. The documentation in doc/uImage now seems to have this problem too.

I wonder if instead we should add reg / #address-cells / #size-cells properties?

Regards,
Simon

#2 lore raw

PATCH 1/1 ARM: SPL: FIT: fix DTC warnings on FIT generation

Quoted 14 lines · Simon Glass

Hi Andre,

Quoted 10 lines · Andre Przywara

Newer versions of the device tree compiler (rightfully) complain about mismatches between attributed node names (name@<addr>) and a missing reg property in that node.
Adjust the FIT build script for 64-bit Allwinner boards to remove the bogus addresses from the node names and avoid the warnings.

---
 board/sunxi/mksunxi_fit_atf.sh | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
Quoted 4 lines

It looks like we have this problem all over the place. The documentation in doc/uImage now seems to have this problem too.

I wonder if instead we should add reg / #address-cells / #size-cells properties?

If the update on dts, might be an another-overhead to maintain u-boot dts wrt Linux dts sync.

thanks!

Signature · 4 lines
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
#3 lore raw

PATCH 1/1 ARM: SPL: FIT: fix DTC warnings on FIT generation

Quoted 15 lines · Jagan Teki
Quoted 14 lines · Simon Glass

Hi Andre,

Quoted 10 lines · Andre Przywara

Newer versions of the device tree compiler (rightfully) complain about mismatches between attributed node names (name@<addr>) and a missing reg property in that node.
Adjust the FIT build script for 64-bit Allwinner boards to remove the bogus addresses from the node names and avoid the warnings.

---
 board/sunxi/mksunxi_fit_atf.sh | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
Quoted 7 lines
Quoted 4 lines

It looks like we have this problem all over the place. The documentation in doc/uImage now seems to have this problem too.

I wonder if instead we should add reg / #address-cells / #size-cells properties?

If the update on dts, might be an another-overhead to maintain u-boot dts wrt Linux dts sync.

Anything that DTC is warning about in a dts that we get from the kernel, should be fixed in the kernel. The kernel dtc is what we're using, and is/will/can also complain about it.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171016/f7666dbb/attachment.sig>
#4 lore raw

PATCH 1/1 ARM: SPL: FIT: fix DTC warnings on FIT generation

Quoted 19 lines · Tom Rini
Quoted 18 lines · Jagan Teki
Quoted 17 lines · Simon Glass

Hi Andre,

Quoted 10 lines · Andre Przywara

Newer versions of the device tree compiler (rightfully) complain about mismatches between attributed node names (name@<addr>) and a missing reg property in that node.
Adjust the FIT build script for 64-bit Allwinner boards to remove the bogus addresses from the node names and avoid the warnings.

---
 board/sunxi/mksunxi_fit_atf.sh | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

It looks like we have this problem all over the place. The documentation in doc/uImage now seems to have this problem too.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

I wonder if instead we should add reg / #address-cells / #size-cells properties?

If the update on dts, might be an another-overhead to maintain u-boot dts wrt Linux dts sync.

Anything that DTC is warning about in a dts that we get from the kernel, should be fixed in the kernel. The kernel dtc is what we're using, and is/will/can also complain about it.

Yes, this can be true if the node changes are more common in between.

thanks!

Signature · 4 lines
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
#10 lore raw

PATCH 1/1 ARM: SPL: FIT: fix DTC warnings on FIT generation

In reply to Jagan Teki

Hi,

sorry Simon for dropping the ball earlier. I will try to answer both Jagan's and your concern below.

Quoted 15 lines · Jagan Teki
Quoted 14 lines · Simon Glass

Hi Andre,

Quoted 10 lines · Andre Przywara

Newer versions of the device tree compiler (rightfully) complain about mismatches between attributed node names (name@<addr>) and a missing reg property in that node.
Adjust the FIT build script for 64-bit Allwinner boards to remove the bogus addresses from the node names and avoid the warnings.

---
 board/sunxi/mksunxi_fit_atf.sh | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
Quoted 7 lines
Quoted 4 lines

It looks like we have this problem all over the place. The documentation in doc/uImage now seems to have this problem too.

I wonder if instead we should add reg / #address-cells / #size-cells properties?

If the update on dts, might be an another-overhead to maintain u-boot dts wrt Linux dts sync.

This is not the kernel .dts, but the FIT image description (using the DTS format), which is purely private to U-Boot. I erroneously used addresses (fdt at 1) to enumerate different FDTs.
I don't think this is right, since those FDTs don't have anything which would resemble an address. Instead the SPL just chooses one of them, and the script generates as many as we give it (from defconfig).

So I don't see much sense in introducing a "reg" property. Multiple instances of an UART are alive at the same time, so an address property makes sense. But we just need *one* FDT and some unique name used to match configuration entries to the appropriate image. Actually those identifiers could be totally random as well, or we actually use something derived from the filename.
But for simplicity I'd just go with the underscore notation, unless someone convinces me otherwise.

Cheers,
Andre.

#11 lore raw

PATCH 1/1 ARM: SPL: FIT: fix DTC warnings on FIT generation

Hi Andre,

Quoted 36 lines · André Przywara

Hi,

sorry Simon for dropping the ball earlier. I will try to answer both Jagan's and your concern below.

Quoted 15 lines · Jagan Teki
Quoted 14 lines · Simon Glass

Hi Andre,

Quoted 10 lines · Andre Przywara

Newer versions of the device tree compiler (rightfully) complain about mismatches between attributed node names (name@<addr>) and a missing reg property in that node.
Adjust the FIT build script for 64-bit Allwinner boards to remove the bogus addresses from the node names and avoid the warnings.

---
 board/sunxi/mksunxi_fit_atf.sh | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
Quoted 7 lines
Quoted 4 lines

It looks like we have this problem all over the place. The documentation in doc/uImage now seems to have this problem too.

I wonder if instead we should add reg / #address-cells / #size-cells properties?

If the update on dts, might be an another-overhead to maintain u-boot dts wrt Linux dts sync.

This is not the kernel .dts, but the FIT image description (using the DTS format), which is purely private to U-Boot. I erroneously used addresses (fdt at 1) to enumerate different FDTs.
I don't think this is right, since those FDTs don't have anything which would resemble an address. Instead the SPL just chooses one of them, and the script generates as many as we give it (from defconfig).

Quoted 8 lines

So I don't see much sense in introducing a "reg" property. Multiple instances of an UART are alive at the same time, so an address property makes sense. But we just need *one* FDT and some unique name used to match configuration entries to the appropriate image. Actually those identifiers could be totally random as well, or we actually use something derived from the filename.
But for simplicity I'd just go with the underscore notation, unless someone convinces me otherwise.

OTOH this really just a feature of the DT format. Adding a 'reg' property can be justified on that basis. Or perhaps we should have an option for dtc to support 'degenerate' .dts files?

The underscore is normally used for phandles.

Regards,
Simon

#5 lore raw

PATCH 1/1 ARM: SPL: FIT: fix DTC warnings on FIT generation

In reply to Tom Rini
Quoted 19 lines · Tom Rini
Quoted 18 lines · Jagan Teki
Quoted 17 lines · Simon Glass

Hi Andre,

Quoted 10 lines · Andre Przywara

Newer versions of the device tree compiler (rightfully) complain about mismatches between attributed node names (name@<addr>) and a missing reg property in that node.
Adjust the FIT build script for 64-bit Allwinner boards to remove the bogus addresses from the node names and avoid the warnings.

---
 board/sunxi/mksunxi_fit_atf.sh | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

It looks like we have this problem all over the place. The documentation in doc/uImage now seems to have this problem too.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

I wonder if instead we should add reg / #address-cells / #size-cells properties?

If the update on dts, might be an another-overhead to maintain u-boot dts wrt Linux dts sync.

Anything that DTC is warning about in a dts that we get from the kernel, should be fixed in the kernel. The kernel dtc is what we're using, and is/will/can also complain about it.

Kernel suppress these warning by default[1] and enables these warnings with W= compiler option. May be this should be included in u-boot as well?

[1]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/Makefile.lib#n272

Thanks and regards,
Lokesh

#6 lore raw

PATCH 1/1 ARM: SPL: FIT: fix DTC warnings on FIT generation

Quoted 31 lines · Lokesh Vutla
Quoted 19 lines · Tom Rini
Quoted 18 lines · Jagan Teki
Quoted 17 lines · Simon Glass

Hi Andre,

Quoted 10 lines · Andre Przywara

Newer versions of the device tree compiler (rightfully) complain about mismatches between attributed node names (name@<addr>) and a missing reg property in that node.
Adjust the FIT build script for 64-bit Allwinner boards to remove the bogus addresses from the node names and avoid the warnings.

---
 board/sunxi/mksunxi_fit_atf.sh | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

It looks like we have this problem all over the place. The documentation in doc/uImage now seems to have this problem too.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

I wonder if instead we should add reg / #address-cells / #size-cells properties?

If the update on dts, might be an another-overhead to maintain u-boot dts wrt Linux dts sync.

Anything that DTC is warning about in a dts that we get from the kernel, should be fixed in the kernel. The kernel dtc is what we're using, and is/will/can also complain about it.

Quoted 5 lines

Kernel suppress these warning by default[1] and enables these warnings with W= compiler option. May be this should be included in u-boot as well?

[1]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/Makefile.lib#n272

We have slightly different logic for that today in scripts/Makefile.extrawarn, perhaps we need to re-sync?

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171023/f859df2e/attachment.sig>
#7 lore raw

PATCH 1/1 ARM: SPL: FIT: fix DTC warnings on FIT generation

Quoted 32 lines · Tom Rini
Quoted 31 lines · Lokesh Vutla
Quoted 27 lines · Tom Rini
Quoted 15 lines · Jagan Teki
Quoted 14 lines · Simon Glass

Hi Andre,

Quoted 10 lines · Andre Przywara

Newer versions of the device tree compiler (rightfully) complain about mismatches between attributed node names (name@<addr>) and a missing reg property in that node.
Adjust the FIT build script for 64-bit Allwinner boards to remove the bogus addresses from the node names and avoid the warnings.

---
 board/sunxi/mksunxi_fit_atf.sh | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
Quoted 7 lines
Quoted 4 lines

It looks like we have this problem all over the place. The documentation in doc/uImage now seems to have this problem too.

I wonder if instead we should add reg / #address-cells / #size-cells properties?

If the update on dts, might be an another-overhead to maintain u-boot dts wrt Linux dts sync.

Anything that DTC is warning about in a dts that we get from the kernel, should be fixed in the kernel. The kernel dtc is what we're using, and is/will/can also complain about it.

Quoted 9 lines
Quoted 5 lines

Kernel suppress these warning by default[1] and enables these warnings with W= compiler option. May be this should be included in u-boot as well?

[1]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/Makefile.lib#n272

We have slightly different logic for that today in scripts/Makefile.extrawarn, perhaps we need to re-sync?

ahh you are right. I do not see these warning with the latest U-Boot. But I still agree with the $patch as these warnings are meant to be fixed at some point.

Thanks and regards,
Lokesh

#8 lore raw

PATCH 1/1 ARM: SPL: FIT: fix DTC warnings on FIT generation

Hi Andre,

2017-10-24 11:03 GMT+09:00 Lokesh Vutla <[email protected]>:

Quoted 41 lines · Tom Rini
Quoted 38 lines · Lokesh Vutla
Quoted 36 lines · Tom Rini
Quoted 19 lines · Jagan Teki
Quoted 18 lines · Simon Glass
Quoted 17 lines

Hi Andre,

Quoted 10 lines · Andre Przywara

Newer versions of the device tree compiler (rightfully) complain about mismatches between attributed node names (name@<addr>) and a missing reg property in that node.
Adjust the FIT build script for 64-bit Allwinner boards to remove the bogus addresses from the node names and avoid the warnings.

---
 board/sunxi/mksunxi_fit_atf.sh | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

It looks like we have this problem all over the place. The documentation in doc/uImage now seems to have this problem too.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

I wonder if instead we should add reg / #address-cells / #size-cells properties?

If the update on dts, might be an another-overhead to maintain u-boot dts wrt Linux dts sync.

Anything that DTC is warning about in a dts that we get from the kernel, should be fixed in the kernel. The kernel dtc is what we're using, and is/will/can also complain about it.

Kernel suppress these warning by default[1] and enables these warnings with W= compiler option. May be this should be included in u-boot as well?

[1]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/Makefile.lib#n272

Quoted 7 lines
Quoted 3 lines

We have slightly different logic for that today in scripts/Makefile.extrawarn, perhaps we need to re-sync?

ahh you are right. I do not see these warning with the latest U-Boot. But I still agree with the $patch as these warnings are meant to be fixed at some point.

Please use "-" instead of "@".

Update all the FIT examples.
You may need to update some C files.

This is the conclusion of Device Tree community.
See the following commit of Linux.

commit b21569cf1de925e0a42c9964bd7f520cb4a4d875

Author: Viresh Kumar <[email protected]>
Date:   Thu Jun 22 09:15:11 2017 +0530

PM / OPP: Use - instead of @ for DT entries

Compiling the DT file with W=1, DTC warns like follows:

Warning (unit_address_vs_reg): Node /opp_table0/opp at 1000000000 has a unit name, but no reg property

Fix this by replacing '@' with '-' as the OPP nodes will never have a "reg" property.

Signature · 2 lines
Best Regards
Masahiro Yamada
#9 lore raw

PATCH 1/1 ARM: SPL: FIT: fix DTC warnings on FIT generation

On 24/10/17 03:31, Masahiro Yamada wrote:

Hi,

Quoted 51 lines

2017-10-24 11:03 GMT+09:00 Lokesh Vutla <[email protected]>:

Quoted 41 lines · Tom Rini
Quoted 38 lines · Lokesh Vutla
Quoted 36 lines · Tom Rini
Quoted 19 lines · Jagan Teki
Quoted 18 lines · Simon Glass
Quoted 17 lines

Hi Andre,

Quoted 10 lines · Andre Przywara

Newer versions of the device tree compiler (rightfully) complain about mismatches between attributed node names (name@<addr>) and a missing reg property in that node.
Adjust the FIT build script for 64-bit Allwinner boards to remove the bogus addresses from the node names and avoid the warnings.

---
 board/sunxi/mksunxi_fit_atf.sh | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

It looks like we have this problem all over the place. The documentation in doc/uImage now seems to have this problem too.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

I wonder if instead we should add reg / #address-cells / #size-cells properties?

If the update on dts, might be an another-overhead to maintain u-boot dts wrt Linux dts sync.

Anything that DTC is warning about in a dts that we get from the kernel, should be fixed in the kernel. The kernel dtc is what we're using, and is/will/can also complain about it.

Kernel suppress these warning by default[1] and enables these warnings with W= compiler option. May be this should be included in u-boot as well?

[1]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/Makefile.lib#n272

Quoted 7 lines
Quoted 3 lines

We have slightly different logic for that today in scripts/Makefile.extrawarn, perhaps we need to re-sync?

ahh you are right. I do not see these warning with the latest U-Boot. But I still agree with the $patch as these warnings are meant to be fixed at some point.

Quoted 4 lines

Please use "-" instead of "@".

Update all the FIT examples.
You may need to update some C files.

Yeah! "find ./ -type f | xargs -1 sed -i -e s/@/-/g" didn't give the expected results, though :-D
But I bit the bullet and fixed every @1 sucker I could find, just need some more time to make proper patches.

Cheers,
Andre.

Quoted 31 lines

This is the conclusion of Device Tree community.
See the following commit of Linux.

commit b21569cf1de925e0a42c9964bd7f520cb4a4d875

Author: Viresh Kumar <[email protected]>
Date:   Thu Jun 22 09:15:11 2017 +0530

PM / OPP: Use - instead of @ for DT entries

Compiling the DT file with W=1, DTC warns like follows:

Warning (unit_address_vs_reg): Node /opp_table0/opp at 1000000000 has a unit name, but no reg property

Fix this by replacing '@' with '-' as the OPP nodes will never have a "reg" property.