dt-bindings: generic-ehci.yaml doesn't work well with usb-hcd.yaml
Rob Herring
robh at kernel.org
Tue Aug 23 12:54:59 PDT 2022
On Thu, Jul 21, 2022 at 4:14 AM Rafał Miłecki <rafal at milecki.pl> wrote:
>
> Hi,
>
> I'm trying to fix ARCH_BCM_5301X=y + "dtbs_check" error:
>
> arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dtb: usb at 21000: '#address-cells', '#size-cells', '#usb-cells', 'port at 1', 'port at 2' do not match any of the regexes: 'pinctrl-[0-9]+'
> From schema: Documentation/devicetree/bindings/usb/generic-ehci.yaml
>
> that comes from:
>
> usb at 21000 {
> #usb-cells = <0>;
>
> compatible = "generic-ehci";
> reg = <0x00021000 0x1000>;
> interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>;
> phys = <&usb2_phy>;
>
> #address-cells = <1>;
> #size-cells = <0>;
>
> ehci_port1: port at 1 {
I think the issue is usb-device.yaml says 'compatible' is required.
> reg = <1>;
> #trigger-source-cells = <0>;
> };
>
> ehci_port2: port at 2 {
> reg = <2>;
> #trigger-source-cells = <0>;
> };
> };
>
> ##########
>
> If you check Documentation/devicetree/bindings/usb/generic-ehci.yaml it does:
>
> allOf:
> - $ref: "usb-hcd.yaml"
>
>
> In the usb-hcd.yaml there is:
>
> properties:
> "#address-cells":
> const: 1
>
> "#size-cells":
> const: 0
>
> patternProperties:
> "^.*@[0-9a-f]{1,2}$":
> description: The hard wired USB devices
> type: object
> $ref: /schemas/usb/usb-device.yaml
>
> ##########
>
> So all looks good at first sight. I guess it's some problem with $ref /
> additionalProperties / unevaluatedProperties.
>
> I thought that generic-ehci.yaml should do:
> unevaluatedProperties: false
> instead of:
> additionalProperties: false
Yes, and upstream does now.
>
> but that doesn't help:
> arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dtb: usb at 21000: Unevaluated properties are not allowed ('#usb-cells', '#address-cells', '#size-cells', 'port at 1', 'port at 2' were unexpected)
> From schema: Documentation/devicetree/bindings/usb/generic-ehci.yaml
You will see unevaluated properties warning if any of the listed
properties failed validation. I added your child nodes to the example
and got:
/home/rob/proj/git/linux-dt/.build-arm64/Documentation/devicetree/bindings/usb/generic-ehci.example.dtb:
usb at 1c14000: port at 1: 'compatible' is a required property
From schema:
/home/rob/proj/git/linux-dt/Documentation/devicetree/bindings/usb/generic-ehci.yaml
/home/rob/proj/git/linux-dt/.build-arm64/Documentation/devicetree/bindings/usb/generic-ehci.example.dtb:
usb at 1c14000: port at 2: 'compatible' is a required property
From schema:
/home/rob/proj/git/linux-dt/Documentation/devicetree/bindings/usb/generic-ehci.yaml
/home/rob/proj/git/linux-dt/.build-arm64/Documentation/devicetree/bindings/usb/generic-ehci.example.dtb:
usb at 1c14000: Unevaluated properties are not allowed ('#address-cells',
'#size-cells', 'port at 1', 'port at 2' were unexpected)
From schema:
/home/rob/proj/git/linux-dt/Documentation/devicetree/bindings/usb/generic-ehci.yaml
Rob
More information about the linux-arm-kernel
mailing list