diff mbox series

[v2,1/3] dt-bindings: power: qcom,rpmpd: Add SA8155P

Message ID 20230411-topic-hanaau-v2-1-fd3d70844b31@linaro.org (mailing list archive)
State Accepted
Headers show
Series Fix SA8155P RPMPDs | expand

Commit Message

Konrad Dybcio April 11, 2023, 1:47 p.m. UTC
Add a compatible for SA8155P platforms and relevant defines to the
include file.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 Documentation/devicetree/bindings/power/qcom,rpmpd.yaml | 1 +
 include/dt-bindings/power/qcom-rpmpd.h                  | 9 +++++++++
 2 files changed, 10 insertions(+)

Comments

Krzysztof Kozlowski April 11, 2023, 5:37 p.m. UTC | #1
On 11/04/2023 15:47, Konrad Dybcio wrote:
> Add a compatible for SA8155P platforms and relevant defines to the
> include file.
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> ---
>  Documentation/devicetree/bindings/power/qcom,rpmpd.yaml | 1 +
>  include/dt-bindings/power/qcom-rpmpd.h                  | 9 +++++++++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml b/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
> index afad3135ed67..f9c211a9a938 100644
> --- a/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
> +++ b/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
> @@ -29,6 +29,7 @@ properties:
>        - qcom,qcm2290-rpmpd
>        - qcom,qcs404-rpmpd
>        - qcom,qdu1000-rpmhpd
> +      - qcom,sa8155p-rpmhpd
>        - qcom,sa8540p-rpmhpd
>        - qcom,sa8775p-rpmhpd
>        - qcom,sdm660-rpmpd
> diff --git a/include/dt-bindings/power/qcom-rpmpd.h b/include/dt-bindings/power/qcom-rpmpd.h
> index 1bf8e87ecd7e..867b18e041ea 100644
> --- a/include/dt-bindings/power/qcom-rpmpd.h
> +++ b/include/dt-bindings/power/qcom-rpmpd.h
> @@ -90,6 +90,15 @@
>  #define SM8150_MMCX	9
>  #define SM8150_MMCX_AO	10
>  
> +/* SA8155P is a special case, kept for backwards compatibility */

This is a new binding, thus I don't understand what is here backwards
compatible?

> +#define SA8155P_CX	SM8150_CX
> +#define SA8155P_CX_AO	SM8150_CX_AO
> +#define SA8155P_EBI	SM8150_EBI
> +#define SA8155P_GFX	SM8150_GFX
> +#define SA8155P_MSS	SM8150_MSS
> +#define SA8155P_MX	SM8150_MX
> +#define SA8155P_MX_AO	SM8150_MX_AO
> +

Best regards,
Krzysztof
Konrad Dybcio April 11, 2023, 6:03 p.m. UTC | #2
On 11.04.2023 19:37, Krzysztof Kozlowski wrote:
> On 11/04/2023 15:47, Konrad Dybcio wrote:
>> Add a compatible for SA8155P platforms and relevant defines to the
>> include file.
>>
>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>> ---
>>  Documentation/devicetree/bindings/power/qcom,rpmpd.yaml | 1 +
>>  include/dt-bindings/power/qcom-rpmpd.h                  | 9 +++++++++
>>  2 files changed, 10 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml b/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
>> index afad3135ed67..f9c211a9a938 100644
>> --- a/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
>> +++ b/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
>> @@ -29,6 +29,7 @@ properties:
>>        - qcom,qcm2290-rpmpd
>>        - qcom,qcs404-rpmpd
>>        - qcom,qdu1000-rpmhpd
>> +      - qcom,sa8155p-rpmhpd
>>        - qcom,sa8540p-rpmhpd
>>        - qcom,sa8775p-rpmhpd
>>        - qcom,sdm660-rpmpd
>> diff --git a/include/dt-bindings/power/qcom-rpmpd.h b/include/dt-bindings/power/qcom-rpmpd.h
>> index 1bf8e87ecd7e..867b18e041ea 100644
>> --- a/include/dt-bindings/power/qcom-rpmpd.h
>> +++ b/include/dt-bindings/power/qcom-rpmpd.h
>> @@ -90,6 +90,15 @@
>>  #define SM8150_MMCX	9
>>  #define SM8150_MMCX_AO	10
>>  
>> +/* SA8155P is a special case, kept for backwards compatibility */
> 
> This is a new binding, thus I don't understand what is here backwards
> compatible?
Check the DT structure, 8155-adp (so, de facto 8155) included
8150 before, but that was not exactly the correct approach..
It bit us after we accidentally discovered 8155 advertises MMCX,
LCX and LMX PDs in cmd-db but triggers a bite on access attempts..

By mimicking the indices to match the ones of 8150, we only have
to fix up the domains that were axed from 8155 (in comparison to
8150 which has the full fat setup).

Konrad
> 
>> +#define SA8155P_CX	SM8150_CX
>> +#define SA8155P_CX_AO	SM8150_CX_AO
>> +#define SA8155P_EBI	SM8150_EBI
>> +#define SA8155P_GFX	SM8150_GFX
>> +#define SA8155P_MSS	SM8150_MSS
>> +#define SA8155P_MX	SM8150_MX
>> +#define SA8155P_MX_AO	SM8150_MX_AO
>> +
> 
> Best regards,
> Krzysztof
>
Krzysztof Kozlowski April 12, 2023, 7:20 a.m. UTC | #3
On 11/04/2023 20:03, Konrad Dybcio wrote:
>>>        - qcom,sdm660-rpmpd
>>> diff --git a/include/dt-bindings/power/qcom-rpmpd.h b/include/dt-bindings/power/qcom-rpmpd.h
>>> index 1bf8e87ecd7e..867b18e041ea 100644
>>> --- a/include/dt-bindings/power/qcom-rpmpd.h
>>> +++ b/include/dt-bindings/power/qcom-rpmpd.h
>>> @@ -90,6 +90,15 @@
>>>  #define SM8150_MMCX	9
>>>  #define SM8150_MMCX_AO	10
>>>  
>>> +/* SA8155P is a special case, kept for backwards compatibility */
>>
>> This is a new binding, thus I don't understand what is here backwards
>> compatible?
> Check the DT structure, 8155-adp (so, de facto 8155) included
> 8150 before, but that was not exactly the correct approach..
> It bit us after we accidentally discovered 8155 advertises MMCX,
> LCX and LMX PDs in cmd-db but triggers a bite on access attempts..
> 
> By mimicking the indices to match the ones of 8150, we only have
> to fix up the domains that were axed from 8155 (in comparison to
> 8150 which has the full fat setup).

> 
> Konrad
>>
>>> +#define SA8155P_CX	SM8150_CX
>>> +#define SA8155P_CX_AO	SM8150_CX_AO

The DTS diff (the patch here) does not show it, I would need to check
the context by opening other DTS in linux-next. Therefore it would be
great if commit msg explained this.

BTW, using here directly numbers matching SM8150 values, would also be
backwards compatible...

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml b/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
index afad3135ed67..f9c211a9a938 100644
--- a/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
+++ b/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
@@ -29,6 +29,7 @@  properties:
       - qcom,qcm2290-rpmpd
       - qcom,qcs404-rpmpd
       - qcom,qdu1000-rpmhpd
+      - qcom,sa8155p-rpmhpd
       - qcom,sa8540p-rpmhpd
       - qcom,sa8775p-rpmhpd
       - qcom,sdm660-rpmpd
diff --git a/include/dt-bindings/power/qcom-rpmpd.h b/include/dt-bindings/power/qcom-rpmpd.h
index 1bf8e87ecd7e..867b18e041ea 100644
--- a/include/dt-bindings/power/qcom-rpmpd.h
+++ b/include/dt-bindings/power/qcom-rpmpd.h
@@ -90,6 +90,15 @@ 
 #define SM8150_MMCX	9
 #define SM8150_MMCX_AO	10
 
+/* SA8155P is a special case, kept for backwards compatibility */
+#define SA8155P_CX	SM8150_CX
+#define SA8155P_CX_AO	SM8150_CX_AO
+#define SA8155P_EBI	SM8150_EBI
+#define SA8155P_GFX	SM8150_GFX
+#define SA8155P_MSS	SM8150_MSS
+#define SA8155P_MX	SM8150_MX
+#define SA8155P_MX_AO	SM8150_MX_AO
+
 /* SM8250 Power Domain Indexes */
 #define SM8250_CX	0
 #define SM8250_CX_AO	1