Skip to contentSkip to conversation

ARM: dts: mmp2-olpc-xo-1-75: clear the warnings when make dtbs

PATCH Applied Zhen Lei 2 participants 5 messages Dec 7, 2020 – Dec 9, 2020 Device tree bindings

lore
Share & tools
lore

Zhen Lei

author
#0 lore raw

v2 cover ARM: dts: mmp2-olpc-xo-1-75: clear the warnings when make dtbs

v1 --> v2:
Update the patch description and subject.

I'm going to describe the detailed analysis here, because I don't want the patch description to be too long.

0) make ARCH=arm CROSS_COMPILE=arm-linux-gnu- dtbs -j24 2>err.txt
vim err.txt
arch/arm/boot/dts/mmp2.dtsi:472.23-480.6: Warning (spi_bus_bridge): /soc/apb@d4000000/spi@d4037000: incorrect #address-cells for SPI bus
also defined at arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts:225.7-237.3
arch/arm/boot/dts/mmp2.dtsi:472.23-480.6: Warning (spi_bus_bridge): /soc/apb@d4000000/spi@d4037000: incorrect #size-cells for SPI bus
also defined at arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts:225.7-237.3
arch/arm/boot/dts/mmp2-olpc-xo-1-75.dtb: Warning (spi_bus_reg): Failed prerequisite 'spi_bus_bridge'

1) mmp2.dtsi is included by mmp2-olpc-xo-1-75.dts, and the content of ssp3 node is:

arch/arm/boot/dts/mmp2.dtsi:472

ssp3: spi@d4037000 {
	compatible = "marvell,mmp2-ssp";
	reg = <0xd4037000 0x1000>;
	clocks = <&soc_clocks MMP2_CLK_SSP2>;
	interrupts = <20>;
	#address-cells = <1>;
	#size-cells = <0>;                        <-------- #size-cells = <0>
	status = "disabled";
};

arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts:225

&ssp3 {
        /delete-property/ #address-cells;         <-------- #address-cells is deleted here
        /delete-property/ #size-cells;            <-------- #size-cells is deleted here
        spi-slave;
        status = "okay";
        ready-gpios = <&gpio 125 GPIO_ACTIVE_HIGH>;

        slave {
                compatible = "olpc,xo1.75-ec";
                spi-cpha;
                cmd-gpios = <&gpio 155 GPIO_ACTIVE_HIGH>;
        };
};

2) scripts/dtc/checks.c: check_spi_bus_bridge() requires that the values of both #address-cells and #size-cells must be zero, when the node have "spi-slave" property.

	if (get_property(node, "spi-slave"))
                spi_addr_cells = 0;
        if (node_addr_cells(node) != spi_addr_cells)
                FAIL(c, dti, node, "incorrect #address-cells for SPI bus");
        if (node_size_cells(node) != 0)
                FAIL(c, dti, node, "incorrect #size-cells for SPI bus");

3) But both #address-cells and #size-cells properties are deleted. So the return value of node_addr_cells(node) is 2, and the return value of node_size_cells(node) is 1.

#define node_addr_cells(n) \
        (((n)->addr_cells == -1) ? 2 : (n)->addr_cells)
#define node_size_cells(n) \
        (((n)->size_cells == -1) ? 1 : (n)->size_cells)

4) The checks in 2) failed, so the above 0) warnings is displayed.

v1:
Patch 5/6.
https://www.mail-archive.com/[email protected]/msg2341407.html

Zhen Lei (1):
ARM: dts: mmp2-olpc-xo-1-75: clear the warnings when make dtbs

 arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
1.8.3
author
#1 lore raw

PATCH v2 1/1 ARM: dts: mmp2-olpc-xo-1-75: clear the warnings when make dtbs

The check_spi_bus_bridge() in scripts/dtc/checks.c requires that the node have "spi-slave" property must with "#address-cells = <0>" and "#size-cells = <0>". But currently both "#address-cells" and "#size-cells" properties are deleted, the corresponding default values are 2 and 1. As a result, the check fails and below warnings is displayed.

arch/arm/boot/dts/mmp2.dtsi:472.23-480.6: Warning (spi_bus_bridge): \
/soc/apb@d4000000/spi@d4037000: incorrect #address-cells for SPI bus
also defined at arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts:225.7-237.3
arch/arm/boot/dts/mmp2.dtsi:472.23-480.6: Warning (spi_bus_bridge): \
/soc/apb@d4000000/spi@d4037000: incorrect #size-cells for SPI bus
also defined at arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts:225.7-237.3
arch/arm/boot/dts/mmp2-olpc-xo-1-75.dtb: Warning (spi_bus_reg): \
Failed prerequisite 'spi_bus_bridge'

Because the value of "#size-cells" is already defined as zero in the node "ssp3: spi@d4037000" in arch/arm/boot/dts/mmp2.dtsi. So we only need to explicitly add "#address-cells = <0>" and keep "#size-cells" no change.

---
 arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts +1 -1
index adde62d6fce73b9..82da44dacba7172 100644
@@ -224,7 +224,7 @@
 
 &ssp3 {
 	/delete-property/ #address-cells;
-	/delete-property/ #size-cells;
+	#address-cells = <0>;
 	spi-slave;
 	status = "okay";
 	ready-gpios = <&gpio 125 GPIO_ACTIVE_HIGH>;
Signature · 1 line
1.8.3
#2 lore raw
Quoted 16 lines · Zhen Lei

The check_spi_bus_bridge() in scripts/dtc/checks.c requires that the node have "spi-slave" property must with "#address-cells = <0>" and "#size-cells = <0>". But currently both "#address-cells" and "#size-cells" properties are deleted, the corresponding default values are 2 and 1. As a result, the check fails and below warnings is displayed.

arch/arm/boot/dts/mmp2.dtsi:472.23-480.6: Warning (spi_bus_bridge): \
/soc/apb@d4000000/spi@d4037000: incorrect #address-cells for SPI bus
also defined at arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts:225.7-237.3
arch/arm/boot/dts/mmp2.dtsi:472.23-480.6: Warning (spi_bus_bridge): \
/soc/apb@d4000000/spi@d4037000: incorrect #size-cells for SPI bus
also defined at arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts:225.7-237.3
arch/arm/boot/dts/mmp2-olpc-xo-1-75.dtb: Warning (spi_bus_reg): \
Failed prerequisite 'spi_bus_bridge'

Quoted 5 lines

Because the value of "#size-cells" is already defined as zero in the node "ssp3: spi@d4037000" in arch/arm/boot/dts/mmp2.dtsi. So we only need to explicitly add "#address-cells = <0>" and keep "#size-cells" no change.

Right, I already sent the same patch earlier.

Lubomir, can I apply this to the fixes branch?

Quoted 20 lines
 arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts +1 -2
index adde62d6fce73b9..82da44dacba7172 100644
@@ -224,7 +224,7 @@
 
 &ssp3 {
        /delete-property/ #address-cells;
-       /delete-property/ #size-cells;
+       #address-cells = <0>;
        spi-slave;
        status = "okay";
        ready-gpios = <&gpio 125 GPIO_ACTIVE_HIGH>;
--

1.8.3

#3 lore raw
Quoted 17 lines · Arnd Bergmann
Quoted 16 lines · Zhen Lei

The check_spi_bus_bridge() in scripts/dtc/checks.c requires that the node have "spi-slave" property must with "#address-cells = <0>" and "#size-cells = <0>". But currently both "#address-cells" and "#size-cells" properties are deleted, the corresponding default values are 2 and 1. As a result, the check fails and below warnings is displayed.

arch/arm/boot/dts/mmp2.dtsi:472.23-480.6: Warning (spi_bus_bridge): \
/soc/apb@d4000000/spi@d4037000: incorrect #address-cells for SPI bus
also defined at arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts:225.7-237.3
arch/arm/boot/dts/mmp2.dtsi:472.23-480.6: Warning (spi_bus_bridge): \
/soc/apb@d4000000/spi@d4037000: incorrect #size-cells for SPI bus
also defined at arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts:225.7-237.3
arch/arm/boot/dts/mmp2-olpc-xo-1-75.dtb: Warning (spi_bus_reg): \
Failed prerequisite 'spi_bus_bridge'

Quoted 7 lines
Quoted 5 lines

Because the value of "#size-cells" is already defined as zero in the node "ssp3: spi@d4037000" in arch/arm/boot/dts/mmp2.dtsi. So we only need to explicitly add "#address-cells = <0>" and keep "#size-cells" no change.

Right, I already sent the same patch earlier.

Oh, sorry, I don't known it. If you send it earlier, please apply your patch!

Quoted 2 lines

Lubomir, can I apply this to the fixes branch?

This fix is really should be considered to merge into v5.10.

Quoted 24 lines
Quoted 18 lines
 arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts +1 -2
index adde62d6fce73b9..82da44dacba7172 100644
@@ -224,7 +224,7 @@
 
 &ssp3 {
        /delete-property/ #address-cells;
-       /delete-property/ #size-cells;
+       #address-cells = <0>;
        spi-slave;
        status = "okay";
        ready-gpios = <&gpio 125 GPIO_ACTIVE_HIGH>;
--
Quoted 3 lines

1.8.3

.

#4 lore raw
In reply to Zhen Lei

From: Arnd Bergmann <[email protected]>

Quoted 14 lines · Zhen Lei

v1 --> v2:
Update the patch description and subject.

I'm going to describe the detailed analysis here, because I don't want the patch description to be too long.

0) make ARCH=arm CROSS_COMPILE=arm-linux-gnu- dtbs -j24 2>err.txt
vim err.txt
arch/arm/boot/dts/mmp2.dtsi:472.23-480.6: Warning (spi_bus_bridge): /soc/apb@d4000000/spi@d4037000: incorrect #address-cells for SPI bus
also defined at arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts:225.7-237.3
arch/arm/boot/dts/mmp2.dtsi:472.23-480.6: Warning (spi_bus_bridge): /soc/apb@d4000000/spi@d4037000: incorrect #size-cells for SPI bus
also defined at arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts:225.7-237.3
arch/arm/boot/dts/mmp2-olpc-xo-1-75.dtb: Warning (spi_bus_reg): Failed prerequisite 'spi_bus_bridge'

Quoted 1 line

[...]

I picked your version instead of my own.

Applied to arm/fixes, thanks!

[1/1] ARM: dts: mmp2-olpc-xo-1-75: clear the warnings when make dtbs

      commit: a0cab089baf3048020de7bee53bccd598747126a

       Arnd