mbox series

[v3,0/6] Add SPI4 support for IPQ5424

Message ID 20241227072446.2545148-1-quic_mmanikan@quicinc.com (mailing list archive)
Headers show
Series Add SPI4 support for IPQ5424 | expand

Message

Manikanta Mylavarapu Dec. 27, 2024, 7:24 a.m. UTC
Add SPI4 node to the IPQ5424 device tree and update the relevant
bindings, GPIO pin mappings accordingly.

Changes in V3:
	- Rename SPI0 to SPI4 because SPI protocol runs on serial engine 4
	- Fixed all review comments from Konrad Dybico
	- Patch #1 to #4 added in V3 to rename SPI0 clocks, gpio pins to SPI4.  
	- Detailed change logs are added to the respective patches

V2 can be found at:
https://lore.kernel.org/linux-arm-msm/20241217091308.3253897-1-quic_mmanikan@quicinc.com/

V1 can be found at:
https://lore.kernel.org/linux-arm-msm/20241122124505.1688436-1-quic_mmanikan@quicinc.com/

Manikanta Mylavarapu (6):
  dt-bindings: pinctrl: qcom: rename spi0 pins on IPQ5424
  dt-bindings: clock: qcom: gcc-ipq5424: add spi4 clocks
  pinctrl: qcom: ipq5424: rename spi0 pins
  clk: qcom: ipq5424: rename spi0 clocks
  arm64: dts: qcom: ipq5424: add spi4 node
  arm64: dts: qcom: ipq5424: configure spi4 node for rdp466

 .../bindings/pinctrl/qcom,ipq5424-tlmm.yaml   |  2 +-
 arch/arm64/boot/dts/qcom/ipq5424-rdp466.dts   | 43 +++++++++++++++++++
 arch/arm64/boot/dts/qcom/ipq5424.dtsi         | 11 +++++
 drivers/clk/qcom/gcc-ipq5424.c                | 20 ++++-----
 drivers/pinctrl/qcom/pinctrl-ipq5424.c        | 32 +++++++-------
 include/dt-bindings/clock/qcom,ipq5424-gcc.h  |  2 +
 6 files changed, 83 insertions(+), 27 deletions(-)


base-commit: 8155b4ef3466f0e289e8fcc9e6e62f3f4dceeac2

Comments

Kathiravan Thirumoorthy Dec. 30, 2024, 6:51 a.m. UTC | #1
On 12/27/2024 12:54 PM, Manikanta Mylavarapu wrote:
> Add SPI4 node to the IPQ5424 device tree and update the relevant
> bindings, GPIO pin mappings accordingly.
> 
> Changes in V3:
> 	- Rename SPI0 to SPI4 because SPI protocol runs on serial engine 4

Do we really need to do this? If so, it will not align with the HW 
documentation and will lead to the confusion down the line. IMHO, we 
should stick with the convention followed in the HW documentation.

Thanks,
Kathiravan T.
Konrad Dybcio Dec. 30, 2024, 1:54 p.m. UTC | #2
On 30.12.2024 7:51 AM, Kathiravan Thirumoorthy wrote:
> 
> 
> On 12/27/2024 12:54 PM, Manikanta Mylavarapu wrote:
>> Add SPI4 node to the IPQ5424 device tree and update the relevant
>> bindings, GPIO pin mappings accordingly.
>>
>> Changes in V3:
>>     - Rename SPI0 to SPI4 because SPI protocol runs on serial engine 4
> 
> Do we really need to do this? If so, it will not align with the HW documentation and will lead to the confusion down the line. IMHO, we should stick with the convention followed in the HW documentation.

+1, the clocks are called SPI0/SPI1 internally

Konrad
Konrad Dybcio Dec. 30, 2024, 1:58 p.m. UTC | #3
On 30.12.2024 2:54 PM, Konrad Dybcio wrote:
> On 30.12.2024 7:51 AM, Kathiravan Thirumoorthy wrote:
>>
>>
>> On 12/27/2024 12:54 PM, Manikanta Mylavarapu wrote:
>>> Add SPI4 node to the IPQ5424 device tree and update the relevant
>>> bindings, GPIO pin mappings accordingly.
>>>
>>> Changes in V3:
>>>     - Rename SPI0 to SPI4 because SPI protocol runs on serial engine 4
>>
>> Do we really need to do this? If so, it will not align with the HW documentation and will lead to the confusion down the line. IMHO, we should stick with the convention followed in the HW documentation.
> 
> +1, the clocks are called SPI0/SPI1 internally

Ok, I looked at a bit more documentation and it looks like
somebody just had fun naming things..

SPI0 is on SE4 and SPI1 is on something else, with no more
clock provisions for that protocol.. Which is not usually the
case.

Let's just go with what you guys use internally, as this is
mighty spaghetti

Konrad
Kathiravan Thirumoorthy Dec. 30, 2024, 3:34 p.m. UTC | #4
On 12/30/2024 7:28 PM, Konrad Dybcio wrote:
> On 30.12.2024 2:54 PM, Konrad Dybcio wrote:
>> On 30.12.2024 7:51 AM, Kathiravan Thirumoorthy wrote:
>>>
>>>
>>> On 12/27/2024 12:54 PM, Manikanta Mylavarapu wrote:
>>>> Add SPI4 node to the IPQ5424 device tree and update the relevant
>>>> bindings, GPIO pin mappings accordingly.
>>>>
>>>> Changes in V3:
>>>>      - Rename SPI0 to SPI4 because SPI protocol runs on serial engine 4
>>>
>>> Do we really need to do this? If so, it will not align with the HW documentation and will lead to the confusion down the line. IMHO, we should stick with the convention followed in the HW documentation.
>>
>> +1, the clocks are called SPI0/SPI1 internally
> 
> Ok, I looked at a bit more documentation and it looks like
> somebody just had fun naming things..
> 
> SPI0 is on SE4 and SPI1 is on something else, with no more
> clock provisions for that protocol.. Which is not usually the
> case.


IPQ5424 has one QUPV3 instance with 6 SEs. SE0-SE4 are Mini core and SE5 
is FW core.

SE0 and SE1 are for 4-wire UART and 2-wire UART respectively. SE2 and 
SE3 are for I2C protocol. SE4 is for SPI.

Since SE5 is FW based (some RDPs use this SE for I2C). In GCC block, 
clocks for this instance is named after SPI as SPI1.


> 
> Let's just go with what you guys use internally, as this is
> mighty spaghetti
> 
> Konrad
Konrad Dybcio Dec. 30, 2024, 3:36 p.m. UTC | #5
On 30.12.2024 4:34 PM, Kathiravan Thirumoorthy wrote:
> 
> 
> On 12/30/2024 7:28 PM, Konrad Dybcio wrote:
>> On 30.12.2024 2:54 PM, Konrad Dybcio wrote:
>>> On 30.12.2024 7:51 AM, Kathiravan Thirumoorthy wrote:
>>>>
>>>>
>>>> On 12/27/2024 12:54 PM, Manikanta Mylavarapu wrote:
>>>>> Add SPI4 node to the IPQ5424 device tree and update the relevant
>>>>> bindings, GPIO pin mappings accordingly.
>>>>>
>>>>> Changes in V3:
>>>>>      - Rename SPI0 to SPI4 because SPI protocol runs on serial engine 4
>>>>
>>>> Do we really need to do this? If so, it will not align with the HW documentation and will lead to the confusion down the line. IMHO, we should stick with the convention followed in the HW documentation.
>>>
>>> +1, the clocks are called SPI0/SPI1 internally
>>
>> Ok, I looked at a bit more documentation and it looks like
>> somebody just had fun naming things..
>>
>> SPI0 is on SE4 and SPI1 is on something else, with no more
>> clock provisions for that protocol.. Which is not usually the
>> case.
> 
> 
> IPQ5424 has one QUPV3 instance with 6 SEs. SE0-SE4 are Mini core and SE5 is FW core.
> 
> SE0 and SE1 are for 4-wire UART and 2-wire UART respectively. SE2 and SE3 are for I2C protocol. SE4 is for SPI.
> 
> Since SE5 is FW based (some RDPs use this SE for I2C). In GCC block, clocks for this instance is named after SPI as SPI1.

Thanks for the explanation.

Manikanta, please refer to this in the commit message as well

Konrad
Manikanta Mylavarapu Jan. 2, 2025, 6 a.m. UTC | #6
On 12/30/2024 9:06 PM, Konrad Dybcio wrote:
> On 30.12.2024 4:34 PM, Kathiravan Thirumoorthy wrote:
>>
>>
>> On 12/30/2024 7:28 PM, Konrad Dybcio wrote:
>>> On 30.12.2024 2:54 PM, Konrad Dybcio wrote:
>>>> On 30.12.2024 7:51 AM, Kathiravan Thirumoorthy wrote:
>>>>>
>>>>>
>>>>> On 12/27/2024 12:54 PM, Manikanta Mylavarapu wrote:
>>>>>> Add SPI4 node to the IPQ5424 device tree and update the relevant
>>>>>> bindings, GPIO pin mappings accordingly.
>>>>>>
>>>>>> Changes in V3:
>>>>>>      - Rename SPI0 to SPI4 because SPI protocol runs on serial engine 4
>>>>>
>>>>> Do we really need to do this? If so, it will not align with the HW documentation and will lead to the confusion down the line. IMHO, we should stick with the convention followed in the HW documentation.
>>>>
>>>> +1, the clocks are called SPI0/SPI1 internally
>>>
>>> Ok, I looked at a bit more documentation and it looks like
>>> somebody just had fun naming things..
>>>
>>> SPI0 is on SE4 and SPI1 is on something else, with no more
>>> clock provisions for that protocol.. Which is not usually the
>>> case.
>>
>>
>> IPQ5424 has one QUPV3 instance with 6 SEs. SE0-SE4 are Mini core and SE5 is FW core.
>>
>> SE0 and SE1 are for 4-wire UART and 2-wire UART respectively. SE2 and SE3 are for I2C protocol. SE4 is for SPI.
>>
>> Since SE5 is FW based (some RDPs use this SE for I2C). In GCC block, clocks for this instance is named after SPI as SPI1.
> 
> Thanks for the explanation.
> 
> Manikanta, please refer to this in the commit message as well
> 


Thank you, Konrad and Kathiravan, for your valuable insights.
I will incorporate the aforementioned information into the commit message, revert the 'renaming spi0 to spi4',
and include both spi0 and spi1 in the next version.

Thanks & Regards,
Manikanta.