Re: [PATCH v9 1/2] dt-bindings: usb: cdns3: Add cdns,cdnsp compatible string

From: Conor Dooley

Date: Thu May 21 2026 - 15:59:29 EST


On Thu, May 21, 2026 at 10:16:23AM +0200, Pawel Laszczak via B4 Relay wrote:
> From: Pawel Laszczak <pawell@xxxxxxxxxxx>
>
> Introduce a new generic fallback compatible string 'cdns,cdnsp' for
> Cadence USBSSP controllers to support hardware configurations where
> the Dual-Role Device (DRD) register block is missing or inaccessible.
>
> Following the maintainer's feedback, avoid generic property-like naming
> (such as "-no-drd") and use a clean generic fallback. To keep the schema
> resource-driven and strictly validated, define a two-string compatible
> matrix using an empty schema ({}) wildcard. This allows future vendor
> SoC compatibles to be prepended while safely falling back to the 2-resource
> USBSSP configuration.
>
> When 'cdns,cdnsp' is matched:
> - The 'otg' register and interrupt resources are not required.
> - The 'reg' and 'interrupts' properties are restricted to 2 items
> (host and device).
> - 'dr_mode' must be explicitly set to either 'host' or 'peripheral'.
>
> The standard 'cdns,usb3' compatible remains unchanged, maintaining
> backward compatibility by requiring all 3 resource sets (otg, host, dev).
>
> Signed-off-by: Pawel Laszczak <pawell@xxxxxxxxxxx>
> ---
> v9:
> - Dropped the "cdns,cdnsp-no-drd" string to avoid generic property-like
> naming as requested by Conor.
> - Introduced the clean generic fallback "cdns,cdnsp".
>
> v8:
> - Update commit message to reflect schema changes.
> - Removed 'cdns,no-drd' boolean property as per Rob Herring's suggestion.
> - Introduced a new compatible string 'cdns,cdnsp-no-drd' for controller
> variants that lack the DRD/OTG register block.
>
> v7:
> - Rename 'no_drd' to 'cdns,no-drd'.
> - Update commit message to reflect property renaming and schema changes.
> - Simplify 'reg-names' using a single enum.
> - Revert 'interrupt-names' to a list of constants.
> - Move 'reg' item descriptions to if/else blocks for accuracy.
> - Clean up 'if/then' logic (remove redundant checks).
> - Add explicit 'items' list for 'interrupt-names' in the 'else' block.
>
> v6:
> - Fixed validation error for 'interrupt-names' by correcting
> the items definition.
> - Adjusted 'minItems'/'maxItems' to properly support the optional
> 'wakeup' interrupt.
> - Fixed 'too long' schema error in examples.
>
> v5:
> - Implemented strict conditional validation using if-then-else logic.
> - Enforced 2 register/interrupt items and required 'dr_mode'
> (host or peripheral) when 'no_drd' is present.
> - Enforced the standard 3 register/interrupt items (otg, host, dev)
> when 'no_drd' is absent to ensure backward compatibility.
> - Updated 'reg-names' and 'interrupt-names' to use enums in the main
> properties section to support flexible resource ordering during
> validation.
> ---
> ---
> .../devicetree/bindings/usb/cdns,usb3.yaml | 63 ++++++++++++++++++----
> 1 file changed, 53 insertions(+), 10 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/usb/cdns,usb3.yaml b/Documentation/devicetree/bindings/usb/cdns,usb3.yaml
> index 2d95fb7321af..e8082c5c05a2 100644
> --- a/Documentation/devicetree/bindings/usb/cdns,usb3.yaml
> +++ b/Documentation/devicetree/bindings/usb/cdns,usb3.yaml
> @@ -17,22 +17,24 @@ description:
>
> properties:
> compatible:
> - const: cdns,usb3
> + oneOf:
> + - const: cdns,usb3
> + - items:
> + - {}
> + - const: cdns,cdnsp

I think this is reasonable now. If you respin again, could you add a
comment here to the cdnsp case to explain what it represents, unless
"cdnsp" will be really obvious to anyone who has this IP in their
device?
Otherwise,
Acked-by: Conor Dooley <conor.dooley@xxxxxxxxxxxxx>
pw-bot: not-applicable

Cheers,
Conor.

Attachment: signature.asc
Description: PGP signature