Re: [PATCH v2 3/4] dt-bindings: arm: qcom-soc: Validate nodes with fallbacks
From: Rob Herring
Date: Thu Jul 16 2026 - 17:15:15 EST
On Tue, Jul 07, 2026 at 03:36:01PM +0200, Krzysztof Kozlowski wrote:
> The schema checking for expected naming patterns for SoC IP block nodes
> was really incomplete and was checking only nodes with single
> compatible. Fixing this and applying schema for nodes with fallbacks is
> not trivial, because obvious solution like:
>
> minItems: 1
> items:
> - oneOf:
> - pattern: ...
> - pattern: ...
> - {}
> - {}
>
> is not allowed by dtschema. The binding should also skip root nodes,
> which have SoC-based fallback, but completely random front compatibles.
>
> Solve this all by:
> 1. Extending the select pattern to match all nodes except root node.
> 2. Apply schema to all items of "compatible" property, which means it
> will be evaluating also all sorts of generic compatibles like
> "syscon". List them all and let's hope that fallback list will not
> grow too much, because generic compatible fallbacks are discouraged.
>
> The benefit is that this schema is finally very specific and evaluates
> all nodes for desired naming.
>
> Diff is a bit obfuscated, due to indentation change so briefly
> explaining:
> 1. None of the patterns are changed (neither in "Preferred naming style"
> group nor in "Legacy namings").
> 2. None of the enums with "Legacy namings" and "Legacy compatibles with
> wild-cards" are changed.
> 3. Add pattern for sound cards.
> 4. Add enum with qcom,hamoa-crd-ec, because it is used as fallback to
> SoC-codename (Glymur).
> 5. Add list with all used generic fallbacks.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxxxxxxxx>
> ---
> .../devicetree/bindings/arm/qcom-soc.yaml | 190 ++++++++++++++++-----
> 1 file changed, 143 insertions(+), 47 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/arm/qcom-soc.yaml b/Documentation/devicetree/bindings/arm/qcom-soc.yaml
> index d934afd59df1..ffdaff073c92 100644
> --- a/Documentation/devicetree/bindings/arm/qcom-soc.yaml
> +++ b/Documentation/devicetree/bindings/arm/qcom-soc.yaml
> @@ -22,60 +22,156 @@ description: |
>
> select:
> properties:
> + # Select all nodes which have SoC-based compatibles, but not the root
> + # "/" node, because its front compatibles do not follow any SoC patterns
> + $nodename:
> + pattern: "[^/]"
> compatible:
> - oneOf:
> - - pattern: "^qcom,.*(apq|ipq|mdm|msm|qcm|qcs|q[dr]u|sa|sar|sc|sd[amx]|sm|x1[ep])[0-9]+.*$"
> - - pattern: "^qcom,.*(eliza|kaanapali|glymur|hawi|mahua|maili|milos|nord|shikra).*$"
> + contains:
> + oneOf:
> + - pattern: "^qcom,.*(apq|ipq|mdm|msm|qcm|qcs|q[dr]u|sa|sar|sc|sd[amx]|sm|x1[ep])[0-9]+.*$"
> + - pattern: "^qcom,.*(eliza|kaanapali|glymur|hawi|mahua|maili|milos|nord|shikra).*$"
> required:
> - compatible
>
> properties:
> compatible:
> - oneOf:
> - # Preferred naming style for compatibles of SoC components:
> - - pattern: "^qcom,(apq|ipq|mdm|msm|qcm|qcs|q[dr]u|sa|sc|sd[amx]|sm|x1[ep])[0-9]+(pro)?-.*$"
> - - pattern: "^qcom,sar[0-9]+[a-z]?-.*$"
> - - pattern: "^qcom,(sa|sc)8[0-9]+[a-z][a-z]?-.*$"
> - - pattern: "^qcom,(eliza|kaanapali|glymur|hawi|mahua|maili|milos|nord|shikra)-.*$"
> + # SoC specific compatibles can appear alone or be followed by another SoC
> + # specific compatible or generic fallbacks, therefore check for compatible
> + # should use ideally:
> + #
> + # minItems: 1
> + # items:
> + # - oneOf:
> + # - pattern: ...
> + # - pattern: ...
> + # - {}
> + # - {}
> + #
> + # but that is not allowed by dtschema ("oneOf" cannot be used as an item
> + # for a compatible). Work around this by defining schema for all items,
> + # but drawback is that we need also to list all known generic fallbacks
> + # like "syscon" etc.
> + minItems: 1
> + maxItems: 4
> + items:
> + # Use anyOf, because soundcards will match few patterns
> + anyOf:
> + # Preferred naming style for compatibles of SoC components:
> + - pattern: "^qcom,(apq|ipq|mdm|msm|qcm|qcs|q[dr]u|sa|sc|sd[amx]|sm|x1[ep])[0-9]+(pro)?-.*$"
> + - pattern: "^qcom,sar[0-9]+[a-z]?-.*$"
> + - pattern: "^qcom,(sa|sc)8[0-9]+[a-z][a-z]?-.*$"
> + - pattern: "^qcom,(eliza|kaanapali|glymur|hawi|mahua|maili|milos|nord|shikra)-.*$"
> + # SoC codenames used for non-SoC components:
> + - enum:
> + - qcom,hamoa-crd-ec
>
> - # Legacy namings - variations of existing patterns/compatibles are OK,
> - # but do not add completely new entries to these:
> - - pattern: "^qcom,[ak]pss-wdt-(apq|ipq|mdm|msm|qcm|qcs|q[dr]u|sa|sc|sd[amx]|sm|x1[ep])[0-9]+.*$"
> - # qcom,apss-wdt with codenames
> - - pattern: "^qcom,apss-wdt-[a-z]+$"
> - - pattern: "^qcom,kpss-gcc-(apq|ipq|mdm|msm)[0-9]+.*$"
> - - pattern: "^qcom,gcc-(apq|ipq|mdm|msm|qcm|qcs|q[dr]u|sa|sc|sd[amx]|sm)[0-9]+.*$"
> - - pattern: "^qcom,mmcc-(apq|ipq|mdm|msm|qcm|qcs|q[dr]u|sa|sc|sd[amx]|sm)[0-9]+.*$"
> - - pattern: "^qcom,pcie-(apq|ipq|mdm|msm|qcm|qcs|q[dr]u|sa|sc|sd[amx]|sm|x1[ep])[0-9]+.*$"
> - - pattern: "^qcom,rpm-(apq|ipq|mdm|msm|qcm|qcs|q[dr]u|sa|sc|sd[amx]|sm)[0-9]+.*$"
> - - pattern: "^qcom,rpmcc-(apq|ipq|mdm|msm|qcm|qcs|q[dr]u|sa|sc|sd[amx]|sm)[0-9]+.*$"
> - - pattern: "^qcom,scm-(apq|ipq|mdm|msm|qcm|qcs|q[dr]u|sar?|sc|sd[amx]|sm|x1[ep])[0-9]+.*$"
> - # qcom,scm with codenames
> - - pattern: "^qcom,scm-[a-z]+$"
> - - pattern: "^qcom,tcsr-(apq|ipq|mdm|msm)[0-9]+.*$"
> - - pattern: "^qcom,usb-hs-phy-(apq|ipq|mdm|msm|qcm|qcs|q[dr]u|sa|sc|sd[amx]|sm|x1[ep])[0-9]+.*$"
> - - enum:
> - - qcom,dsi-ctrl-6g-qcm2290
> - - qcom,gpucc-sdm630
> - - qcom,gpucc-sdm660
> - - qcom,lcc-apq8064
> - - qcom,lcc-ipq8064
> - - qcom,lcc-mdm9615
> - - qcom,lcc-msm8960
> - - qcom,lpass-cpu-apq8016
> - - qcom,usb-hs-ipq4019-phy
> - - qcom,usb-hsic-phy-mdm9615
> - - qcom,usb-hsic-phy-msm8974
> - - qcom,usb-ss-ipq4019-phy
> - - qcom,vqmmc-ipq4019-regulator
> + # Legacy namings - variations of existing patterns/compatibles are OK,
> + # but do not add completely new entries to these:
> + - pattern: "^qcom,[ak]pss-wdt-(apq|ipq|mdm|msm|qcm|qcs|q[dr]u|sa|sc|sd[amx]|sm|x1[ep])[0-9]+.*$"
> + # qcom,apss-wdt with codenames
> + - pattern: "^qcom,apss-wdt-[a-z]+$"
> + - pattern: "^qcom,kpss-gcc-(apq|ipq|mdm|msm)[0-9]+.*$"
> + - pattern: "^qcom,gcc-(apq|ipq|mdm|msm|qcm|qcs|q[dr]u|sa|sc|sd[amx]|sm)[0-9]+.*$"
> + - pattern: "^qcom,mmcc-(apq|ipq|mdm|msm|qcm|qcs|q[dr]u|sa|sc|sd[amx]|sm)[0-9]+.*$"
> + - pattern: "^qcom,pcie-(apq|ipq|mdm|msm|qcm|qcs|q[dr]u|sa|sc|sd[amx]|sm|x1[ep])[0-9]+.*$"
> + - pattern: "^qcom,rpm-(apq|ipq|mdm|msm|qcm|qcs|q[dr]u|sa|sc|sd[amx]|sm)[0-9]+.*$"
> + - pattern: "^qcom,rpmcc-(apq|ipq|mdm|msm|qcm|qcs|q[dr]u|sa|sc|sd[amx]|sm)[0-9]+.*$"
> + - pattern: "^qcom,scm-(apq|ipq|mdm|msm|qcm|qcs|q[dr]u|sar?|sc|sd[amx]|sm|x1[ep])[0-9]+.*$"
> + # qcom,scm with codenames
> + - pattern: "^qcom,scm-[a-z]+$"
> + - pattern: "^qcom,tcsr-(apq|ipq|mdm|msm)[0-9]+.*$"
> + - pattern: "^qcom,usb-hs-phy-(apq|ipq|mdm|msm|qcm|qcs|q[dr]u|sa|sc|sd[amx]|sm|x1[ep])[0-9]+.*$"
>
> - # Legacy compatibles with wild-cards - list cannot grow with new bindings:
> - - enum:
> - - qcom,ipq806x-ahci
> - - qcom,ipq806x-gmac
> - - qcom,ipq806x-nand
> - - qcom,ipq806x-sata-phy
> - - qcom,ipq806x-usb-phy-ss
> - - qcom,ipq806x-usb-phy-hs
> + - enum:
> + - qcom,dsi-ctrl-6g-qcm2290
> + - qcom,gpucc-sdm630
> + - qcom,gpucc-sdm660
> + - qcom,lcc-apq8064
> + - qcom,lcc-ipq8064
> + - qcom,lcc-mdm9615
> + - qcom,lcc-msm8960
> + - qcom,lpass-cpu-apq8016
> + - qcom,usb-hs-ipq4019-phy
> + - qcom,usb-hsic-phy-mdm9615
> + - qcom,usb-hsic-phy-msm8974
> + - qcom,usb-ss-ipq4019-phy
> + - qcom,vqmmc-ipq4019-regulator
> +
> + # Legacy compatibles with wild-cards - list cannot grow with new bindings:
> + - enum:
> + - qcom,ipq806x-ahci
> + - qcom,ipq806x-gmac
> + - qcom,ipq806x-nand
> + - qcom,ipq806x-sata-phy
> + - qcom,ipq806x-usb-phy-ss
> + - qcom,ipq806x-usb-phy-hs
> +
> + # Schema matches also sound card nodes and its front compatibles can be anything
> + - pattern: "^.*,.*sndcard$"
> +
> + # List all used generic fallbacks. The list can grow, but in practice
> + # it is not expected, because specific compatibles are preferred for
> + # fallbacks as well.
> + - enum:
> + - arm,gic-v3
> + - arm,mmu-500
> + - generic-ahci
> + - jedec,ufs-2.0
> + - mmio-sram
> + - qcom,adreno-smmu
> + - qcom,aoss-qmp
> + - qcom,cpr
> + - qcom,cpufreq-epss
> + - qcom,cpufreq-hw
> + - qcom,dcc
> + - qcom,dwc3
> + - qcom,epss-l3
> + - qcom,eud
> + - qcom,glink-smd-rpm
> + - qcom,inline-crypto-engine
> + - qcom,ipcc
> + - qcom,kpss-gcc
> + - qcom,kpss-timer
> + - qcom,kpss-wdt
> + - qcom,mdp5
> + - qcom,mdss-dsi-ctrl
> + - qcom,msm-iommu-v1
> + - qcom,msm-iommu-v2
> + - qcom,msm-timer
> + - qcom,osm-l3
> + - qcom,pcie2-phy
> + - qcom,pdc
> + - qcom,pmic-glink
> + - qcom,qce
> + - qcom,qfprom
> + - qcom,qspi-v1
> + - qcom,qusb2-v2-phy
> + - qcom,rpm-proc
> + - qcom,rpmh-rsc
> + - qcom,rpmcc
> + - qcom,saw2
> + - qcom,scm
> + - qcom,sdhci-msm-v4
> + - qcom,sdhci-msm-v5
> + - qcom,sec-qfprom
> + - qcom,smd-rpm
> + - qcom,smmu-500
> + - qcom,smmu-v2
> + - qcom,snps-dwc3
> + - qcom,ssc-block-bus
> + - qcom,tcsr-mutex
> + - qcom,trng
> + - qcom,tsens-v0_1
> + - qcom,tsens-v1
> + - qcom,tsens-v2
> + - qcom,ufshc
> + - qcom,usb-hs-phy
> + - qcom,usb-hsic-phy
> + - qcom,usb-snps-hs-5nm-phy
> + - qcom,usb-snps-hs-7nm-phy
> + - simple-mfd
> + - snps,dwmac
> + - syscon
You lost me here...
This all looks pretty unmaintainable. Perhaps you should give up on old
SoCs and only do something on new(er) ones:
select:
properties:
compatible:
contains:
pattern: '^qcom,'
allOf:
- if:
properties:
compatible:
contains:
pattern: '^qcom,.+foosoc'
then:
properties:
compatible:
contains:
pattern: '^qcom,foosoc'
Rob