lkml.org 
[lkml]   [2023]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v8 06/17] dt-bindings: mfd: amd,pensando-elbasr: Add AMD Pensando Elba System Resource chip
Date
Hi Krzysztof,

On 01/02/2023 10:57, Krzysztof Kozlowski wrote:
>On 30/01/2023 20:12, Brad Larson wrote:
...
>> This has been changed to one device and four chip selects. This binding error
>> is occuring for snps,dw-apb-ssi.yaml using reg for the chip selects. Any
>> guidance on how to fix?
>>
>> $ make ARCH=arm64 dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml
>> LINT Documentation/devicetree/bindings
>> CHKDT Documentation/devicetree/bindings/processed-schema.json
>> SCHEMA Documentation/devicetree/bindings/processed-schema.json
>> DTC_CHK arch/arm64/boot/dts/amd/elba-asic.dtb
>> /home/brad/linux.v10/arch/arm64/boot/dts/amd/elba-asic.dtb: spi@2800: system-controller@0:reg: [[0], [1], [2], [3]] is too long
>> From schema: /home/brad/linux.v10/Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml
>
> Maybe this would work in snps,dw-apb-ssi for children:
>
> reg:
> items:
> minimum: 0
> maximum: 3

With the above change here in snps,dw-apb-ssi.yaml:

- if:
properties:
compatible:
contains:
const: amd,pensando-elba-spi
then:
properties:
reg:
items:
minimum: 0
maximum: 3
required:
- amd,pensando-elba-syscon
else:
properties:
amd,pensando-elba-syscon: false

this is the result:

$ make ARCH=arm64 dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml
LINT Documentation/devicetree/bindings
CHKDT Documentation/devicetree/bindings/processed-schema.json
SCHEMA Documentation/devicetree/bindings/processed-schema.json
DTC_CHK arch/arm64/boot/dts/amd/elba-asic.dtb
/home/brad/linux.v10/arch/arm64/boot/dts/amd/elba-asic.dtb: spi@2800: reg:0: [0, 10240, 0, 256] is too long
From schema: /home/brad/linux.v10/Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml
/home/brad/linux.v10/arch/arm64/boot/dts/amd/elba-asic.dtb: spi@2800: system-controller@0:reg: [[0], [1], [2], [3]] is too long
From schema: /home/brad/linux.v10/Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml

The binding snps,dw-apb-ssi.yaml has patternProperties defined this way:

patternProperties:
"^.*@[0-9a-f]+$":
type: object
properties:
reg:
minimum: 0
maximum: 3

- Removing patternProperties makes the error go away indicating an issue with minimum/maximum regex check
and the number of items in the reg property which shouldn't be related.

- Changing patternProperties to this makes the error go away.
patternProperties:
"^.*@[0-9a-f]+$":
type: object
properties:
reg:
maxItems: 4

- Using spmi.yaml as a reference and changing patternProperties to the following:
patternProperties:
"^.*@[0-9a-f]+$":
type: object
properties:
reg:
items:
- maxItems: 4
items:
- minimum: 0
- maximum: 3
required:
- reg

results in:

$ make ARCH=arm64 dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml
arch/arm64/Makefile:36: Detected assembler with broken .inst; disassembly will be unreliable
LINT Documentation/devicetree/bindings
CHKDT Documentation/devicetree/bindings/processed-schema.json
/home/brad/linux.v10/Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml: patternProperties:^.*@[0-9a-f]+$:properties:reg:items: 'oneOf' conditional failed, one must be fixed:
[{'maxItems': 4, 'items': [{'minimum': 0}, {'maximum': 3}]}] is not of type 'object'
{'maxItems': 4, 'items': [{'minimum': 0}, {'maximum': 3}]} should not be valid under {'required': ['maxItems']}
hint: "maxItems" is not needed with an "items" list
from schema $id: http://devicetree.org/meta-schemas/keywords.yaml#
SCHEMA Documentation/devicetree/bindings/processed-schema.json
DTC_CHK arch/arm64/boot/dts/amd/elba-asic.dtb


- With this version for patternProperties, to retain minimum/maximum, the original error occurs:
patternProperties:
"^.*@[0-9a-f]+$":
type: object
properties:
reg:
items:
- minItems: 1
items:
- minimum: 0
- maximum: 3
required:
- reg

$ make ARCH=arm64 dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml
arch/arm64/Makefile:36: Detected assembler with broken .inst; disassembly will be unreliable
LINT Documentation/devicetree/bindings
CHKDT Documentation/devicetree/bindings/processed-schema.json
SCHEMA Documentation/devicetree/bindings/processed-schema.json

DTC_CHK arch/arm64/boot/dts/amd/elba-asic.dtb
/home/brad/linux.v10/arch/arm64/boot/dts/amd/elba-asic.dtb: spi@2800: system-controller@0:reg: [[0], [1], [2], [3]] is too long
From schema: /home/brad/linux.v10/Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml

Regards,
Brad

\
 
 \ /
  Last update: 2023-03-27 00:11    [W:0.082 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site