[v1,1/3] dt-bindings: qspi: cdns,qspi-nor: Add clocks for StarFive JH7110 SoC

Message ID 20230526062529.46747-2-william.qiu@starfivetech.com
State New
Headers
Series Add initialization of clock for StarFive JH7110 SoC |

Commit Message

William Qiu May 26, 2023, 6:25 a.m. UTC
  The QSPI controller needs three clock items to work properly on StarFive
JH7110 SoC, so there is need to change the maxItems's value to 3. Other
platforms do not have this constraint.

Signed-off-by: William Qiu <william.qiu@starfivetech.com>
Reviewed-by: Hal Feng <hal.feng@starfivetech.com>
---
 .../devicetree/bindings/spi/cdns,qspi-nor.yaml    | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
  

Comments

Mark Brown May 26, 2023, 3:33 p.m. UTC | #1
On Fri, May 26, 2023 at 02:25:27PM +0800, William Qiu wrote:

>      then:
>        properties:
> +        clocks:
> +          maxItems: 3
> +
> +        clock-names:
> +          items:
> +            - const: qspi-ref
> +            - const: qspi-ahb
> +            - const: qspi-apb
> +

Are these really the names that the clocks have in the IP?  It seems
weird that they'd include the IP name in there and not just be ref, ahb
and apb.
  
William Qiu May 29, 2023, 6:44 a.m. UTC | #2
On 2023/5/26 23:33, Mark Brown wrote:
> On Fri, May 26, 2023 at 02:25:27PM +0800, William Qiu wrote:
> 
>>      then:
>>        properties:
>> +        clocks:
>> +          maxItems: 3
>> +
>> +        clock-names:
>> +          items:
>> +            - const: qspi-ref
>> +            - const: qspi-ahb
>> +            - const: qspi-apb
>> +
> 
> Are these really the names that the clocks have in the IP?  It seems
> weird that they'd include the IP name in there and not just be ref, ahb
> and apb.
Hi Mark,

	These three clocks are the internal clocks in the IP. The AHB
clock is the main system clock used to transfer data over the AHB bus
between an external master and the QSPI controller. The APB clock is used
to access the register map of the QSPI controller, perform controller and
device configuration.service interrupts and control certain run time modes.
The reference clock is used to serialize the data and drive the external
SPI interface.

	I'm going to change the names of these three clocks to hclk, pclk,
and ref_clk, as defined in the data book. What do you think?

	Thanks for taking time to review this patch series and give useful
suggestions.

Best regards,
William
  
Mark Brown May 30, 2023, 10:02 a.m. UTC | #3
On Mon, May 29, 2023 at 02:44:13PM +0800, William Qiu wrote:
> On 2023/5/26 23:33, Mark Brown wrote:
> > On Fri, May 26, 2023 at 02:25:27PM +0800, William Qiu wrote:

> >> +        clock-names:
> >> +          items:
> >> +            - const: qspi-ref
> >> +            - const: qspi-ahb
> >> +            - const: qspi-apb

> 	I'm going to change the names of these three clocks to hclk, pclk,
> and ref_clk, as defined in the data book. What do you think?

That looks fine.  ref, ahb and apb would also be fine, it's just the
qspi- prefix that I was querying.
  
William Qiu May 31, 2023, 2:24 a.m. UTC | #4
On 2023/5/30 18:02, Mark Brown wrote:
> On Mon, May 29, 2023 at 02:44:13PM +0800, William Qiu wrote:
>> On 2023/5/26 23:33, Mark Brown wrote:
>> > On Fri, May 26, 2023 at 02:25:27PM +0800, William Qiu wrote:
> 
>> >> +        clock-names:
>> >> +          items:
>> >> +            - const: qspi-ref
>> >> +            - const: qspi-ahb
>> >> +            - const: qspi-apb
> 
>> 	I'm going to change the names of these three clocks to hclk, pclk,
>> and ref_clk, as defined in the data book. What do you think?
> 
> That looks fine.  ref, ahb and apb would also be fine, it's just the
> qspi- prefix that I was querying.

That's fine. I will fix it in next version.

Best regards,
William
  

Patch

diff --git a/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml b/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
index b310069762dd..737f1c162e01 100644
--- a/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
+++ b/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
@@ -26,6 +26,15 @@  allOf:
             const: starfive,jh7110-qspi
     then:
       properties:
+        clocks:
+          maxItems: 3
+
+        clock-names:
+          items:
+            - const: qspi-ref
+            - const: qspi-ahb
+            - const: qspi-apb
+
         resets:
           minItems: 2
           maxItems: 3
@@ -38,6 +47,9 @@  allOf:
 
     else:
       properties:
+        clocks:
+          maxItems: 1
+
         resets:
           maxItems: 2
 
@@ -69,9 +81,6 @@  properties:
   interrupts:
     maxItems: 1
 
-  clocks:
-    maxItems: 1
-
   cdns,fifo-depth:
     description:
       Size of the data FIFO in words.