Add default #address-cells and #size-cells properties to usb0,
suitable for hubs and devices without explicitly declared
interface nodes, as:
"#address-cells":
description: should be 1 for hub nodes with device nodes,
should be 2 for device nodes with interface nodes.
enum: [1, 2]
"#size-cells":
const: 0
-- from Documentation/devicetree/bindings/usb/usb-device.yaml
Signed-off-by: Justin Swartz <[email protected]>
---
arch/mips/boot/dts/ralink/mt7621.dtsi | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/mips/boot/dts/ralink/mt7621.dtsi b/arch/mips/boot/dts/ralink/mt7621.dtsi
index 2069249c8..f02965db1 100644
--- a/arch/mips/boot/dts/ralink/mt7621.dtsi
+++ b/arch/mips/boot/dts/ralink/mt7621.dtsi
@@ -309,6 +309,9 @@ usb: usb@1e1c0000 {
interrupt-parent = <&gic>;
interrupts = <GIC_SHARED 22 IRQ_TYPE_LEVEL_HIGH>;
+
+ #address-cells = <1>;
+ #size-cells = <0>;
};
gic: interrupt-controller@1fbc0000 {
--
On 06/03/2024 21:21, Justin Swartz wrote:
> Add default #address-cells and #size-cells properties to usb0,
> suitable for hubs and devices without explicitly declared
> interface nodes, as:
>
> "#address-cells":
> description: should be 1 for hub nodes with device nodes,
> should be 2 for device nodes with interface nodes.
> enum: [1, 2]
>
> "#size-cells":
> const: 0
>
> -- from Documentation/devicetree/bindings/usb/usb-device.yaml
>
> Signed-off-by: Justin Swartz <[email protected]>
> ---
> arch/mips/boot/dts/ralink/mt7621.dtsi | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/arch/mips/boot/dts/ralink/mt7621.dtsi b/arch/mips/boot/dts/ralink/mt7621.dtsi
> index 2069249c8..f02965db1 100644
> --- a/arch/mips/boot/dts/ralink/mt7621.dtsi
> +++ b/arch/mips/boot/dts/ralink/mt7621.dtsi
> @@ -309,6 +309,9 @@ usb: usb@1e1c0000 {
>
> interrupt-parent = <&gic>;
> interrupts = <GIC_SHARED 22 IRQ_TYPE_LEVEL_HIGH>;
> +
> + #address-cells = <1>;
> + #size-cells = <0>;
Doesn't this bring new W=1 warnings?
Best regards,
Krzysztof
Hi Krzysztof
On 2024-03-07 10:01, Krzysztof Kozlowski wrote:
> On 06/03/2024 21:21, Justin Swartz wrote:
>> Add default #address-cells and #size-cells properties to usb0,
>> suitable for hubs and devices without explicitly declared
>> interface nodes, as:
>>
>> "#address-cells":
>> description: should be 1 for hub nodes with device nodes,
>> should be 2 for device nodes with interface nodes.
>> enum: [1, 2]
>>
>> "#size-cells":
>> const: 0
>>
>> -- from Documentation/devicetree/bindings/usb/usb-device.yaml
>>
>> Signed-off-by: Justin Swartz <[email protected]>
>> ---
>> arch/mips/boot/dts/ralink/mt7621.dtsi | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/arch/mips/boot/dts/ralink/mt7621.dtsi
>> b/arch/mips/boot/dts/ralink/mt7621.dtsi
>> index 2069249c8..f02965db1 100644
>> --- a/arch/mips/boot/dts/ralink/mt7621.dtsi
>> +++ b/arch/mips/boot/dts/ralink/mt7621.dtsi
>> @@ -309,6 +309,9 @@ usb: usb@1e1c0000 {
>>
>> interrupt-parent = <&gic>;
>> interrupts = <GIC_SHARED 22 IRQ_TYPE_LEVEL_HIGH>;
>> +
>> + #address-cells = <1>;
>> + #size-cells = <0>;
>
> Doesn't this bring new W=1 warnings?
For a fresh build (make O=build clean; make O=build W=1): I do not
receive any warnings regarding mt7621.dtsi or my board's .dts file. I
added these properties to the usb node because I had received warnings
about a child node for a permenantly-connected/onboard hub:
--%--
/ {
...
usb_fixed_5v0: regulator {
compatible = "regulator-fixed";
regulator-name = "usb_vbus";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
regulator-boot-on;
regulator-always-on;
};
usb_fixed_3v3: regulator {
compatible = "regulator-fixed";
regulator-name = "usb_vusb33";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
regulator-always-on;
};
};
&usb {
usb3-lpm-capable;
vbus-supply = <&usb_fixed_5v0>;
vusb33-supply = <&usb_fixed_3v3>;
hub: hub@0 {
compatible = "usb5e3,608";
reg = <1>;
};
};
--%--
If the #address-cells and #size-cells properties are removed from the
usb node, the following warnings are generated:
$ make O=build W=1 dtbs
make[1]: Entering directory
'/home/user/projects/xfl-mt7621/src/linux/build'
GEN Makefile
CALL ../scripts/checksyscalls.sh
DTC arch/mips/boot/dts/ralink/mt7621-client-product.dtb
./arch/mips/boot/dts/ralink/mt7621-client-product.dts:276.3-13: Warning
(reg_format): /usb@1e1c0000/hub@0:reg: property has invalid length (4
bytes) (#address-cells == 2, #size-cells == 1)
arch/mips/boot/dts/ralink/mt7621-client-product.dtb: Warning
(pci_device_reg): Failed prerequisite 'reg_format'
arch/mips/boot/dts/ralink/mt7621-client-product.dtb: Warning
(pci_device_bus_num): Failed prerequisite 'reg_format'
arch/mips/boot/dts/ralink/mt7621-client-product.dtb: Warning
(simple_bus_reg): Failed prerequisite 'reg_format'
arch/mips/boot/dts/ralink/mt7621-client-product.dtb: Warning
(i2c_bus_reg): Failed prerequisite 'reg_format'
arch/mips/boot/dts/ralink/mt7621-client-product.dtb: Warning
(spi_bus_reg): Failed prerequisite 'reg_format'
./arch/mips/boot/dts/ralink/mt7621-client-product.dts:274.13-277.4:
Warning (avoid_default_addr_size): /usb@1e1c0000/hub@0: Relying on
default #address-cells value
./arch/mips/boot/dts/ralink/mt7621-client-product.dts:274.13-277.4:
Warning (avoid_default_addr_size): /usb@1e1c0000/hub@0: Relying on
default #size-cells value
arch/mips/boot/dts/ralink/mt7621-client-product.dtb: Warning
(avoid_unnecessary_addr_size): Failed prerequisite
'avoid_default_addr_size'
arch/mips/boot/dts/ralink/mt7621-client-product.dtb: Warning
(unique_unit_address_if_enabled): Failed prerequisite
'avoid_default_addr_size'
DTC arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc1.dtb
DTC arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc2.dtb
DTC arch/mips/boot/dts/ralink/mt7621-tplink-hc220-g5-v1.dtb
make[1]: Leaving directory
'/home/user/projects/xfl-mt7621/src/linux/build'
If I add add them back to the usb node, this is the result:
$ make O=build W=1 dtbs
make[1]: Entering directory
'/home/user/projects/xfl-mt7621/src/linux/build'
GEN Makefile
CALL ../scripts/checksyscalls.sh
DTC arch/mips/boot/dts/ralink/mt7621-client-product.dtb
DTC arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc1.dtb
DTC arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc2.dtb
DTC arch/mips/boot/dts/ralink/mt7621-tplink-hc220-g5-v1.dtb
make[1]: Leaving directory
'/home/user/projects/xfl-mt7621/src/linux/build'
> Best regards,
> Krzysztof
Regards
Justin
Add default #address-cells and #size-cells properties to the
usb node, which should be suitable for hubs and devices without
explicitly declared interface nodes, as:
"#address-cells":
description: should be 1 for hub nodes with device nodes,
should be 2 for device nodes with interface nodes.
enum: [1, 2]
"#size-cells":
const: 0
-- Documentation/devicetree/bindings/usb/usb-device.yaml
This version of the patch places the properties according to
the order recommended by:
Documentation/devicetree/bindings/dts-coding-style.rst
Signed-off-by: Justin Swartz <[email protected]>
---
arch/mips/boot/dts/ralink/mt7621.dtsi | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/mips/boot/dts/ralink/mt7621.dtsi b/arch/mips/boot/dts/ralink/mt7621.dtsi
index 5a89f0b8c..7532e17dd 100644
--- a/arch/mips/boot/dts/ralink/mt7621.dtsi
+++ b/arch/mips/boot/dts/ralink/mt7621.dtsi
@@ -289,10 +289,10 @@ usb: usb@1e1c0000 {
reg = <0x1e1c0000 0x1000
0x1e1d0700 0x0100>;
reg-names = "mac", "ippc";
-
+ #address-cells = <1>;
+ #size-cells = <0>;
clocks = <&sysc MT7621_CLK_XTAL>;
clock-names = "sys_ck";
-
interrupt-parent = <&gic>;
interrupts = <GIC_SHARED 22 IRQ_TYPE_LEVEL_HIGH>;
};
--
On 07/03/2024 15:58, Justin Swartz wrote:
> Hi Krzysztof
>
> On 2024-03-07 10:01, Krzysztof Kozlowski wrote:
>> On 06/03/2024 21:21, Justin Swartz wrote:
>>> Add default #address-cells and #size-cells properties to usb0,
>>> suitable for hubs and devices without explicitly declared
>>> interface nodes, as:
>>>
>>> "#address-cells":
>>> description: should be 1 for hub nodes with device nodes,
>>> should be 2 for device nodes with interface nodes.
>>> enum: [1, 2]
>>>
>>> "#size-cells":
>>> const: 0
>>>
>>> -- from Documentation/devicetree/bindings/usb/usb-device.yaml
>>>
>>> Signed-off-by: Justin Swartz <[email protected]>
>>> ---
>>> arch/mips/boot/dts/ralink/mt7621.dtsi | 3 +++
>>> 1 file changed, 3 insertions(+)
>>>
>>> diff --git a/arch/mips/boot/dts/ralink/mt7621.dtsi
>>> b/arch/mips/boot/dts/ralink/mt7621.dtsi
>>> index 2069249c8..f02965db1 100644
>>> --- a/arch/mips/boot/dts/ralink/mt7621.dtsi
>>> +++ b/arch/mips/boot/dts/ralink/mt7621.dtsi
>>> @@ -309,6 +309,9 @@ usb: usb@1e1c0000 {
>>>
>>> interrupt-parent = <&gic>;
>>> interrupts = <GIC_SHARED 22 IRQ_TYPE_LEVEL_HIGH>;
>>> +
>>> + #address-cells = <1>;
>>> + #size-cells = <0>;
>>
>> Doesn't this bring new W=1 warnings?
>
> For a fresh build (make O=build clean; make O=build W=1): I do not
make dtbs W=1 is enough
> receive any warnings regarding mt7621.dtsi or my board's .dts file. I
I meant for other boards due to unnecessary address/size cells, but if
you checked it is fine.
Best regards,
Krzysztof