[v3,1/3] dt-bindings: power: rpmhpd: Add Generic RPMh PD indexes

Message ID 1689054169-10800-2-git-send-email-quic_rohiagar@quicinc.com
State New
Headers
Series Add rpmhpd support for SDX75 |

Commit Message

Rohit Agarwal July 11, 2023, 5:42 a.m. UTC
  Add Generic RPMh Power Domain indexes that can be used
for all the Qualcomm SoC henceforth.

Signed-off-by: Rohit Agarwal <quic_rohiagar@quicinc.com>
Suggested-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 include/dt-bindings/power/qcom-rpmhpd.h | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 include/dt-bindings/power/qcom-rpmhpd.h
  

Comments

Krzysztof Kozlowski July 11, 2023, 5:52 a.m. UTC | #1
On 11/07/2023 07:42, Rohit Agarwal wrote:
> Add Generic RPMh Power Domain indexes that can be used
> for all the Qualcomm SoC henceforth.
> 
> Signed-off-by: Rohit Agarwal <quic_rohiagar@quicinc.com>
> Suggested-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> ---
>  include/dt-bindings/power/qcom-rpmhpd.h | 30 ++++++++++++++++++++++++++++++
>  1 file changed, 30 insertions(+)
>  create mode 100644 include/dt-bindings/power/qcom-rpmhpd.h
> 
> diff --git a/include/dt-bindings/power/qcom-rpmhpd.h b/include/dt-bindings/power/qcom-rpmhpd.h
> new file mode 100644
> index 0000000..4da2e04
> --- /dev/null
> +++ b/include/dt-bindings/power/qcom-rpmhpd.h

Filename based on compatible.

> @@ -0,0 +1,30 @@
> +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
> +/*
> + * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved.
> + */
> +
> +#ifndef _DT_BINDINGS_POWER_QCOM_RPMHPD_H
> +#define _DT_BINDINGS_POWER_QCOM_RPMHPD_H
> +
> +/* Generic RPMH Power Domain Indexes */
> +#define CX               0

These are very generic names, usually not used in global headers. Please
use some reasonable prefix.



Best regards,
Krzysztof
  
Rohit Agarwal July 11, 2023, 6:17 a.m. UTC | #2
On 7/11/2023 11:22 AM, Krzysztof Kozlowski wrote:
> On 11/07/2023 07:42, Rohit Agarwal wrote:
>> Add Generic RPMh Power Domain indexes that can be used
>> for all the Qualcomm SoC henceforth.
>>
>> Signed-off-by: Rohit Agarwal <quic_rohiagar@quicinc.com>
>> Suggested-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>> ---
>>   include/dt-bindings/power/qcom-rpmhpd.h | 30 ++++++++++++++++++++++++++++++
>>   1 file changed, 30 insertions(+)
>>   create mode 100644 include/dt-bindings/power/qcom-rpmhpd.h
>>
>> diff --git a/include/dt-bindings/power/qcom-rpmhpd.h b/include/dt-bindings/power/qcom-rpmhpd.h
>> new file mode 100644
>> index 0000000..4da2e04
>> --- /dev/null
>> +++ b/include/dt-bindings/power/qcom-rpmhpd.h
> Filename based on compatible.
This is not specific for SDX75. These are generic ones that should be 
used for all other targets.
Konrad suggested in v1 to avoid target specific prefixes everytime and 
to create a new generic
dt-bindings that can be reused.
>> @@ -0,0 +1,30 @@
>> +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
>> +/*
>> + * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved.
>> + */
>> +
>> +#ifndef _DT_BINDINGS_POWER_QCOM_RPMHPD_H
>> +#define _DT_BINDINGS_POWER_QCOM_RPMHPD_H
>> +
>> +/* Generic RPMH Power Domain Indexes */
>> +#define CX               0
> These are very generic names, usually not used in global headers. Please
> use some reasonable prefix.
This was based on the suggestion from Konrad in v2 to drop the RPMHPD 
prefix and we can go only with names like CX, etc.

Thanks,
Rohit.
>
>
> Best regards,
> Krzysztof
>
  
Krzysztof Kozlowski July 11, 2023, 6:22 a.m. UTC | #3
On 11/07/2023 08:17, Rohit Agarwal wrote:
> 
> On 7/11/2023 11:22 AM, Krzysztof Kozlowski wrote:
>> On 11/07/2023 07:42, Rohit Agarwal wrote:
>>> Add Generic RPMh Power Domain indexes that can be used
>>> for all the Qualcomm SoC henceforth.
>>>
>>> Signed-off-by: Rohit Agarwal <quic_rohiagar@quicinc.com>
>>> Suggested-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>>> ---
>>>   include/dt-bindings/power/qcom-rpmhpd.h | 30 ++++++++++++++++++++++++++++++
>>>   1 file changed, 30 insertions(+)
>>>   create mode 100644 include/dt-bindings/power/qcom-rpmhpd.h
>>>
>>> diff --git a/include/dt-bindings/power/qcom-rpmhpd.h b/include/dt-bindings/power/qcom-rpmhpd.h
>>> new file mode 100644
>>> index 0000000..4da2e04
>>> --- /dev/null
>>> +++ b/include/dt-bindings/power/qcom-rpmhpd.h
>> Filename based on compatible.
> This is not specific for SDX75. These are generic ones that should be 
> used for all other targets.
> Konrad suggested in v1 to avoid target specific prefixes everytime and 
> to create a new generic
> dt-bindings that can be reused.
>>> @@ -0,0 +1,30 @@
>>> +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
>>> +/*
>>> + * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved.
>>> + */
>>> +
>>> +#ifndef _DT_BINDINGS_POWER_QCOM_RPMHPD_H
>>> +#define _DT_BINDINGS_POWER_QCOM_RPMHPD_H
>>> +
>>> +/* Generic RPMH Power Domain Indexes */
>>> +#define CX               0
>> These are very generic names, usually not used in global headers. Please
>> use some reasonable prefix.
> This was based on the suggestion from Konrad in v2 to drop the RPMHPD 
> prefix and we can go only with names like CX, etc.

I don't think having so generic name in tree-wide header is good idea.
CX can mean anything.

Best regards,
Krzysztof
  
Krzysztof Kozlowski July 11, 2023, 6:34 a.m. UTC | #4
On 11/07/2023 08:17, Rohit Agarwal wrote:
> 
> On 7/11/2023 11:22 AM, Krzysztof Kozlowski wrote:
>> On 11/07/2023 07:42, Rohit Agarwal wrote:
>>> Add Generic RPMh Power Domain indexes that can be used
>>> for all the Qualcomm SoC henceforth.
>>>
>>> Signed-off-by: Rohit Agarwal <quic_rohiagar@quicinc.com>
>>> Suggested-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>>> ---
>>>   include/dt-bindings/power/qcom-rpmhpd.h | 30 ++++++++++++++++++++++++++++++
>>>   1 file changed, 30 insertions(+)
>>>   create mode 100644 include/dt-bindings/power/qcom-rpmhpd.h
>>>
>>> diff --git a/include/dt-bindings/power/qcom-rpmhpd.h b/include/dt-bindings/power/qcom-rpmhpd.h
>>> new file mode 100644
>>> index 0000000..4da2e04
>>> --- /dev/null
>>> +++ b/include/dt-bindings/power/qcom-rpmhpd.h
>> Filename based on compatible.
> This is not specific for SDX75. These are generic ones that should be 
> used for all other targets.

qcom,rpmhpd.h

Best regards,
Krzysztof
  
Rohit Agarwal July 11, 2023, 6:35 a.m. UTC | #5
On 7/11/2023 12:04 PM, Krzysztof Kozlowski wrote:
> On 11/07/2023 08:17, Rohit Agarwal wrote:
>> On 7/11/2023 11:22 AM, Krzysztof Kozlowski wrote:
>>> On 11/07/2023 07:42, Rohit Agarwal wrote:
>>>> Add Generic RPMh Power Domain indexes that can be used
>>>> for all the Qualcomm SoC henceforth.
>>>>
>>>> Signed-off-by: Rohit Agarwal <quic_rohiagar@quicinc.com>
>>>> Suggested-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>>>> ---
>>>>    include/dt-bindings/power/qcom-rpmhpd.h | 30 ++++++++++++++++++++++++++++++
>>>>    1 file changed, 30 insertions(+)
>>>>    create mode 100644 include/dt-bindings/power/qcom-rpmhpd.h
>>>>
>>>> diff --git a/include/dt-bindings/power/qcom-rpmhpd.h b/include/dt-bindings/power/qcom-rpmhpd.h
>>>> new file mode 100644
>>>> index 0000000..4da2e04
>>>> --- /dev/null
>>>> +++ b/include/dt-bindings/power/qcom-rpmhpd.h
>>> Filename based on compatible.
>> This is not specific for SDX75. These are generic ones that should be
>> used for all other targets.
> qcom,rpmhpd.h
Ok, got it.

Thanks,
Rohit.
> Best regards,
> Krzysztof
>
  
Konrad Dybcio July 11, 2023, 11:44 a.m. UTC | #6
On 11.07.2023 08:22, Krzysztof Kozlowski wrote:
> On 11/07/2023 08:17, Rohit Agarwal wrote:
>>
>> On 7/11/2023 11:22 AM, Krzysztof Kozlowski wrote:
>>> On 11/07/2023 07:42, Rohit Agarwal wrote:
>>>> Add Generic RPMh Power Domain indexes that can be used
>>>> for all the Qualcomm SoC henceforth.
>>>>
>>>> Signed-off-by: Rohit Agarwal <quic_rohiagar@quicinc.com>
>>>> Suggested-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>>>> ---
>>>>   include/dt-bindings/power/qcom-rpmhpd.h | 30 ++++++++++++++++++++++++++++++
>>>>   1 file changed, 30 insertions(+)
>>>>   create mode 100644 include/dt-bindings/power/qcom-rpmhpd.h
>>>>
>>>> diff --git a/include/dt-bindings/power/qcom-rpmhpd.h b/include/dt-bindings/power/qcom-rpmhpd.h
>>>> new file mode 100644
>>>> index 0000000..4da2e04
>>>> --- /dev/null
>>>> +++ b/include/dt-bindings/power/qcom-rpmhpd.h
>>> Filename based on compatible.
>> This is not specific for SDX75. These are generic ones that should be 
>> used for all other targets.
>> Konrad suggested in v1 to avoid target specific prefixes everytime and 
>> to create a new generic
>> dt-bindings that can be reused.
>>>> @@ -0,0 +1,30 @@
>>>> +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
>>>> +/*
>>>> + * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved.
>>>> + */
>>>> +
>>>> +#ifndef _DT_BINDINGS_POWER_QCOM_RPMHPD_H
>>>> +#define _DT_BINDINGS_POWER_QCOM_RPMHPD_H
>>>> +
>>>> +/* Generic RPMH Power Domain Indexes */
>>>> +#define CX               0
>>> These are very generic names, usually not used in global headers. Please
>>> use some reasonable prefix.
>> This was based on the suggestion from Konrad in v2 to drop the RPMHPD 
>> prefix and we can go only with names like CX, etc.
> 
> I don't think having so generic name in tree-wide header is good idea.
Conversely, I think that it would be very clear in files including this header.

Konrad
> CX can mean anything.
> 
> Best regards,
> Krzysztof
>
  
Dmitry Baryshkov July 11, 2023, 2:59 p.m. UTC | #7
On 11/07/2023 14:44, Konrad Dybcio wrote:
> On 11.07.2023 08:22, Krzysztof Kozlowski wrote:
>> On 11/07/2023 08:17, Rohit Agarwal wrote:
>>>
>>> On 7/11/2023 11:22 AM, Krzysztof Kozlowski wrote:
>>>> On 11/07/2023 07:42, Rohit Agarwal wrote:
>>>>> Add Generic RPMh Power Domain indexes that can be used
>>>>> for all the Qualcomm SoC henceforth.
>>>>>
>>>>> Signed-off-by: Rohit Agarwal <quic_rohiagar@quicinc.com>
>>>>> Suggested-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>>>>> ---
>>>>>    include/dt-bindings/power/qcom-rpmhpd.h | 30 ++++++++++++++++++++++++++++++
>>>>>    1 file changed, 30 insertions(+)
>>>>>    create mode 100644 include/dt-bindings/power/qcom-rpmhpd.h
>>>>>
>>>>> diff --git a/include/dt-bindings/power/qcom-rpmhpd.h b/include/dt-bindings/power/qcom-rpmhpd.h
>>>>> new file mode 100644
>>>>> index 0000000..4da2e04
>>>>> --- /dev/null
>>>>> +++ b/include/dt-bindings/power/qcom-rpmhpd.h
>>>> Filename based on compatible.
>>> This is not specific for SDX75. These are generic ones that should be
>>> used for all other targets.
>>> Konrad suggested in v1 to avoid target specific prefixes everytime and
>>> to create a new generic
>>> dt-bindings that can be reused.
>>>>> @@ -0,0 +1,30 @@
>>>>> +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
>>>>> +/*
>>>>> + * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved.
>>>>> + */
>>>>> +
>>>>> +#ifndef _DT_BINDINGS_POWER_QCOM_RPMHPD_H
>>>>> +#define _DT_BINDINGS_POWER_QCOM_RPMHPD_H
>>>>> +
>>>>> +/* Generic RPMH Power Domain Indexes */
>>>>> +#define CX               0
>>>> These are very generic names, usually not used in global headers. Please
>>>> use some reasonable prefix.
>>> This was based on the suggestion from Konrad in v2 to drop the RPMHPD
>>> prefix and we can go only with names like CX, etc.
>>
>> I don't think having so generic name in tree-wide header is good idea.
> Conversely, I think that it would be very clear in files including this header.

It is expected to be included into dtsi and into rpmhpd driver (only). 
However I'd also suggest adding some generic prefix (e.g. RPMHPD_CX). 
Just `CX' is too short and has a sensible possibility of getting  a 
symbol conflict.

> 
> Konrad
>> CX can mean anything.
>>
>> Best regards,
>> Krzysztof
>>
  
Dmitry Baryshkov July 11, 2023, 3:11 p.m. UTC | #8
On 11/07/2023 08:42, Rohit Agarwal wrote:
> Add Generic RPMh Power Domain indexes that can be used
> for all the Qualcomm SoC henceforth.
> 
> Signed-off-by: Rohit Agarwal <quic_rohiagar@quicinc.com>
> Suggested-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> ---
>   include/dt-bindings/power/qcom-rpmhpd.h | 30 ++++++++++++++++++++++++++++++
>   1 file changed, 30 insertions(+)
>   create mode 100644 include/dt-bindings/power/qcom-rpmhpd.h
> 
> diff --git a/include/dt-bindings/power/qcom-rpmhpd.h b/include/dt-bindings/power/qcom-rpmhpd.h
> new file mode 100644
> index 0000000..4da2e04
> --- /dev/null
> +++ b/include/dt-bindings/power/qcom-rpmhpd.h
> @@ -0,0 +1,30 @@
> +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
> +/*
> + * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved.
> + */
> +
> +#ifndef _DT_BINDINGS_POWER_QCOM_RPMHPD_H
> +#define _DT_BINDINGS_POWER_QCOM_RPMHPD_H
> +
> +/* Generic RPMH Power Domain Indexes */
> +#define CX               0
> +#define MX               1
> +#define CX_AO            2
> +#define MX_AO            3
> +#define GFX              4
> +#define MSS              5
> +#define EBI              6
> +#define LCX              7
> +#define LMX              8
> +#define MMCX             9
> +#define MMCX_AO          10
> +#define MXC              11
> +#define MXC_AO           12
> +#define NSP              13
> +#define NSP0             14
> +#define NSP1             15
> +#define QPHY             16
> +#define DDR              17
> +#define XO               18

I went through the existing defines. If we adopt the order of defines 
for sm8550, we can migrate that platform and all of sm8[234]50 without 
breaking ABI. This would be a minor gain, but still something.

> +
> +#endif
  
Rohit Agarwal July 12, 2023, 8:20 a.m. UTC | #9
On 7/11/2023 8:29 PM, Dmitry Baryshkov wrote:
> On 11/07/2023 14:44, Konrad Dybcio wrote:
>> On 11.07.2023 08:22, Krzysztof Kozlowski wrote:
>>> On 11/07/2023 08:17, Rohit Agarwal wrote:
>>>>
>>>> On 7/11/2023 11:22 AM, Krzysztof Kozlowski wrote:
>>>>> On 11/07/2023 07:42, Rohit Agarwal wrote:
>>>>>> Add Generic RPMh Power Domain indexes that can be used
>>>>>> for all the Qualcomm SoC henceforth.
>>>>>>
>>>>>> Signed-off-by: Rohit Agarwal <quic_rohiagar@quicinc.com>
>>>>>> Suggested-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>>>>>> ---
>>>>>>    include/dt-bindings/power/qcom-rpmhpd.h | 30 
>>>>>> ++++++++++++++++++++++++++++++
>>>>>>    1 file changed, 30 insertions(+)
>>>>>>    create mode 100644 include/dt-bindings/power/qcom-rpmhpd.h
>>>>>>
>>>>>> diff --git a/include/dt-bindings/power/qcom-rpmhpd.h 
>>>>>> b/include/dt-bindings/power/qcom-rpmhpd.h
>>>>>> new file mode 100644
>>>>>> index 0000000..4da2e04
>>>>>> --- /dev/null
>>>>>> +++ b/include/dt-bindings/power/qcom-rpmhpd.h
>>>>> Filename based on compatible.
>>>> This is not specific for SDX75. These are generic ones that should be
>>>> used for all other targets.
>>>> Konrad suggested in v1 to avoid target specific prefixes everytime and
>>>> to create a new generic
>>>> dt-bindings that can be reused.
>>>>>> @@ -0,0 +1,30 @@
>>>>>> +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
>>>>>> +/*
>>>>>> + * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All 
>>>>>> rights reserved.
>>>>>> + */
>>>>>> +
>>>>>> +#ifndef _DT_BINDINGS_POWER_QCOM_RPMHPD_H
>>>>>> +#define _DT_BINDINGS_POWER_QCOM_RPMHPD_H
>>>>>> +
>>>>>> +/* Generic RPMH Power Domain Indexes */
>>>>>> +#define CX               0
>>>>> These are very generic names, usually not used in global headers. 
>>>>> Please
>>>>> use some reasonable prefix.
>>>> This was based on the suggestion from Konrad in v2 to drop the RPMHPD
>>>> prefix and we can go only with names like CX, etc.
>>>
>>> I don't think having so generic name in tree-wide header is good idea.
>> Conversely, I think that it would be very clear in files including 
>> this header.
>
> It is expected to be included into dtsi and into rpmhpd driver (only). 
> However I'd also suggest adding some generic prefix (e.g. RPMHPD_CX). 
> Just `CX' is too short and has a sensible possibility of getting  a 
> symbol conflict.
>
Ok, Will add them back as in v2.

Thanks,
Rohit.
>>
>> Konrad
>>> CX can mean anything.
>>>
>>> Best regards,
>>> Krzysztof
>>>
>
  
Rohit Agarwal July 12, 2023, 8:24 a.m. UTC | #10
On 7/11/2023 8:41 PM, Dmitry Baryshkov wrote:
> On 11/07/2023 08:42, Rohit Agarwal wrote:
>> Add Generic RPMh Power Domain indexes that can be used
>> for all the Qualcomm SoC henceforth.
>>
>> Signed-off-by: Rohit Agarwal <quic_rohiagar@quicinc.com>
>> Suggested-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>> ---
>>   include/dt-bindings/power/qcom-rpmhpd.h | 30 
>> ++++++++++++++++++++++++++++++
>>   1 file changed, 30 insertions(+)
>>   create mode 100644 include/dt-bindings/power/qcom-rpmhpd.h
>>
>> diff --git a/include/dt-bindings/power/qcom-rpmhpd.h 
>> b/include/dt-bindings/power/qcom-rpmhpd.h
>> new file mode 100644
>> index 0000000..4da2e04
>> --- /dev/null
>> +++ b/include/dt-bindings/power/qcom-rpmhpd.h
>> @@ -0,0 +1,30 @@
>> +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
>> +/*
>> + * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights 
>> reserved.
>> + */
>> +
>> +#ifndef _DT_BINDINGS_POWER_QCOM_RPMHPD_H
>> +#define _DT_BINDINGS_POWER_QCOM_RPMHPD_H
>> +
>> +/* Generic RPMH Power Domain Indexes */
>> +#define CX               0
>> +#define MX               1
>> +#define CX_AO            2
>> +#define MX_AO            3
>> +#define GFX              4
>> +#define MSS              5
>> +#define EBI              6
>> +#define LCX              7
>> +#define LMX              8
>> +#define MMCX             9
>> +#define MMCX_AO          10
>> +#define MXC              11
>> +#define MXC_AO           12
>> +#define NSP              13
>> +#define NSP0             14
>> +#define NSP1             15
>> +#define QPHY             16
>> +#define DDR              17
>> +#define XO               18
>
> I went through the existing defines. If we adopt the order of defines 
> for sm8550, we can migrate that platform and all of sm8[234]50 without 
> breaking ABI. This would be a minor gain, but still something.
>
Actually, I added them in the sequence based on the frequency with which 
they occur in the driver, so that there are less NULL entries created 
for any target additions. Shouldnt we keep it this way and ignore for 
previous targets then?

Thanks,
Rohit.
>> +
>> +#endif
>
  
Konrad Dybcio July 12, 2023, 9:22 a.m. UTC | #11
On 12.07.2023 10:24, Rohit Agarwal wrote:
> 
> On 7/11/2023 8:41 PM, Dmitry Baryshkov wrote:
>> On 11/07/2023 08:42, Rohit Agarwal wrote:
>>> Add Generic RPMh Power Domain indexes that can be used
>>> for all the Qualcomm SoC henceforth.
>>>
>>> Signed-off-by: Rohit Agarwal <quic_rohiagar@quicinc.com>
>>> Suggested-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>>> ---
>>>   include/dt-bindings/power/qcom-rpmhpd.h | 30 ++++++++++++++++++++++++++++++
>>>   1 file changed, 30 insertions(+)
>>>   create mode 100644 include/dt-bindings/power/qcom-rpmhpd.h
>>>
>>> diff --git a/include/dt-bindings/power/qcom-rpmhpd.h b/include/dt-bindings/power/qcom-rpmhpd.h
>>> new file mode 100644
>>> index 0000000..4da2e04
>>> --- /dev/null
>>> +++ b/include/dt-bindings/power/qcom-rpmhpd.h
>>> @@ -0,0 +1,30 @@
>>> +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
>>> +/*
>>> + * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved.
>>> + */
>>> +
>>> +#ifndef _DT_BINDINGS_POWER_QCOM_RPMHPD_H
>>> +#define _DT_BINDINGS_POWER_QCOM_RPMHPD_H
>>> +
>>> +/* Generic RPMH Power Domain Indexes */
>>> +#define CX               0
>>> +#define MX               1
>>> +#define CX_AO            2
>>> +#define MX_AO            3
>>> +#define GFX              4
>>> +#define MSS              5
>>> +#define EBI              6
>>> +#define LCX              7
>>> +#define LMX              8
>>> +#define MMCX             9
>>> +#define MMCX_AO          10
>>> +#define MXC              11
>>> +#define MXC_AO           12
>>> +#define NSP              13
>>> +#define NSP0             14
>>> +#define NSP1             15
>>> +#define QPHY             16
>>> +#define DDR              17
>>> +#define XO               18
>>
>> I went through the existing defines. If we adopt the order of defines for sm8550, we can migrate that platform and all of sm8[234]50 without breaking ABI. This would be a minor gain, but still something.
>>
> Actually, I added them in the sequence based on the frequency with which they occur in the driver, so that there are less NULL entries created for any target additions. Shouldnt we keep it this way and ignore for previous targets then?
Don't bother yourself with this, we've already dragged you through
some bindings mess ;)

Dmitry just noticed that a happy coincidence occured and we could
swap out SM8[234]_50 indices with these ones and they would still
match. It'd be a separate patch though.

Konrad
> 
> Thanks,
> Rohit.
>>> +
>>> +#endif
>>
  
Rohit Agarwal July 12, 2023, 9:25 a.m. UTC | #12
On 7/12/2023 2:52 PM, Konrad Dybcio wrote:
> On 12.07.2023 10:24, Rohit Agarwal wrote:
>> On 7/11/2023 8:41 PM, Dmitry Baryshkov wrote:
>>> On 11/07/2023 08:42, Rohit Agarwal wrote:
>>>> Add Generic RPMh Power Domain indexes that can be used
>>>> for all the Qualcomm SoC henceforth.
>>>>
>>>> Signed-off-by: Rohit Agarwal <quic_rohiagar@quicinc.com>
>>>> Suggested-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>>>> ---
>>>>    include/dt-bindings/power/qcom-rpmhpd.h | 30 ++++++++++++++++++++++++++++++
>>>>    1 file changed, 30 insertions(+)
>>>>    create mode 100644 include/dt-bindings/power/qcom-rpmhpd.h
>>>>
>>>> diff --git a/include/dt-bindings/power/qcom-rpmhpd.h b/include/dt-bindings/power/qcom-rpmhpd.h
>>>> new file mode 100644
>>>> index 0000000..4da2e04
>>>> --- /dev/null
>>>> +++ b/include/dt-bindings/power/qcom-rpmhpd.h
>>>> @@ -0,0 +1,30 @@
>>>> +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
>>>> +/*
>>>> + * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved.
>>>> + */
>>>> +
>>>> +#ifndef _DT_BINDINGS_POWER_QCOM_RPMHPD_H
>>>> +#define _DT_BINDINGS_POWER_QCOM_RPMHPD_H
>>>> +
>>>> +/* Generic RPMH Power Domain Indexes */
>>>> +#define CX               0
>>>> +#define MX               1
>>>> +#define CX_AO            2
>>>> +#define MX_AO            3
>>>> +#define GFX              4
>>>> +#define MSS              5
>>>> +#define EBI              6
>>>> +#define LCX              7
>>>> +#define LMX              8
>>>> +#define MMCX             9
>>>> +#define MMCX_AO          10
>>>> +#define MXC              11
>>>> +#define MXC_AO           12
>>>> +#define NSP              13
>>>> +#define NSP0             14
>>>> +#define NSP1             15
>>>> +#define QPHY             16
>>>> +#define DDR              17
>>>> +#define XO               18
>>> I went through the existing defines. If we adopt the order of defines for sm8550, we can migrate that platform and all of sm8[234]50 without breaking ABI. This would be a minor gain, but still something.
>>>
>> Actually, I added them in the sequence based on the frequency with which they occur in the driver, so that there are less NULL entries created for any target additions. Shouldnt we keep it this way and ignore for previous targets then?
> Don't bother yourself with this, we've already dragged you through
> some bindings mess ;)
>
> Dmitry just noticed that a happy coincidence occured and we could
> swap out SM8[234]_50 indices with these ones and they would still
> match. It'd be a separate patch though.
Yes sure. Will make a separate patch updating entries for these targets.

Thanks,
Rohit.
> Konrad
>> Thanks,
>> Rohit.
>>>> +
>>>> +#endif
  

Patch

diff --git a/include/dt-bindings/power/qcom-rpmhpd.h b/include/dt-bindings/power/qcom-rpmhpd.h
new file mode 100644
index 0000000..4da2e04
--- /dev/null
+++ b/include/dt-bindings/power/qcom-rpmhpd.h
@@ -0,0 +1,30 @@ 
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved.
+ */
+
+#ifndef _DT_BINDINGS_POWER_QCOM_RPMHPD_H
+#define _DT_BINDINGS_POWER_QCOM_RPMHPD_H
+
+/* Generic RPMH Power Domain Indexes */
+#define CX               0
+#define MX               1
+#define CX_AO            2
+#define MX_AO            3
+#define GFX              4
+#define MSS              5
+#define EBI              6
+#define LCX              7
+#define LMX              8
+#define MMCX             9
+#define MMCX_AO          10
+#define MXC              11
+#define MXC_AO           12
+#define NSP              13
+#define NSP0             14
+#define NSP1             15
+#define QPHY             16
+#define DDR              17
+#define XO               18
+
+#endif