[PATCH v2 2/7] dt-bindings: clock: brcm,kona-ccu: Add BCM281xx bus clocks

Artur Weber posted 7 patches 11 months, 1 week ago
There is a newer version of this series
[PATCH v2 2/7] dt-bindings: clock: brcm,kona-ccu: Add BCM281xx bus clocks
Posted by Artur Weber 11 months, 1 week ago
Add bus clocks corresponding to peripheral clocks currently supported
by the BCM281xx clock driver and add the relevant clock IDs to the
clock/bcm281xx.h dt-bindings header.

Signed-off-by: Artur Weber <aweber.kernel@gmail.com>
---
Changes in v2:
- Add this commit (BCM281xx bus clocks)
---
 .../devicetree/bindings/clock/brcm,kona-ccu.yaml   | 21 +++++++++++++++++-
 include/dt-bindings/clock/bcm281xx.h               | 25 +++++++++++++++++++---
 2 files changed, 42 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/brcm,kona-ccu.yaml b/Documentation/devicetree/bindings/clock/brcm,kona-ccu.yaml
index dff04e24e92829b890bf7cd336f0e083bdb30fa6..3f7ebaaf3aa7b918c312ab2473bda5ea3b5a1d8e 100644
--- a/Documentation/devicetree/bindings/clock/brcm,kona-ccu.yaml
+++ b/Documentation/devicetree/bindings/clock/brcm,kona-ccu.yaml
@@ -40,7 +40,7 @@ properties:
 
   clock-output-names:
     minItems: 1
-    maxItems: 14
+    maxItems: 20
 
 required:
   - compatible
@@ -61,6 +61,8 @@ allOf:
             - const: hub_timer
             - const: pmu_bsc
             - const: pmu_bsc_var
+            - const: hub_timer_apb
+            - const: pmu_bsc_apb
   - if:
       properties:
         compatible:
@@ -86,6 +88,13 @@ allOf:
             - const: usb_ic
             - const: hsic2_48m
             - const: hsic2_12m
+            - const: sdio1_ahb
+            - const: sdio2_ahb
+            - const: sdio3_ahb
+            - const: sdio4_ahb
+            - const: usb_ic_ahb
+            - const: hsic2_ahb
+            - const: usb_otg_ahb
   - if:
       properties:
         compatible:
@@ -116,6 +125,16 @@ allOf:
             - const: bsc2
             - const: bsc3
             - const: pwm
+            - const: uartb_apb
+            - const: uartb2_apb
+            - const: uartb3_apb
+            - const: uartb4_apb
+            - const: ssp0_apb
+            - const: ssp2_apb
+            - const: bsc1_apb
+            - const: bsc2_apb
+            - const: bsc3_apb
+            - const: pwm_apb
   - if:
       properties:
         compatible:
diff --git a/include/dt-bindings/clock/bcm281xx.h b/include/dt-bindings/clock/bcm281xx.h
index d74ca42112e79746c513f6861a89628ee03f0f79..15449f998eb7a5a191fd847b689cfbe60b27c541 100644
--- a/include/dt-bindings/clock/bcm281xx.h
+++ b/include/dt-bindings/clock/bcm281xx.h
@@ -34,7 +34,9 @@
 #define BCM281XX_AON_CCU_HUB_TIMER		0
 #define BCM281XX_AON_CCU_PMU_BSC		1
 #define BCM281XX_AON_CCU_PMU_BSC_VAR		2
-#define BCM281XX_AON_CCU_CLOCK_COUNT		3
+#define BCM281XX_AON_CCU_HUB_TIMER_APB		3
+#define BCM281XX_AON_CCU_PMU_BSC_APB		4
+#define BCM281XX_AON_CCU_CLOCK_COUNT		5
 
 /* hub CCU clock ids */
 
@@ -50,7 +52,14 @@
 #define BCM281XX_MASTER_CCU_USB_IC		4
 #define BCM281XX_MASTER_CCU_HSIC2_48M		5
 #define BCM281XX_MASTER_CCU_HSIC2_12M		6
-#define BCM281XX_MASTER_CCU_CLOCK_COUNT		7
+#define BCM281XX_MASTER_CCU_SDIO1_AHB		7
+#define BCM281XX_MASTER_CCU_SDIO2_AHB		8
+#define BCM281XX_MASTER_CCU_SDIO3_AHB		9
+#define BCM281XX_MASTER_CCU_SDIO4_AHB		10
+#define BCM281XX_MASTER_CCU_USB_IC_AHB		11
+#define BCM281XX_MASTER_CCU_HSIC2_AHB		12
+#define BCM281XX_MASTER_CCU_USB_OTG_AHB		13
+#define BCM281XX_MASTER_CCU_CLOCK_COUNT		14
 
 /* slave CCU clock ids */
 
@@ -64,6 +73,16 @@
 #define BCM281XX_SLAVE_CCU_BSC2			7
 #define BCM281XX_SLAVE_CCU_BSC3			8
 #define BCM281XX_SLAVE_CCU_PWM			9
-#define BCM281XX_SLAVE_CCU_CLOCK_COUNT		10
+#define BCM281XX_SLAVE_CCU_UARTB_APB		10
+#define BCM281XX_SLAVE_CCU_UARTB2_APB		11
+#define BCM281XX_SLAVE_CCU_UARTB3_APB		12
+#define BCM281XX_SLAVE_CCU_UARTB4_APB		13
+#define BCM281XX_SLAVE_CCU_SSP0_APB		14
+#define BCM281XX_SLAVE_CCU_SSP2_APB		15
+#define BCM281XX_SLAVE_CCU_BSC1_APB		16
+#define BCM281XX_SLAVE_CCU_BSC2_APB		17
+#define BCM281XX_SLAVE_CCU_BSC3_APB		18
+#define BCM281XX_SLAVE_CCU_PWM_APB		19
+#define BCM281XX_SLAVE_CCU_CLOCK_COUNT		20
 
 #endif /* _CLOCK_BCM281XX_H */

-- 
2.48.1
Re: [PATCH v2 2/7] dt-bindings: clock: brcm,kona-ccu: Add BCM281xx bus clocks
Posted by Krzysztof Kozlowski 11 months, 1 week ago
On Mon, Mar 03, 2025 at 09:27:50PM +0100, Artur Weber wrote:
>    - if:
>        properties:
>          compatible:
> diff --git a/include/dt-bindings/clock/bcm281xx.h b/include/dt-bindings/clock/bcm281xx.h
> index d74ca42112e79746c513f6861a89628ee03f0f79..15449f998eb7a5a191fd847b689cfbe60b27c541 100644
> --- a/include/dt-bindings/clock/bcm281xx.h
> +++ b/include/dt-bindings/clock/bcm281xx.h
> @@ -34,7 +34,9 @@
>  #define BCM281XX_AON_CCU_HUB_TIMER		0
>  #define BCM281XX_AON_CCU_PMU_BSC		1
>  #define BCM281XX_AON_CCU_PMU_BSC_VAR		2
> -#define BCM281XX_AON_CCU_CLOCK_COUNT		3

You cannot change defines, it is an ABI. Unless it is not an ABI... so
just drop all these counts in separate patch, just like we were doing
for other platforms.

Best regards,
Krzysztof
Re: [PATCH v2 2/7] dt-bindings: clock: brcm,kona-ccu: Add BCM281xx bus clocks
Posted by Artur Weber 11 months, 1 week ago
On 4.03.2025 08:35, Krzysztof Kozlowski wrote:
> On Mon, Mar 03, 2025 at 09:27:50PM +0100, Artur Weber wrote:
>>     - if:
>>         properties:
>>           compatible:
>> diff --git a/include/dt-bindings/clock/bcm281xx.h b/include/dt-bindings/clock/bcm281xx.h
>> index d74ca42112e79746c513f6861a89628ee03f0f79..15449f998eb7a5a191fd847b689cfbe60b27c541 100644
>> --- a/include/dt-bindings/clock/bcm281xx.h
>> +++ b/include/dt-bindings/clock/bcm281xx.h
>> @@ -34,7 +34,9 @@
>>   #define BCM281XX_AON_CCU_HUB_TIMER		0
>>   #define BCM281XX_AON_CCU_PMU_BSC		1
>>   #define BCM281XX_AON_CCU_PMU_BSC_VAR		2
>> -#define BCM281XX_AON_CCU_CLOCK_COUNT		3
> 
> You cannot change defines, it is an ABI. Unless it is not an ABI... so
> just drop all these counts in separate patch, just like we were doing
> for other platforms.

The clock count defines are not used in device trees, only in the 
driver. Most likely clock count defines were included since the driver
already uses clock ID defines from the DT binding header.

I'll drop the clock count defines in the next version, and see what I
can do to adapt the clock driver.

Best regards
Artur
Re: [PATCH v2 2/7] dt-bindings: clock: brcm,kona-ccu: Add BCM281xx bus clocks
Posted by Rob Herring (Arm) 11 months, 1 week ago
On Mon, 03 Mar 2025 21:27:50 +0100, Artur Weber wrote:
> Add bus clocks corresponding to peripheral clocks currently supported
> by the BCM281xx clock driver and add the relevant clock IDs to the
> clock/bcm281xx.h dt-bindings header.
> 
> Signed-off-by: Artur Weber <aweber.kernel@gmail.com>
> ---
> Changes in v2:
> - Add this commit (BCM281xx bus clocks)
> ---
>  .../devicetree/bindings/clock/brcm,kona-ccu.yaml   | 21 +++++++++++++++++-
>  include/dt-bindings/clock/bcm281xx.h               | 25 +++++++++++++++++++---
>  2 files changed, 42 insertions(+), 4 deletions(-)
> 

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/clock/brcm,kona-ccu.example.dtb: clock-controller@3e011000: clock-output-names: ['uartb', 'uartb2', 'uartb3', 'uartb4', 'ssp0', 'ssp2', 'bsc1', 'bsc2', 'bsc3', 'pwm'] is too short
	from schema $id: http://devicetree.org/schemas/clock/brcm,kona-ccu.yaml#

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20250303-kona-bus-clock-v2-2-a363c6a6b798@gmail.com

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.