Re: [PATCH 1/2] dt-bindings: thermal: loongson,ls2k-thermal: Add compatible for Loongson-2K0300

Conor Dooley <[email protected]>
Newsgroups dev.linux.lists.loongarch,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-pm
Message-ID <20260710-game-late-9347baafa7ab@spud>
On Fri, Jul 10, 2026 at 04:24:59PM +0800, Binbin Zhou wrote:
> Add a new compatible string `loongson,ls2k0300-thermal` for the thermal
> sensor found on the Loongson-2K0300 SoC.
> 
> The hardware differs from the existing SoCs in its register layout: it
> requires two register regions (one for the thermal sensor control and
> another for the CPU ID).
> 
> Update the binding to describe this new requirement.
> 
> Signed-off-by: Binbin Zhou <[email protected]>
> ---
>  .../thermal/loongson,ls2k-thermal.yaml        | 68 ++++++++++++++-----
>  1 file changed, 50 insertions(+), 18 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/thermal/loongson,ls2k-thermal.yaml b/Documentation/devicetree/bindings/thermal/loongson,ls2k-thermal.yaml
> index 79e691b08341..b5cbfd201105 100644
> --- a/Documentation/devicetree/bindings/thermal/loongson,ls2k-thermal.yaml
> +++ b/Documentation/devicetree/bindings/thermal/loongson,ls2k-thermal.yaml
> @@ -10,13 +10,11 @@ maintainers:
>    - zhanghongchen <[email protected]>
>    - Yinbo Zhu <[email protected]>
>  
> -allOf:
> -  - $ref: /schemas/thermal/thermal-sensor.yaml#
> -
>  properties:
>    compatible:
>      oneOf:
>        - enum:
> +          - loongson,ls2k0300-thermal
>            - loongson,ls2k1000-thermal
>            - loongson,ls2k2000-thermal
>        - items:
> @@ -39,23 +37,46 @@ required:
>    - reg
>    - interrupts
>  
> -if:
> -  properties:
> -    compatible:
> -      contains:
> -        enum:
> -          - loongson,ls2k2000-thermal
> +allOf:
> +  - $ref: /schemas/thermal/thermal-sensor.yaml#
>  
> -then:
> -  properties:
> -    reg:
> -      minItems: 2
> -      maxItems: 2
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - loongson,ls2k0300-thermal
> +    then:
> +      properties:
> +        reg:
> +          items:
> +            - description: Thermal base register region
> +            - description: CPU ID register region
>  
> -else:
> -  properties:
> -    reg:
> -      maxItems: 1
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - loongson,ls2k1000-thermal
> +    then:
> +      properties:
> +        reg:
> +          items:
> +            - description: Thermal base register region
> +
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - loongson,ls2k2000-thermal
> +    then:
> +      properties:
> +        reg:
> +          items:
> +            - description: Thermal base register region
> +            - description: Thermal data output register region
>  
>  unevaluatedProperties: false
>  
> @@ -69,3 +90,14 @@ examples:
>          interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
>          #thermal-sensor-cells = <1>;
>      };
> +
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +    thermal-sensor@16001500 {
> +       compatible = "loongson,ls2k0300-thermal";
> +       reg = <0x16001500 0x30>,
> +             <0x16003ff0 0x8>;

Quite frankly, the address and size of this look like the second
register region here is actually a few bytes in a syscon that is being
misrepresented.
What lies at the addresses immediately before and after 0x16003ff0?


Thanks,
Conor.

> +       interrupt-parent = <&liointc1>;
> +       interrupts = <20 IRQ_TYPE_LEVEL_HIGH>;
> +       #thermal-sensor-cells = <1>;
> +    };
> -- 
> 2.52.0
>
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYKAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCalEcAQAKCRB4tDGHoIJi
0mhNAP0ZA31Cl7Igl+boWiSEHApgBG27Ywh7URn4L+9jTyAXLQEA09T1ur9ba+9F
I+IZTamEPx6OiS+wb3FBxviBZBqzngA=
=0pH9
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.