Re: [PATCH v2] dt-bindings: mips: add CPU bindings for MIPS architecture

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

 



On 19/09/2022 14:29, Sergio Paracuellos wrote:
>>
>> else mips-hpt-frequency: false
>>
>>> +
>>> +required:
>>> +  - compatible
>>> +
>>> +additionalProperties: true
>>
>> and this is why you did not notice errors...
> 
> Current arch/mips/boot/dts folder dts files are a mess for cpu nodes,
> so I set additionalProperties to true and only make required for
> 'compatible'. What should be the correct approach?

This is okay, but it caused you did not notice errors...

> 
>>
>>> +
>>> +examples:
>>> +  - |
>>> +    cpus {
>>> +      #size-cells = <0>;
>>> +      #address-cells = <1>;
>>> +
>>> +      cpu@0 {
>>> +        device_type = "cpu";
>>> +        compatible = "mips,mips1004Kc";
>>> +        reg = <0>;
>>> +      };
>>> +
>>> +      cpu@1 {
>>> +        device_type = "cpu";
>>> +        compatible = "mips,mips1004Kc";
>>> +        reg = <1>;
>>> +      };
>>> +    };
>>> +
>>> +  - |
>>> +    // Example 2 (BMIPS CPU)
>>> +    cpus {
>>> +      #address-cells = <1>;
>>> +      #size-cells = <0>;
>>> +
>>> +      mips-hpt-frequency = <150000000>;
>>
>> Does not match your bindings. Are you sure you tested the patches?
> 
> Yes I did:
> 
> $ make dt_binding_check
> DT_SCHEMA_FILES=Documentation/devicetree/bindings/mips/cpus.yaml
>   LINT    Documentation/devicetree/bindings
>   CHKDT   Documentation/devicetree/bindings/processed-schema.json
>   SCHEMA  Documentation/devicetree/bindings/processed-schema.json
>   DTEX    Documentation/devicetree/bindings/mips/cpus.example.dts
>   DTC     Documentation/devicetree/bindings/mips/cpus.example.dtb
> ' CHECK   Documentation/devicetree/bindings/mips/cpus.example.dtb
> 
> Can you please point me to a sample of how to make required in a
> parent node of cpu@X property 'mips-hpt-frequency' only for some
> compatible strings inside the node? What can this be properly
> expressed using schema??
> I was looking and testing different things for a while without success at all.

You either define new schema for /cpus node (and match by name, define
children etc) or include it in schema for top-level properties. The
first is tricky, because the cpus node does not have compatible (like
nvidia,tegra194-ccplex.yaml).

The second should work, but then it's a bit cluttered (top-level mixed
with cpus).

Best regards,
Krzysztof



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


  Powered by Linux