Re: [PATCH] schemas: pci-bus: make reg optional for Marvell PCI controllers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Tue, Aug 23, 2022 at 3:00 PM Andrew Lunn <andrew@xxxxxxx> wrote:
>
> Marvell devices have PCE endpoints, but no PCI controller. The driver
> provides an emulated PCI controller. As such, it does not have a reg
> property.
>
> Signed-off-by: Andrew Lunn <andrew@xxxxxxx>
> ---
>
> I've not posted the conversion of the Marvell PCI driver from .txt to
> .yaml yet. When i do, i will need something like this.
>
> dtschema/schemas/pci/pci-bus.yaml | 15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/dtschema/schemas/pci/pci-bus.yaml b/dtschema/schemas/pci/pci-bus.yaml
> index 31bc1b9..0481bf6 100644
> --- a/dtschema/schemas/pci/pci-bus.yaml
> +++ b/dtschema/schemas/pci/pci-bus.yaml
> @@ -178,10 +178,23 @@ patternProperties:
>  required:
>    - device_type
>    - ranges
> -  - reg
>    - "#address-cells"
>    - "#size-cells"
>
> +if:
> +  not:
> +    properties:
> +      compatible:

This will also be true if compatible is not present which makes the 'if' false.

I think I'd just skip all this and just drop reg as required. There's
pending work to split pci-bus.yaml into host bridge,PCI-to-PCI bridge,
and PCI device schemas, so we can make it required for PCI devices and
bridges, but not host bridges which I think would work for you.

> +        contains:
> +          enum:
> +            - marvell,armada-370-pcie
> +            - marvell,armada-xp-pcie
> +            - marvell,dove-pcie
> +            - marvell,kirkwood-pcie
> +then:
> +  required:
> +    - reg
> +
>  dependentRequired:
>    msi-map-mask: [ msi-map ]
>
> --
> 2.37.2
>



[Index of Archives]     [Device Tree]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Photos]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]

  Powered by Linux