diff mbox series

[05/10] mips: dts: ralink: mt7621: fix some dtc warnings

Message ID 20220914085451.11723-6-arinc.unal@arinc9.com (mailing list archive)
State New, archived
Headers show
Series dt-bindings and mt7621 devicetree changes | expand

Commit Message

Arınç ÜNAL Sept. 14, 2022, 8:54 a.m. UTC
Fix the dtc warnings below.

/cpus/cpu@0: failed to match any schema with compatible: ['mips,mips1004Kc']
/cpus/cpu@1: failed to match any schema with compatible: ['mips,mips1004Kc']
uartlite@c00: $nodename:0: 'uartlite@c00' does not match '^serial(@.*)?$'
	From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/serial/8250.yaml
uartlite@c00: Unevaluated properties are not allowed ('clock-names' was unexpected)
	From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/serial/8250.yaml
sdhci@1e130000: $nodename:0: 'sdhci@1e130000' does not match '^mmc(@.*)?$'
	From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
sdhci@1e130000: Unevaluated properties are not allowed ('bus-width', 'cap-mmc-highspeed', 'cap-sd-highspeed', 'disable-wp', 'max-frequency', 'vmmc-supply', 'vqmmc-supply' were unexpected)
	From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
xhci@1e1c0000: $nodename:0: 'xhci@1e1c0000' does not match '^usb(@.*)?'
	From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
xhci@1e1c0000: compatible: ['mediatek,mt8173-xhci'] is too short
	From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
switch0@0: $nodename:0: 'switch0@0' does not match '^(ethernet-)?switch(@.*)?$'
	From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
port@1: status:0: 'off' is not one of ['okay', 'disabled', 'reserved']
	From schema: /home/arinc9/.local/lib/python3.10/site-packages/dtschema/schemas/dt-core.yaml
port@2: status:0: 'off' is not one of ['okay', 'disabled', 'reserved']
	From schema: /home/arinc9/.local/lib/python3.10/site-packages/dtschema/schemas/dt-core.yaml
port@3: status:0: 'off' is not one of ['okay', 'disabled', 'reserved']
	From schema: /home/arinc9/.local/lib/python3.10/site-packages/dtschema/schemas/dt-core.yaml

- Remove "mips,mips1004Kc" compatible string from the cpu nodes. This
doesn't exist anywhere.
- Change "memc: syscon@5000" to "memc: memory-controller@5000".
- Change "uartlite: uartlite@c00" to "serial0: serial@c00" and remove the
aliases node.
- Remove "clock-names" from the serial0 node. The property doesn't exist on
the 8250.yaml schema.
- Change "sdhci: sdhci@1e130000" to "mmc: mmc@1e130000".
- Change "xhci: xhci@1e1c0000" to "usb: usb@1e1c0000".
- Add "mediatek,mtk-xhci" as the second compatible string on the usb node.
- Change "switch0: switch0@0" to "switch0: switch@0"
- Change "off" to "disabled" for disabled nodes.

Remaining warnings are caused by the lack of json-schema documentation.

/cpuintc: failed to match any schema with compatible: ['mti,cpu-interrupt-controller']
/palmbus@1e000000/wdt@100: failed to match any schema with compatible: ['mediatek,mt7621-wdt']
/palmbus@1e000000/i2c@900: failed to match any schema with compatible: ['mediatek,mt7621-i2c']
/palmbus@1e000000/spi@b00: failed to match any schema with compatible: ['ralink,mt7621-spi']
/ethernet@1e100000: failed to match any schema with compatible: ['mediatek,mt7621-eth']

Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
---
 .../boot/dts/ralink/mt7621-gnubee-gb-pc1.dts  |  2 +-
 .../boot/dts/ralink/mt7621-gnubee-gb-pc2.dts  |  2 +-
 arch/mips/boot/dts/ralink/mt7621.dtsi         | 32 +++++++------------
 3 files changed, 14 insertions(+), 22 deletions(-)

Comments

Sergio Paracuellos Sept. 14, 2022, 9:14 a.m. UTC | #1
Hi Arinc,

On Wed, Sep 14, 2022 at 10:55 AM Arınç ÜNAL <arinc.unal@arinc9.com> wrote:
>
> Fix the dtc warnings below.
>
> /cpus/cpu@0: failed to match any schema with compatible: ['mips,mips1004Kc']
> /cpus/cpu@1: failed to match any schema with compatible: ['mips,mips1004Kc']
> uartlite@c00: $nodename:0: 'uartlite@c00' does not match '^serial(@.*)?$'
>         From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/serial/8250.yaml
> uartlite@c00: Unevaluated properties are not allowed ('clock-names' was unexpected)
>         From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/serial/8250.yaml
> sdhci@1e130000: $nodename:0: 'sdhci@1e130000' does not match '^mmc(@.*)?$'
>         From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
> sdhci@1e130000: Unevaluated properties are not allowed ('bus-width', 'cap-mmc-highspeed', 'cap-sd-highspeed', 'disable-wp', 'max-frequency', 'vmmc-supply', 'vqmmc-supply' were unexpected)
>         From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
> xhci@1e1c0000: $nodename:0: 'xhci@1e1c0000' does not match '^usb(@.*)?'
>         From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
> xhci@1e1c0000: compatible: ['mediatek,mt8173-xhci'] is too short
>         From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
> switch0@0: $nodename:0: 'switch0@0' does not match '^(ethernet-)?switch(@.*)?$'
>         From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> port@1: status:0: 'off' is not one of ['okay', 'disabled', 'reserved']
>         From schema: /home/arinc9/.local/lib/python3.10/site-packages/dtschema/schemas/dt-core.yaml
> port@2: status:0: 'off' is not one of ['okay', 'disabled', 'reserved']
>         From schema: /home/arinc9/.local/lib/python3.10/site-packages/dtschema/schemas/dt-core.yaml
> port@3: status:0: 'off' is not one of ['okay', 'disabled', 'reserved']
>         From schema: /home/arinc9/.local/lib/python3.10/site-packages/dtschema/schemas/dt-core.yaml
>
> - Remove "mips,mips1004Kc" compatible string from the cpu nodes. This
> doesn't exist anywhere.
> - Change "memc: syscon@5000" to "memc: memory-controller@5000".
> - Change "uartlite: uartlite@c00" to "serial0: serial@c00" and remove the
> aliases node.
> - Remove "clock-names" from the serial0 node. The property doesn't exist on
> the 8250.yaml schema.
> - Change "sdhci: sdhci@1e130000" to "mmc: mmc@1e130000".
> - Change "xhci: xhci@1e1c0000" to "usb: usb@1e1c0000".
> - Add "mediatek,mtk-xhci" as the second compatible string on the usb node.
> - Change "switch0: switch0@0" to "switch0: switch@0"
> - Change "off" to "disabled" for disabled nodes.
>
> Remaining warnings are caused by the lack of json-schema documentation.
>
> /cpuintc: failed to match any schema with compatible: ['mti,cpu-interrupt-controller']
> /palmbus@1e000000/wdt@100: failed to match any schema with compatible: ['mediatek,mt7621-wdt']
> /palmbus@1e000000/i2c@900: failed to match any schema with compatible: ['mediatek,mt7621-i2c']
> /palmbus@1e000000/spi@b00: failed to match any schema with compatible: ['ralink,mt7621-spi']
> /ethernet@1e100000: failed to match any schema with compatible: ['mediatek,mt7621-eth']
>
> Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
> ---
>  .../boot/dts/ralink/mt7621-gnubee-gb-pc1.dts  |  2 +-
>  .../boot/dts/ralink/mt7621-gnubee-gb-pc2.dts  |  2 +-
>  arch/mips/boot/dts/ralink/mt7621.dtsi         | 32 +++++++------------
>  3 files changed, 14 insertions(+), 22 deletions(-)
>
> diff --git a/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc1.dts b/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc1.dts
> index 24eebc5a85b1..6ecb8165efe8 100644
> --- a/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc1.dts
> +++ b/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc1.dts
> @@ -53,7 +53,7 @@ system {
>         };
>  };
>
> -&sdhci {
> +&mmc {
>         status = "okay";
>  };
>
> diff --git a/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc2.dts b/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc2.dts
> index 34006e667780..2e534ea5bab7 100644
> --- a/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc2.dts
> +++ b/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc2.dts
> @@ -37,7 +37,7 @@ key-reset {
>         };
>  };
>
> -&sdhci {
> +&mmc {
>         status = "okay";
>  };
>
> diff --git a/arch/mips/boot/dts/ralink/mt7621.dtsi b/arch/mips/boot/dts/ralink/mt7621.dtsi
> index ee46ace0bcc1..9302bdc04510 100644
> --- a/arch/mips/boot/dts/ralink/mt7621.dtsi
> +++ b/arch/mips/boot/dts/ralink/mt7621.dtsi
> @@ -15,13 +15,11 @@ cpus {
>
>                 cpu@0 {
>                         device_type = "cpu";
> -                       compatible = "mips,mips1004Kc";
>                         reg = <0>;
>                 };
>
>                 cpu@1 {
>                         device_type = "cpu";
> -                       compatible = "mips,mips1004Kc";
>                         reg = <1>;
>                 };
>         };

Instead of removing this, since compatible is correct here, I think a
cpus yaml file needs to be added to properly define mips CPU's but
compatible strings using all around the sources are a bit messy. Take
a look of how is this done for arm [0]

> @@ -33,11 +31,6 @@ cpuintc: cpuintc {
>                 compatible = "mti,cpu-interrupt-controller";
>         };
>
> -       aliases {
> -               serial0 = &uartlite;
> -       };
> -
> -
>         mmc_fixed_3v3: regulator-3v3 {
>                 compatible = "regulator-fixed";
>                 regulator-name = "mmc_power";
> @@ -110,17 +103,16 @@ i2c: i2c@900 {
>                         pinctrl-0 = <&i2c_pins>;
>                 };
>
> -               memc: syscon@5000 {
> +               memc: memory-controller@5000 {
>                         compatible = "mediatek,mt7621-memc", "syscon";
>                         reg = <0x5000 0x1000>;
>                 };
>

I think syscon nodes need to use 'syscon' in the node name, but I am
not 100% sure.

> -               uartlite: uartlite@c00 {
> +               serial0: serial@c00 {
>                         compatible = "ns16550a";
>                         reg = <0xc00 0x100>;
>
>                         clocks = <&sysc MT7621_CLK_UART1>;
> -                       clock-names = "uart1";
>
>                         interrupt-parent = <&gic>;
>                         interrupts = <GIC_SHARED 26 IRQ_TYPE_LEVEL_HIGH>;
> @@ -236,7 +228,7 @@ pinmux {
>                 };
>         };
>
> -       sdhci: sdhci@1e130000 {
> +       mmc: mmc@1e130000 {
>                 status = "disabled";
>
>                 compatible = "mediatek,mt7620-mmc";
> @@ -262,8 +254,8 @@ sdhci: sdhci@1e130000 {
>                 interrupts = <GIC_SHARED 20 IRQ_TYPE_LEVEL_HIGH>;
>         };
>
> -       xhci: xhci@1e1c0000 {
> -               compatible = "mediatek,mt8173-xhci";
> +       usb: usb@1e1c0000 {
> +               compatible = "mediatek,mt8173-xhci", "mediatek,mtk-xhci";
>                 reg = <0x1e1c0000 0x1000
>                        0x1e1d0700 0x0100>;
>                 reg-names = "mac", "ippc";
> @@ -338,7 +330,7 @@ fixed-link {
>                 gmac1: mac@1 {
>                         compatible = "mediatek,eth-mac";
>                         reg = <1>;
> -                       status = "off";
> +                       status = "disabled";
>                         phy-mode = "rgmii-rxid";
>                 };
>
> @@ -346,7 +338,7 @@ mdio: mdio-bus {
>                         #address-cells = <1>;
>                         #size-cells = <0>;
>
> -                       switch0: switch0@0 {
> +                       switch0: switch@0 {
>                                 compatible = "mediatek,mt7621";
>                                 reg = <0>;
>                                 mediatek,mcm;
> @@ -362,31 +354,31 @@ ports {
>                                         #size-cells = <0>;
>
>                                         port@0 {
> -                                               status = "off";
> +                                               status = "disabled";
>                                                 reg = <0>;
>                                                 label = "lan0";
>                                         };
>
>                                         port@1 {
> -                                               status = "off";
> +                                               status = "disabled";
>                                                 reg = <1>;
>                                                 label = "lan1";
>                                         };
>
>                                         port@2 {
> -                                               status = "off";
> +                                               status = "disabled";
>                                                 reg = <2>;
>                                                 label = "lan2";
>                                         };
>
>                                         port@3 {
> -                                               status = "off";
> +                                               status = "disabled";
>                                                 reg = <3>;
>                                                 label = "lan3";
>                                         };
>
>                                         port@4 {
> -                                               status = "off";
> +                                               status = "disabled";
>                                                 reg = <4>;
>                                                 label = "lan4";
>                                         };
> --
> 2.34.1
>

Best regards,
    Sergio Paracuellos

[0]: https://elixir.bootlin.com/linux/v6.0-rc5/source/Documentation/devicetree/bindings/arm/cpus.yaml
Arınç ÜNAL Sept. 14, 2022, 10:45 a.m. UTC | #2
Hi Sergio,

On 14.09.2022 12:14, Sergio Paracuellos wrote:
> Hi Arinc,
> 
> On Wed, Sep 14, 2022 at 10:55 AM Arınç ÜNAL <arinc.unal@arinc9.com> wrote:
>>
>> Fix the dtc warnings below.
>>
>> /cpus/cpu@0: failed to match any schema with compatible: ['mips,mips1004Kc']
>> /cpus/cpu@1: failed to match any schema with compatible: ['mips,mips1004Kc']
>> uartlite@c00: $nodename:0: 'uartlite@c00' does not match '^serial(@.*)?$'
>>          From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/serial/8250.yaml
>> uartlite@c00: Unevaluated properties are not allowed ('clock-names' was unexpected)
>>          From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/serial/8250.yaml
>> sdhci@1e130000: $nodename:0: 'sdhci@1e130000' does not match '^mmc(@.*)?$'
>>          From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
>> sdhci@1e130000: Unevaluated properties are not allowed ('bus-width', 'cap-mmc-highspeed', 'cap-sd-highspeed', 'disable-wp', 'max-frequency', 'vmmc-supply', 'vqmmc-supply' were unexpected)
>>          From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
>> xhci@1e1c0000: $nodename:0: 'xhci@1e1c0000' does not match '^usb(@.*)?'
>>          From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
>> xhci@1e1c0000: compatible: ['mediatek,mt8173-xhci'] is too short
>>          From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
>> switch0@0: $nodename:0: 'switch0@0' does not match '^(ethernet-)?switch(@.*)?$'
>>          From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
>> port@1: status:0: 'off' is not one of ['okay', 'disabled', 'reserved']
>>          From schema: /home/arinc9/.local/lib/python3.10/site-packages/dtschema/schemas/dt-core.yaml
>> port@2: status:0: 'off' is not one of ['okay', 'disabled', 'reserved']
>>          From schema: /home/arinc9/.local/lib/python3.10/site-packages/dtschema/schemas/dt-core.yaml
>> port@3: status:0: 'off' is not one of ['okay', 'disabled', 'reserved']
>>          From schema: /home/arinc9/.local/lib/python3.10/site-packages/dtschema/schemas/dt-core.yaml
>>
>> - Remove "mips,mips1004Kc" compatible string from the cpu nodes. This
>> doesn't exist anywhere.
>> - Change "memc: syscon@5000" to "memc: memory-controller@5000".
>> - Change "uartlite: uartlite@c00" to "serial0: serial@c00" and remove the
>> aliases node.
>> - Remove "clock-names" from the serial0 node. The property doesn't exist on
>> the 8250.yaml schema.
>> - Change "sdhci: sdhci@1e130000" to "mmc: mmc@1e130000".
>> - Change "xhci: xhci@1e1c0000" to "usb: usb@1e1c0000".
>> - Add "mediatek,mtk-xhci" as the second compatible string on the usb node.
>> - Change "switch0: switch0@0" to "switch0: switch@0"
>> - Change "off" to "disabled" for disabled nodes.
>>
>> Remaining warnings are caused by the lack of json-schema documentation.
>>
>> /cpuintc: failed to match any schema with compatible: ['mti,cpu-interrupt-controller']
>> /palmbus@1e000000/wdt@100: failed to match any schema with compatible: ['mediatek,mt7621-wdt']
>> /palmbus@1e000000/i2c@900: failed to match any schema with compatible: ['mediatek,mt7621-i2c']
>> /palmbus@1e000000/spi@b00: failed to match any schema with compatible: ['ralink,mt7621-spi']
>> /ethernet@1e100000: failed to match any schema with compatible: ['mediatek,mt7621-eth']
>>
>> Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
>> ---
>>   .../boot/dts/ralink/mt7621-gnubee-gb-pc1.dts  |  2 +-
>>   .../boot/dts/ralink/mt7621-gnubee-gb-pc2.dts  |  2 +-
>>   arch/mips/boot/dts/ralink/mt7621.dtsi         | 32 +++++++------------
>>   3 files changed, 14 insertions(+), 22 deletions(-)
>>
>> diff --git a/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc1.dts b/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc1.dts
>> index 24eebc5a85b1..6ecb8165efe8 100644
>> --- a/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc1.dts
>> +++ b/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc1.dts
>> @@ -53,7 +53,7 @@ system {
>>          };
>>   };
>>
>> -&sdhci {
>> +&mmc {
>>          status = "okay";
>>   };
>>
>> diff --git a/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc2.dts b/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc2.dts
>> index 34006e667780..2e534ea5bab7 100644
>> --- a/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc2.dts
>> +++ b/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc2.dts
>> @@ -37,7 +37,7 @@ key-reset {
>>          };
>>   };
>>
>> -&sdhci {
>> +&mmc {
>>          status = "okay";
>>   };
>>
>> diff --git a/arch/mips/boot/dts/ralink/mt7621.dtsi b/arch/mips/boot/dts/ralink/mt7621.dtsi
>> index ee46ace0bcc1..9302bdc04510 100644
>> --- a/arch/mips/boot/dts/ralink/mt7621.dtsi
>> +++ b/arch/mips/boot/dts/ralink/mt7621.dtsi
>> @@ -15,13 +15,11 @@ cpus {
>>
>>                  cpu@0 {
>>                          device_type = "cpu";
>> -                       compatible = "mips,mips1004Kc";
>>                          reg = <0>;
>>                  };
>>
>>                  cpu@1 {
>>                          device_type = "cpu";
>> -                       compatible = "mips,mips1004Kc";
>>                          reg = <1>;
>>                  };
>>          };
> 
> Instead of removing this, since compatible is correct here, I think a
> cpus yaml file needs to be added to properly define mips CPU's but
> compatible strings using all around the sources are a bit messy. Take
> a look of how is this done for arm [0]

I did investigate the arm bindings beforehand. I've seen that some of 
the strings are also checked by code. I don't see the mips strings used 
anywhere but DTs so I had decided to remove it here. I guess we can make 
a basic binding to list the mips processor cores.

What do you think Thomas?

> 
>> @@ -33,11 +31,6 @@ cpuintc: cpuintc {
>>                  compatible = "mti,cpu-interrupt-controller";
>>          };
>>
>> -       aliases {
>> -               serial0 = &uartlite;
>> -       };
>> -
>> -
>>          mmc_fixed_3v3: regulator-3v3 {
>>                  compatible = "regulator-fixed";
>>                  regulator-name = "mmc_power";
>> @@ -110,17 +103,16 @@ i2c: i2c@900 {
>>                          pinctrl-0 = <&i2c_pins>;
>>                  };
>>
>> -               memc: syscon@5000 {
>> +               memc: memory-controller@5000 {
>>                          compatible = "mediatek,mt7621-memc", "syscon";
>>                          reg = <0x5000 0x1000>;
>>                  };
>>
> 
> I think syscon nodes need to use 'syscon' in the node name, but I am
> not 100% sure.

I've tested this patch series on my GB-PC2, it currently works fine. 
Also, DT binding for MT7621 memory controller uses memory-controller on 
the example so I guess it's fine?

Arınç
Sergio Paracuellos Sept. 15, 2022, 3:30 a.m. UTC | #3
On Wed, Sep 14, 2022 at 12:46 PM Arınç ÜNAL <arinc.unal@arinc9.com> wrote:
>
> Hi Sergio,
>
> On 14.09.2022 12:14, Sergio Paracuellos wrote:
> > Hi Arinc,
> >
> > On Wed, Sep 14, 2022 at 10:55 AM Arınç ÜNAL <arinc.unal@arinc9.com> wrote:
> >>
> >> Fix the dtc warnings below.
> >>
> >> /cpus/cpu@0: failed to match any schema with compatible: ['mips,mips1004Kc']
> >> /cpus/cpu@1: failed to match any schema with compatible: ['mips,mips1004Kc']
> >> uartlite@c00: $nodename:0: 'uartlite@c00' does not match '^serial(@.*)?$'
> >>          From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/serial/8250.yaml
> >> uartlite@c00: Unevaluated properties are not allowed ('clock-names' was unexpected)
> >>          From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/serial/8250.yaml
> >> sdhci@1e130000: $nodename:0: 'sdhci@1e130000' does not match '^mmc(@.*)?$'
> >>          From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
> >> sdhci@1e130000: Unevaluated properties are not allowed ('bus-width', 'cap-mmc-highspeed', 'cap-sd-highspeed', 'disable-wp', 'max-frequency', 'vmmc-supply', 'vqmmc-supply' were unexpected)
> >>          From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
> >> xhci@1e1c0000: $nodename:0: 'xhci@1e1c0000' does not match '^usb(@.*)?'
> >>          From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
> >> xhci@1e1c0000: compatible: ['mediatek,mt8173-xhci'] is too short
> >>          From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
> >> switch0@0: $nodename:0: 'switch0@0' does not match '^(ethernet-)?switch(@.*)?$'
> >>          From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> >> port@1: status:0: 'off' is not one of ['okay', 'disabled', 'reserved']
> >>          From schema: /home/arinc9/.local/lib/python3.10/site-packages/dtschema/schemas/dt-core.yaml
> >> port@2: status:0: 'off' is not one of ['okay', 'disabled', 'reserved']
> >>          From schema: /home/arinc9/.local/lib/python3.10/site-packages/dtschema/schemas/dt-core.yaml
> >> port@3: status:0: 'off' is not one of ['okay', 'disabled', 'reserved']
> >>          From schema: /home/arinc9/.local/lib/python3.10/site-packages/dtschema/schemas/dt-core.yaml
> >>
> >> - Remove "mips,mips1004Kc" compatible string from the cpu nodes. This
> >> doesn't exist anywhere.
> >> - Change "memc: syscon@5000" to "memc: memory-controller@5000".
> >> - Change "uartlite: uartlite@c00" to "serial0: serial@c00" and remove the
> >> aliases node.
> >> - Remove "clock-names" from the serial0 node. The property doesn't exist on
> >> the 8250.yaml schema.
> >> - Change "sdhci: sdhci@1e130000" to "mmc: mmc@1e130000".
> >> - Change "xhci: xhci@1e1c0000" to "usb: usb@1e1c0000".
> >> - Add "mediatek,mtk-xhci" as the second compatible string on the usb node.
> >> - Change "switch0: switch0@0" to "switch0: switch@0"
> >> - Change "off" to "disabled" for disabled nodes.
> >>
> >> Remaining warnings are caused by the lack of json-schema documentation.
> >>
> >> /cpuintc: failed to match any schema with compatible: ['mti,cpu-interrupt-controller']
> >> /palmbus@1e000000/wdt@100: failed to match any schema with compatible: ['mediatek,mt7621-wdt']
> >> /palmbus@1e000000/i2c@900: failed to match any schema with compatible: ['mediatek,mt7621-i2c']
> >> /palmbus@1e000000/spi@b00: failed to match any schema with compatible: ['ralink,mt7621-spi']
> >> /ethernet@1e100000: failed to match any schema with compatible: ['mediatek,mt7621-eth']
> >>
> >> Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
> >> ---
> >>   .../boot/dts/ralink/mt7621-gnubee-gb-pc1.dts  |  2 +-
> >>   .../boot/dts/ralink/mt7621-gnubee-gb-pc2.dts  |  2 +-
> >>   arch/mips/boot/dts/ralink/mt7621.dtsi         | 32 +++++++------------
> >>   3 files changed, 14 insertions(+), 22 deletions(-)
> >>
> >> diff --git a/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc1.dts b/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc1.dts
> >> index 24eebc5a85b1..6ecb8165efe8 100644
> >> --- a/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc1.dts
> >> +++ b/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc1.dts
> >> @@ -53,7 +53,7 @@ system {
> >>          };
> >>   };
> >>
> >> -&sdhci {
> >> +&mmc {
> >>          status = "okay";
> >>   };
> >>
> >> diff --git a/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc2.dts b/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc2.dts
> >> index 34006e667780..2e534ea5bab7 100644
> >> --- a/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc2.dts
> >> +++ b/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc2.dts
> >> @@ -37,7 +37,7 @@ key-reset {
> >>          };
> >>   };
> >>
> >> -&sdhci {
> >> +&mmc {
> >>          status = "okay";
> >>   };
> >>
> >> diff --git a/arch/mips/boot/dts/ralink/mt7621.dtsi b/arch/mips/boot/dts/ralink/mt7621.dtsi
> >> index ee46ace0bcc1..9302bdc04510 100644
> >> --- a/arch/mips/boot/dts/ralink/mt7621.dtsi
> >> +++ b/arch/mips/boot/dts/ralink/mt7621.dtsi
> >> @@ -15,13 +15,11 @@ cpus {
> >>
> >>                  cpu@0 {
> >>                          device_type = "cpu";
> >> -                       compatible = "mips,mips1004Kc";
> >>                          reg = <0>;
> >>                  };
> >>
> >>                  cpu@1 {
> >>                          device_type = "cpu";
> >> -                       compatible = "mips,mips1004Kc";
> >>                          reg = <1>;
> >>                  };
> >>          };
> >
> > Instead of removing this, since compatible is correct here, I think a
> > cpus yaml file needs to be added to properly define mips CPU's but
> > compatible strings using all around the sources are a bit messy. Take
> > a look of how is this done for arm [0]
>
> I did investigate the arm bindings beforehand. I've seen that some of
> the strings are also checked by code. I don't see the mips strings used
> anywhere but DTs so I had decided to remove it here. I guess we can make
> a basic binding to list the mips processor cores.

At the very least I do think a compatible string should exist for cpu
nodes :). And because of the mess with MIPS cpu nodes in dts files all
around I think we should only add this 'compatible' as a requirement
and mark 'reg' and 'device_type' as optionals.

>
> What do you think Thomas?
>
> >
> >> @@ -33,11 +31,6 @@ cpuintc: cpuintc {
> >>                  compatible = "mti,cpu-interrupt-controller";
> >>          };
> >>
> >> -       aliases {
> >> -               serial0 = &uartlite;
> >> -       };
> >> -
> >> -
> >>          mmc_fixed_3v3: regulator-3v3 {
> >>                  compatible = "regulator-fixed";
> >>                  regulator-name = "mmc_power";
> >> @@ -110,17 +103,16 @@ i2c: i2c@900 {
> >>                          pinctrl-0 = <&i2c_pins>;
> >>                  };
> >>
> >> -               memc: syscon@5000 {
> >> +               memc: memory-controller@5000 {
> >>                          compatible = "mediatek,mt7621-memc", "syscon";
> >>                          reg = <0x5000 0x1000>;
> >>                  };
> >>
> >
> > I think syscon nodes need to use 'syscon' in the node name, but I am
> > not 100% sure.
>
> I've tested this patch series on my GB-PC2, it currently works fine.
> Also, DT binding for MT7621 memory controller uses memory-controller on
> the example so I guess it's fine?

I know that works fine but when the node is a syscon it is good to
have that syscon in the node name (I don't know if having it is a rule
or something, I guess no). In any case I agree that binding and dts
should match.

Best regards,
    Sergio Paracuellos
>
> Arınç
Sergio Paracuellos Sept. 15, 2022, 5:59 a.m. UTC | #4
On Thu, Sep 15, 2022 at 5:30 AM Sergio Paracuellos
<sergio.paracuellos@gmail.com> wrote:
>
> On Wed, Sep 14, 2022 at 12:46 PM Arınç ÜNAL <arinc.unal@arinc9.com> wrote:
> >
> > Hi Sergio,
> >
> > On 14.09.2022 12:14, Sergio Paracuellos wrote:
> > > Hi Arinc,
> > >
> > > On Wed, Sep 14, 2022 at 10:55 AM Arınç ÜNAL <arinc.unal@arinc9.com> wrote:
> > >>
> > >> Fix the dtc warnings below.
> > >>
> > >> /cpus/cpu@0: failed to match any schema with compatible: ['mips,mips1004Kc']
> > >> /cpus/cpu@1: failed to match any schema with compatible: ['mips,mips1004Kc']
> > >> uartlite@c00: $nodename:0: 'uartlite@c00' does not match '^serial(@.*)?$'
> > >>          From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/serial/8250.yaml
> > >> uartlite@c00: Unevaluated properties are not allowed ('clock-names' was unexpected)
> > >>          From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/serial/8250.yaml
> > >> sdhci@1e130000: $nodename:0: 'sdhci@1e130000' does not match '^mmc(@.*)?$'
> > >>          From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
> > >> sdhci@1e130000: Unevaluated properties are not allowed ('bus-width', 'cap-mmc-highspeed', 'cap-sd-highspeed', 'disable-wp', 'max-frequency', 'vmmc-supply', 'vqmmc-supply' were unexpected)
> > >>          From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
> > >> xhci@1e1c0000: $nodename:0: 'xhci@1e1c0000' does not match '^usb(@.*)?'
> > >>          From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
> > >> xhci@1e1c0000: compatible: ['mediatek,mt8173-xhci'] is too short
> > >>          From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
> > >> switch0@0: $nodename:0: 'switch0@0' does not match '^(ethernet-)?switch(@.*)?$'
> > >>          From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> > >> port@1: status:0: 'off' is not one of ['okay', 'disabled', 'reserved']
> > >>          From schema: /home/arinc9/.local/lib/python3.10/site-packages/dtschema/schemas/dt-core.yaml
> > >> port@2: status:0: 'off' is not one of ['okay', 'disabled', 'reserved']
> > >>          From schema: /home/arinc9/.local/lib/python3.10/site-packages/dtschema/schemas/dt-core.yaml
> > >> port@3: status:0: 'off' is not one of ['okay', 'disabled', 'reserved']
> > >>          From schema: /home/arinc9/.local/lib/python3.10/site-packages/dtschema/schemas/dt-core.yaml
> > >>
> > >> - Remove "mips,mips1004Kc" compatible string from the cpu nodes. This
> > >> doesn't exist anywhere.
> > >> - Change "memc: syscon@5000" to "memc: memory-controller@5000".
> > >> - Change "uartlite: uartlite@c00" to "serial0: serial@c00" and remove the
> > >> aliases node.
> > >> - Remove "clock-names" from the serial0 node. The property doesn't exist on
> > >> the 8250.yaml schema.
> > >> - Change "sdhci: sdhci@1e130000" to "mmc: mmc@1e130000".
> > >> - Change "xhci: xhci@1e1c0000" to "usb: usb@1e1c0000".
> > >> - Add "mediatek,mtk-xhci" as the second compatible string on the usb node.
> > >> - Change "switch0: switch0@0" to "switch0: switch@0"
> > >> - Change "off" to "disabled" for disabled nodes.
> > >>
> > >> Remaining warnings are caused by the lack of json-schema documentation.
> > >>
> > >> /cpuintc: failed to match any schema with compatible: ['mti,cpu-interrupt-controller']
> > >> /palmbus@1e000000/wdt@100: failed to match any schema with compatible: ['mediatek,mt7621-wdt']
> > >> /palmbus@1e000000/i2c@900: failed to match any schema with compatible: ['mediatek,mt7621-i2c']
> > >> /palmbus@1e000000/spi@b00: failed to match any schema with compatible: ['ralink,mt7621-spi']
> > >> /ethernet@1e100000: failed to match any schema with compatible: ['mediatek,mt7621-eth']
> > >>
> > >> Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
> > >> ---
> > >>   .../boot/dts/ralink/mt7621-gnubee-gb-pc1.dts  |  2 +-
> > >>   .../boot/dts/ralink/mt7621-gnubee-gb-pc2.dts  |  2 +-
> > >>   arch/mips/boot/dts/ralink/mt7621.dtsi         | 32 +++++++------------
> > >>   3 files changed, 14 insertions(+), 22 deletions(-)
> > >>
> > >> diff --git a/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc1.dts b/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc1.dts
> > >> index 24eebc5a85b1..6ecb8165efe8 100644
> > >> --- a/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc1.dts
> > >> +++ b/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc1.dts
> > >> @@ -53,7 +53,7 @@ system {
> > >>          };
> > >>   };
> > >>
> > >> -&sdhci {
> > >> +&mmc {
> > >>          status = "okay";
> > >>   };
> > >>
> > >> diff --git a/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc2.dts b/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc2.dts
> > >> index 34006e667780..2e534ea5bab7 100644
> > >> --- a/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc2.dts
> > >> +++ b/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc2.dts
> > >> @@ -37,7 +37,7 @@ key-reset {
> > >>          };
> > >>   };
> > >>
> > >> -&sdhci {
> > >> +&mmc {
> > >>          status = "okay";
> > >>   };
> > >>
> > >> diff --git a/arch/mips/boot/dts/ralink/mt7621.dtsi b/arch/mips/boot/dts/ralink/mt7621.dtsi
> > >> index ee46ace0bcc1..9302bdc04510 100644
> > >> --- a/arch/mips/boot/dts/ralink/mt7621.dtsi
> > >> +++ b/arch/mips/boot/dts/ralink/mt7621.dtsi
> > >> @@ -15,13 +15,11 @@ cpus {
> > >>
> > >>                  cpu@0 {
> > >>                          device_type = "cpu";
> > >> -                       compatible = "mips,mips1004Kc";
> > >>                          reg = <0>;
> > >>                  };
> > >>
> > >>                  cpu@1 {
> > >>                          device_type = "cpu";
> > >> -                       compatible = "mips,mips1004Kc";
> > >>                          reg = <1>;
> > >>                  };
> > >>          };
> > >
> > > Instead of removing this, since compatible is correct here, I think a
> > > cpus yaml file needs to be added to properly define mips CPU's but
> > > compatible strings using all around the sources are a bit messy. Take
> > > a look of how is this done for arm [0]
> >
> > I did investigate the arm bindings beforehand. I've seen that some of
> > the strings are also checked by code. I don't see the mips strings used
> > anywhere but DTs so I had decided to remove it here. I guess we can make
> > a basic binding to list the mips processor cores.
>
> At the very least I do think a compatible string should exist for cpu
> nodes :). And because of the mess with MIPS cpu nodes in dts files all
> around I think we should only add this 'compatible' as a requirement
> and mark 'reg' and 'device_type' as optionals.

I have just sent a patch to start from containing all compatible
strings I have found in the 'arch/mips/boot/dts' folder:

https://lore.kernel.org/linux-devicetree/20220915055514.463241-1-sergio.paracuellos@gmail.com/T/#u

>
> >
> > What do you think Thomas?
> >
> > >
> > >> @@ -33,11 +31,6 @@ cpuintc: cpuintc {
> > >>                  compatible = "mti,cpu-interrupt-controller";
> > >>          };
> > >>
> > >> -       aliases {
> > >> -               serial0 = &uartlite;
> > >> -       };
> > >> -
> > >> -
> > >>          mmc_fixed_3v3: regulator-3v3 {
> > >>                  compatible = "regulator-fixed";
> > >>                  regulator-name = "mmc_power";
> > >> @@ -110,17 +103,16 @@ i2c: i2c@900 {
> > >>                          pinctrl-0 = <&i2c_pins>;
> > >>                  };
> > >>
> > >> -               memc: syscon@5000 {
> > >> +               memc: memory-controller@5000 {
> > >>                          compatible = "mediatek,mt7621-memc", "syscon";
> > >>                          reg = <0x5000 0x1000>;
> > >>                  };
> > >>
> > >
> > > I think syscon nodes need to use 'syscon' in the node name, but I am
> > > not 100% sure.
> >
> > I've tested this patch series on my GB-PC2, it currently works fine.
> > Also, DT binding for MT7621 memory controller uses memory-controller on
> > the example so I guess it's fine?
>
> I know that works fine but when the node is a syscon it is good to
> have that syscon in the node name (I don't know if having it is a rule
> or something, I guess no). In any case I agree that binding and dts
> should match.
>
> Best regards,
>     Sergio Paracuellos
> >
> > Arınç

Best regards,
    Sergio Paracuellos
Arınç ÜNAL Sept. 15, 2022, 6:24 a.m. UTC | #5
On 15.09.2022 08:59, Sergio Paracuellos wrote:
> On Thu, Sep 15, 2022 at 5:30 AM Sergio Paracuellos
> <sergio.paracuellos@gmail.com> wrote:
>>
>> On Wed, Sep 14, 2022 at 12:46 PM Arınç ÜNAL <arinc.unal@arinc9.com> wrote:
>>>
>>> Hi Sergio,
>>>
>>> On 14.09.2022 12:14, Sergio Paracuellos wrote:
>>>> Hi Arinc,
>>>>
>>>> On Wed, Sep 14, 2022 at 10:55 AM Arınç ÜNAL <arinc.unal@arinc9.com> wrote:
>>>>>
>>>>> Fix the dtc warnings below.
>>>>>
>>>>> /cpus/cpu@0: failed to match any schema with compatible: ['mips,mips1004Kc']
>>>>> /cpus/cpu@1: failed to match any schema with compatible: ['mips,mips1004Kc']
>>>>> uartlite@c00: $nodename:0: 'uartlite@c00' does not match '^serial(@.*)?$'
>>>>>           From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/serial/8250.yaml
>>>>> uartlite@c00: Unevaluated properties are not allowed ('clock-names' was unexpected)
>>>>>           From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/serial/8250.yaml
>>>>> sdhci@1e130000: $nodename:0: 'sdhci@1e130000' does not match '^mmc(@.*)?$'
>>>>>           From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
>>>>> sdhci@1e130000: Unevaluated properties are not allowed ('bus-width', 'cap-mmc-highspeed', 'cap-sd-highspeed', 'disable-wp', 'max-frequency', 'vmmc-supply', 'vqmmc-supply' were unexpected)
>>>>>           From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/mmc/mtk-sd.yaml
>>>>> xhci@1e1c0000: $nodename:0: 'xhci@1e1c0000' does not match '^usb(@.*)?'
>>>>>           From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
>>>>> xhci@1e1c0000: compatible: ['mediatek,mt8173-xhci'] is too short
>>>>>           From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
>>>>> switch0@0: $nodename:0: 'switch0@0' does not match '^(ethernet-)?switch(@.*)?$'
>>>>>           From schema: /home/arinc9/Documents/linux/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
>>>>> port@1: status:0: 'off' is not one of ['okay', 'disabled', 'reserved']
>>>>>           From schema: /home/arinc9/.local/lib/python3.10/site-packages/dtschema/schemas/dt-core.yaml
>>>>> port@2: status:0: 'off' is not one of ['okay', 'disabled', 'reserved']
>>>>>           From schema: /home/arinc9/.local/lib/python3.10/site-packages/dtschema/schemas/dt-core.yaml
>>>>> port@3: status:0: 'off' is not one of ['okay', 'disabled', 'reserved']
>>>>>           From schema: /home/arinc9/.local/lib/python3.10/site-packages/dtschema/schemas/dt-core.yaml
>>>>>
>>>>> - Remove "mips,mips1004Kc" compatible string from the cpu nodes. This
>>>>> doesn't exist anywhere.
>>>>> - Change "memc: syscon@5000" to "memc: memory-controller@5000".
>>>>> - Change "uartlite: uartlite@c00" to "serial0: serial@c00" and remove the
>>>>> aliases node.
>>>>> - Remove "clock-names" from the serial0 node. The property doesn't exist on
>>>>> the 8250.yaml schema.
>>>>> - Change "sdhci: sdhci@1e130000" to "mmc: mmc@1e130000".
>>>>> - Change "xhci: xhci@1e1c0000" to "usb: usb@1e1c0000".
>>>>> - Add "mediatek,mtk-xhci" as the second compatible string on the usb node.
>>>>> - Change "switch0: switch0@0" to "switch0: switch@0"
>>>>> - Change "off" to "disabled" for disabled nodes.
>>>>>
>>>>> Remaining warnings are caused by the lack of json-schema documentation.
>>>>>
>>>>> /cpuintc: failed to match any schema with compatible: ['mti,cpu-interrupt-controller']
>>>>> /palmbus@1e000000/wdt@100: failed to match any schema with compatible: ['mediatek,mt7621-wdt']
>>>>> /palmbus@1e000000/i2c@900: failed to match any schema with compatible: ['mediatek,mt7621-i2c']
>>>>> /palmbus@1e000000/spi@b00: failed to match any schema with compatible: ['ralink,mt7621-spi']
>>>>> /ethernet@1e100000: failed to match any schema with compatible: ['mediatek,mt7621-eth']
>>>>>
>>>>> Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
>>>>> ---
>>>>>    .../boot/dts/ralink/mt7621-gnubee-gb-pc1.dts  |  2 +-
>>>>>    .../boot/dts/ralink/mt7621-gnubee-gb-pc2.dts  |  2 +-
>>>>>    arch/mips/boot/dts/ralink/mt7621.dtsi         | 32 +++++++------------
>>>>>    3 files changed, 14 insertions(+), 22 deletions(-)
>>>>>
>>>>> diff --git a/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc1.dts b/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc1.dts
>>>>> index 24eebc5a85b1..6ecb8165efe8 100644
>>>>> --- a/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc1.dts
>>>>> +++ b/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc1.dts
>>>>> @@ -53,7 +53,7 @@ system {
>>>>>           };
>>>>>    };
>>>>>
>>>>> -&sdhci {
>>>>> +&mmc {
>>>>>           status = "okay";
>>>>>    };
>>>>>
>>>>> diff --git a/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc2.dts b/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc2.dts
>>>>> index 34006e667780..2e534ea5bab7 100644
>>>>> --- a/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc2.dts
>>>>> +++ b/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc2.dts
>>>>> @@ -37,7 +37,7 @@ key-reset {
>>>>>           };
>>>>>    };
>>>>>
>>>>> -&sdhci {
>>>>> +&mmc {
>>>>>           status = "okay";
>>>>>    };
>>>>>
>>>>> diff --git a/arch/mips/boot/dts/ralink/mt7621.dtsi b/arch/mips/boot/dts/ralink/mt7621.dtsi
>>>>> index ee46ace0bcc1..9302bdc04510 100644
>>>>> --- a/arch/mips/boot/dts/ralink/mt7621.dtsi
>>>>> +++ b/arch/mips/boot/dts/ralink/mt7621.dtsi
>>>>> @@ -15,13 +15,11 @@ cpus {
>>>>>
>>>>>                   cpu@0 {
>>>>>                           device_type = "cpu";
>>>>> -                       compatible = "mips,mips1004Kc";
>>>>>                           reg = <0>;
>>>>>                   };
>>>>>
>>>>>                   cpu@1 {
>>>>>                           device_type = "cpu";
>>>>> -                       compatible = "mips,mips1004Kc";
>>>>>                           reg = <1>;
>>>>>                   };
>>>>>           };
>>>>
>>>> Instead of removing this, since compatible is correct here, I think a
>>>> cpus yaml file needs to be added to properly define mips CPU's but
>>>> compatible strings using all around the sources are a bit messy. Take
>>>> a look of how is this done for arm [0]
>>>
>>> I did investigate the arm bindings beforehand. I've seen that some of
>>> the strings are also checked by code. I don't see the mips strings used
>>> anywhere but DTs so I had decided to remove it here. I guess we can make
>>> a basic binding to list the mips processor cores.
>>
>> At the very least I do think a compatible string should exist for cpu
>> nodes :). And because of the mess with MIPS cpu nodes in dts files all
>> around I think we should only add this 'compatible' as a requirement
>> and mark 'reg' and 'device_type' as optionals.
> 
> I have just sent a patch to start from containing all compatible
> strings I have found in the 'arch/mips/boot/dts' folder:
> 
> https://lore.kernel.org/linux-devicetree/20220915055514.463241-1-sergio.paracuellos@gmail.com/T/#u

Awesome, I'll keep the string on v2.

> 
>>
>>>
>>> What do you think Thomas?
>>>
>>>>
>>>>> @@ -33,11 +31,6 @@ cpuintc: cpuintc {
>>>>>                   compatible = "mti,cpu-interrupt-controller";
>>>>>           };
>>>>>
>>>>> -       aliases {
>>>>> -               serial0 = &uartlite;
>>>>> -       };
>>>>> -
>>>>> -
>>>>>           mmc_fixed_3v3: regulator-3v3 {
>>>>>                   compatible = "regulator-fixed";
>>>>>                   regulator-name = "mmc_power";
>>>>> @@ -110,17 +103,16 @@ i2c: i2c@900 {
>>>>>                           pinctrl-0 = <&i2c_pins>;
>>>>>                   };
>>>>>
>>>>> -               memc: syscon@5000 {
>>>>> +               memc: memory-controller@5000 {
>>>>>                           compatible = "mediatek,mt7621-memc", "syscon";
>>>>>                           reg = <0x5000 0x1000>;
>>>>>                   };
>>>>>
>>>>
>>>> I think syscon nodes need to use 'syscon' in the node name, but I am
>>>> not 100% sure.
>>>
>>> I've tested this patch series on my GB-PC2, it currently works fine.
>>> Also, DT binding for MT7621 memory controller uses memory-controller on
>>> the example so I guess it's fine?
>>
>> I know that works fine but when the node is a syscon it is good to
>> have that syscon in the node name (I don't know if having it is a rule
>> or something, I guess no). In any case I agree that binding and dts
>> should match.

Understood, I'll keep it syscon in v2.

Arınç
diff mbox series

Patch

diff --git a/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc1.dts b/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc1.dts
index 24eebc5a85b1..6ecb8165efe8 100644
--- a/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc1.dts
+++ b/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc1.dts
@@ -53,7 +53,7 @@  system {
 	};
 };
 
-&sdhci {
+&mmc {
 	status = "okay";
 };
 
diff --git a/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc2.dts b/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc2.dts
index 34006e667780..2e534ea5bab7 100644
--- a/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc2.dts
+++ b/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc2.dts
@@ -37,7 +37,7 @@  key-reset {
 	};
 };
 
-&sdhci {
+&mmc {
 	status = "okay";
 };
 
diff --git a/arch/mips/boot/dts/ralink/mt7621.dtsi b/arch/mips/boot/dts/ralink/mt7621.dtsi
index ee46ace0bcc1..9302bdc04510 100644
--- a/arch/mips/boot/dts/ralink/mt7621.dtsi
+++ b/arch/mips/boot/dts/ralink/mt7621.dtsi
@@ -15,13 +15,11 @@  cpus {
 
 		cpu@0 {
 			device_type = "cpu";
-			compatible = "mips,mips1004Kc";
 			reg = <0>;
 		};
 
 		cpu@1 {
 			device_type = "cpu";
-			compatible = "mips,mips1004Kc";
 			reg = <1>;
 		};
 	};
@@ -33,11 +31,6 @@  cpuintc: cpuintc {
 		compatible = "mti,cpu-interrupt-controller";
 	};
 
-	aliases {
-		serial0 = &uartlite;
-	};
-
-
 	mmc_fixed_3v3: regulator-3v3 {
 		compatible = "regulator-fixed";
 		regulator-name = "mmc_power";
@@ -110,17 +103,16 @@  i2c: i2c@900 {
 			pinctrl-0 = <&i2c_pins>;
 		};
 
-		memc: syscon@5000 {
+		memc: memory-controller@5000 {
 			compatible = "mediatek,mt7621-memc", "syscon";
 			reg = <0x5000 0x1000>;
 		};
 
-		uartlite: uartlite@c00 {
+		serial0: serial@c00 {
 			compatible = "ns16550a";
 			reg = <0xc00 0x100>;
 
 			clocks = <&sysc MT7621_CLK_UART1>;
-			clock-names = "uart1";
 
 			interrupt-parent = <&gic>;
 			interrupts = <GIC_SHARED 26 IRQ_TYPE_LEVEL_HIGH>;
@@ -236,7 +228,7 @@  pinmux {
 		};
 	};
 
-	sdhci: sdhci@1e130000 {
+	mmc: mmc@1e130000 {
 		status = "disabled";
 
 		compatible = "mediatek,mt7620-mmc";
@@ -262,8 +254,8 @@  sdhci: sdhci@1e130000 {
 		interrupts = <GIC_SHARED 20 IRQ_TYPE_LEVEL_HIGH>;
 	};
 
-	xhci: xhci@1e1c0000 {
-		compatible = "mediatek,mt8173-xhci";
+	usb: usb@1e1c0000 {
+		compatible = "mediatek,mt8173-xhci", "mediatek,mtk-xhci";
 		reg = <0x1e1c0000 0x1000
 		       0x1e1d0700 0x0100>;
 		reg-names = "mac", "ippc";
@@ -338,7 +330,7 @@  fixed-link {
 		gmac1: mac@1 {
 			compatible = "mediatek,eth-mac";
 			reg = <1>;
-			status = "off";
+			status = "disabled";
 			phy-mode = "rgmii-rxid";
 		};
 
@@ -346,7 +338,7 @@  mdio: mdio-bus {
 			#address-cells = <1>;
 			#size-cells = <0>;
 
-			switch0: switch0@0 {
+			switch0: switch@0 {
 				compatible = "mediatek,mt7621";
 				reg = <0>;
 				mediatek,mcm;
@@ -362,31 +354,31 @@  ports {
 					#size-cells = <0>;
 
 					port@0 {
-						status = "off";
+						status = "disabled";
 						reg = <0>;
 						label = "lan0";
 					};
 
 					port@1 {
-						status = "off";
+						status = "disabled";
 						reg = <1>;
 						label = "lan1";
 					};
 
 					port@2 {
-						status = "off";
+						status = "disabled";
 						reg = <2>;
 						label = "lan2";
 					};
 
 					port@3 {
-						status = "off";
+						status = "disabled";
 						reg = <3>;
 						label = "lan3";
 					};
 
 					port@4 {
-						status = "off";
+						status = "disabled";
 						reg = <4>;
 						label = "lan4";
 					};