clk: bcm: kona: Add bus clock support, bus clocks for BCM21664/BCM281xx
Subsystems (5)
v6 cover clk: bcm: kona: Add bus clock support, bus clocks for BCM21664/BCM281xx
This patchset does the following:
- Introduce support for bus clocks. These are fairly similar to peripheral clocks, but only implement policy, gate and hyst.
- Add matching bus clocks for BCM21664 and BCM281xx peripheral clocks and update device tree bindings to match.
---
Changes in v6:
- Rebase on v6.16
- Make kona_bus_clk_ops const, add a new commit to make kona_peri_clk_ops const as well
- Link to v5: https://lore.kernel.org/r/[email protected]/
Changes in v5:
- Pick up Reviewed-by trailer from Krzysztof on patch 3
- Rebase on v6.14
- No code changes since v4
- Link to v4: https://lore.kernel.org/r/[email protected]
Changes in v4:
- Rename moved CLOCK_COUNT defines to CLK_COUNT to avoid redefinition
- Squash BCM21664/BCM281xx bus clock DT bindings commits together
- Link to v3: https://lore.kernel.org/r/[email protected]
Changes in v3:
- Fix DT schema example in BCM281xx bus clock bindings
- Move CLOCK_COUNT defines from dt-bindings header to the driver
- Fix BCM21664 UARTBx_APB IDs being out of order compared to clock
driver
- Link to v2: https://lore.kernel.org/r/[email protected]
Changes in v2:
- Drop prerequisite clock patch
- Move clock/bcm21664.h dt-bindings header change to dt-bindings patch
- Add BCM281xx bus clocks
- Link to v1: https://lore.kernel.org/r/[email protected]
---
Artur Weber (9):
clk: bcm: kona: Move CLOCK_COUNT defines into the driver
dt-bindings: clock: brcm,kona-ccu: Drop CLOCK_COUNT defines from DT headers
dt-bindings: clock: brcm,kona-ccu: Add BCM21664 and BCM281xx bus clocks
clk: bcm: kona: Make kona_peri_clk_ops const
clk: bcm: kona: Add support for bus clocks
clk: bcm21664: Add corresponding bus clocks for peripheral clocks
clk: bcm281xx: Add corresponding bus clocks for peripheral clocks
ARM: dts: bcm2166x-common: Add matching bus clocks for peripheral clocks
ARM: dts: bcm11351: Add corresponding bus clocks for peripheral clocks
.../devicetree/bindings/clock/brcm,kona-ccu.yaml | 49 ++++++- arch/arm/boot/dts/broadcom/bcm11351.dtsi | 33 +++-- arch/arm/boot/dts/broadcom/bcm2166x-common.dtsi | 28 ++-- drivers/clk/bcm/clk-bcm21664.c | 99 ++++++++++++++- drivers/clk/bcm/clk-bcm281xx.c | 141 ++++++++++++++++++++- drivers/clk/bcm/clk-kona-setup.c | 116 +++++++++++++++++ drivers/clk/bcm/clk-kona.c | 64 +++++++++- drivers/clk/bcm/clk-kona.h | 14 +- include/dt-bindings/clock/bcm21664.h | 17 ++- include/dt-bindings/clock/bcm281xx.h | 24 +++- 10 files changed, 540 insertions(+), 45 deletions(-)
---
base-commit: 038d61fd642278bab63ee8ef722c50d10ab01e8f
change-id: 20250212-kona-bus-clock-4297eefae940
Best regards,
Signature · 1 line
Artur Weber <[email protected]>
PATCH RESEND v6 1/9 clk: bcm: kona: Move CLOCK_COUNT defines into the driver
CLOCK_COUNT defines for each CCU are stored in the DT binding header. This is not correct - they are not used by device trees, only internally by the driver.
Move the CLOCK_COUNT defines directly into the driver in preparation for dropping them from the DT binding include. To avoid conflicts with the old defines, rename them to use the CLK_COUNT suffix.
---
Changes in v4:
- Rename CLOCK_COUNT to CLK_COUNT to avoid redefinition
Changes in v3:
- Add this commit
--- drivers/clk/bcm/clk-bcm21664.c | 16 ++++++++++++---- drivers/clk/bcm/clk-bcm281xx.c | 20 +++++++++++++++----- drivers/clk/bcm/clk-kona.h | 2 +- 3 files changed, 28 insertions(+), 10 deletions(-)
drivers/clk/bcm/clk-bcm21664.c +12 -4
@@ -17,13 +17,15 @@ static struct peri_clk_data frac_1m_data = { .clocks = CLOCKS("ref_crystal"), }; +#define BCM21664_ROOT_CCU_CLK_COUNT (BCM21664_ROOT_CCU_FRAC_1M + 1) +static struct ccu_data root_ccu_data = {BCM21664_CCU_COMMON (root,ROOT ),/* no policy control */ .kona_clks = { [BCM21664_ROOT_CCU_FRAC_1M ] =KONA_CLK (root, frac_1m, peri), - [BCM21664_ROOT_CCU_CLOCK_COUNT ] =LAST_KONA_CLK , + [BCM21664_ROOT_CCU_CLK_COUNT ] =LAST_KONA_CLK , }, };
@@ -39,6 +41,8 @@ static struct peri_clk_data hub_timer_data = { .trig = TRIGGER(0x0a40, 4), }; +#define BCM21664_AON_CCU_CLK_COUNT (BCM21664_AON_CCU_HUB_TIMER + 1) +static struct ccu_data aon_ccu_data = {BCM21664_CCU_COMMON (aon,AON ), .policy = {
@@ -48,7 +52,7 @@ static struct ccu_data aon_ccu_data = { .kona_clks = { [BCM21664_AON_CCU_HUB_TIMER] = KONA_CLK(aon, hub_timer, peri), - [BCM21664_AON_CCU_CLOCK_COUNT] = LAST_KONA_CLK, + [BCM21664_AON_CCU_CLK_COUNT] = LAST_KONA_CLK, }, };
@@ -122,6 +126,8 @@ static struct peri_clk_data sdio4_sleep_data = { .gate = HW_SW_GATE(0x0360, 18, 2, 3), }; +#define BCM21664_MASTER_CCU_CLK_COUNT (BCM21664_MASTER_CCU_SDIO4_SLEEP + 1) +static struct ccu_data master_ccu_data = {BCM21664_CCU_COMMON (master,MASTER ), .policy = {
@@ -145,7 +151,7 @@ static struct ccu_data master_ccu_data = { KONA_CLK(master, sdio3_sleep, peri), [BCM21664_MASTER_CCU_SDIO4_SLEEP ] = KONA_CLK(master, sdio4_sleep, peri), - [BCM21664_MASTER_CCU_CLOCK_COUNT] = LAST_KONA_CLK, + [BCM21664_MASTER_CCU_CLK_COUNT] = LAST_KONA_CLK, }, };
@@ -225,6 +231,8 @@ static struct peri_clk_data bsc4_data = { .trig = TRIGGER(0x0afc, 19), }; +#define BCM21664_SLAVE_CCU_CLK_COUNT (BCM21664_SLAVE_CCU_BSC4 + 1) +static struct ccu_data slave_ccu_data = {BCM21664_CCU_COMMON (slave,SLAVE ), .policy = {
@@ -246,7 +254,7 @@ static struct ccu_data slave_ccu_data = { KONA_CLK(slave, bsc3, peri), [BCM21664_SLAVE_CCU_BSC4 ] = KONA_CLK(slave, bsc4, peri), - [BCM21664_SLAVE_CCU_CLOCK_COUNT] = LAST_KONA_CLK, + [BCM21664_SLAVE_CCU_CLK_COUNT] = LAST_KONA_CLK, }, };
drivers/clk/bcm/clk-bcm281xx.c +15 -5
@@ -19,12 +19,14 @@ static struct peri_clk_data frac_1m_data = { .clocks = CLOCKS("ref_crystal"), }; +#define BCM281XX_ROOT_CCU_CLK_COUNT (BCM281XX_ROOT_CCU_FRAC_1M + 1) +static struct ccu_data root_ccu_data = {BCM281XX_CCU_COMMON (root,ROOT ), .kona_clks = { [BCM281XX_ROOT_CCU_FRAC_1M ] =KONA_CLK (root, frac_1m, peri), - [BCM281XX_ROOT_CCU_CLOCK_COUNT ] =LAST_KONA_CLK , + [BCM281XX_ROOT_CCU_CLK_COUNT ] =LAST_KONA_CLK , }, };
@@ -57,6 +59,8 @@ static struct peri_clk_data pmu_bsc_var_data = { .trig = TRIGGER(0x0a40, 2), }; +#define BCM281XX_AON_CCU_CLK_COUNT (BCM281XX_AON_CCU_PMU_BSC_VAR + 1) +static struct ccu_data aon_ccu_data = {BCM281XX_CCU_COMMON (aon,AON ), .kona_clks = {
@@ -66,7 +70,7 @@ static struct ccu_data aon_ccu_data = { KONA_CLK(aon, pmu_bsc, peri), [BCM281XX_AON_CCU_PMU_BSC_VAR ] = KONA_CLK(aon, pmu_bsc_var, peri), - [BCM281XX_AON_CCU_CLOCK_COUNT] = LAST_KONA_CLK, + [BCM281XX_AON_CCU_CLK_COUNT] = LAST_KONA_CLK, }, };
@@ -80,12 +84,14 @@ static struct peri_clk_data tmon_1m_data = { .trig = TRIGGER(0x0e84, 1), }; +#define BCM281XX_HUB_CCU_CLK_COUNT (BCM281XX_HUB_CCU_TMON_1M + 1) +static struct ccu_data hub_ccu_data = {BCM281XX_CCU_COMMON (hub,HUB ), .kona_clks = { [BCM281XX_HUB_CCU_TMON_1M ] =KONA_CLK (hub, tmon_1m, peri), - [BCM281XX_HUB_CCU_CLOCK_COUNT ] =LAST_KONA_CLK , + [BCM281XX_HUB_CCU_CLK_COUNT ] =LAST_KONA_CLK , }, };
@@ -172,6 +178,8 @@ static struct peri_clk_data hsic2_12m_data = { .trig = TRIGGER(0x0afc, 5), }; +#define BCM281XX_MASTER_CCU_CLK_COUNT (BCM281XX_MASTER_CCU_HSIC2_12M + 1) +static struct ccu_data master_ccu_data = {BCM281XX_CCU_COMMON (master,MASTER ), .kona_clks = {
@@ -189,7 +197,7 @@ static struct ccu_data master_ccu_data = { KONA_CLK(master, hsic2_48m, peri), [BCM281XX_MASTER_CCU_HSIC2_12M ] = KONA_CLK(master, hsic2_12m, peri), - [BCM281XX_MASTER_CCU_CLOCK_COUNT] = LAST_KONA_CLK, + [BCM281XX_MASTER_CCU_CLK_COUNT] = LAST_KONA_CLK, }, };
@@ -301,6 +309,8 @@ static struct peri_clk_data pwm_data = { .trig = TRIGGER(0x0afc, 15), }; +#define BCM281XX_SLAVE_CCU_CLK_COUNT (BCM281XX_SLAVE_CCU_PWM + 1) +static struct ccu_data slave_ccu_data = {BCM281XX_CCU_COMMON (slave,SLAVE ), .kona_clks = {
@@ -324,7 +334,7 @@ static struct ccu_data slave_ccu_data = { KONA_CLK(slave, bsc3, peri), [BCM281XX_SLAVE_CCU_PWM ] = KONA_CLK(slave, pwm, peri), - [BCM281XX_SLAVE_CCU_CLOCK_COUNT] = LAST_KONA_CLK, + [BCM281XX_SLAVE_CCU_CLK_COUNT] = LAST_KONA_CLK, }, };
drivers/clk/bcm/clk-kona.h +1 -1
@@ -483,7 +483,7 @@ struct ccu_data {#define KONA_CCU_COMMON (_prefix, _name, _ccuname) \ .name = #_name "_ccu", \ .lock = __SPIN_LOCK_UNLOCKED(_name ## _ccu_data.lock), \ - .clk_num = _prefix ## _ ## _ccuname ## _CCU_CLOCK_COUNT + .clk_num = _prefix ## _ ## _ccuname ## _CCU_CLK_COUNT/* Exported globals */
Signature · 1 line
2.51.0
PATCH RESEND v6 2/9 dt-bindings: clock: brcm,kona-ccu: Drop CLOCK_COUNT defines from DT headers
In reply to Artur WeberThe CLOCK_COUNT defines are not used by device trees, only by the clock driver. Keeping them in the DT binding header is frowned upon.
Since they're being moved to the clock driver directly, drop these defines from the dt-bindings header and only keep clock IDs.
---
Changes in v3:
- Add this commit
--- include/dt-bindings/clock/bcm21664.h | 4 ---- include/dt-bindings/clock/bcm281xx.h | 5 ----- 2 files changed, 9 deletions(-)
include/dt-bindings/clock/bcm21664.h +0 -4
@@ -21,12 +21,10 @@/* root CCU clock ids */ #define BCM21664_ROOT_CCU_FRAC_1M 0 -#define BCM21664_ROOT_CCU_CLOCK_COUNT 1/* aon CCU clock ids */ #define BCM21664_AON_CCU_HUB_TIMER 0 -#define BCM21664_AON_CCU_CLOCK_COUNT 1/* master CCU clock ids */
@@ -38,7 +36,6 @@#define BCM21664_MASTER_CCU_SDIO2_SLEEP 5#define BCM21664_MASTER_CCU_SDIO3_SLEEP 6#define BCM21664_MASTER_CCU_SDIO4_SLEEP 7 -#define BCM21664_MASTER_CCU_CLOCK_COUNT 8/* slave CCU clock ids */
@@ -49,6 +46,5 @@#define BCM21664_SLAVE_CCU_BSC2 4#define BCM21664_SLAVE_CCU_BSC3 5#define BCM21664_SLAVE_CCU_BSC4 6 -#define BCM21664_SLAVE_CCU_CLOCK_COUNT 7#endif /* _CLOCK_BCM21664_H */
include/dt-bindings/clock/bcm281xx.h +0 -5
@@ -27,19 +27,16 @@/* root CCU clock ids */ #define BCM281XX_ROOT_CCU_FRAC_1M 0 -#define BCM281XX_ROOT_CCU_CLOCK_COUNT 1/* aon CCU clock ids */ #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/* hub CCU clock ids */ #define BCM281XX_HUB_CCU_TMON_1M 0 -#define BCM281XX_HUB_CCU_CLOCK_COUNT 1/* master CCU clock ids */
@@ -50,7 +47,6 @@#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/* slave CCU clock ids */
@@ -64,6 +60,5 @@#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#endif /* _CLOCK_BCM281XX_H */
Signature · 1 line
2.51.0
PATCH RESEND v6 3/9 dt-bindings: clock: brcm,kona-ccu: Add BCM21664 and BCM281xx bus clocks
In reply to Artur WeberAdd bus clocks corresponding to peripheral clocks currently supported by the BCM21664 and BCM281xx clock drivers and add the relevant clock IDs to the dt-bindings headers (bcm21664.h, bcm281xx.h).
---
Changes in v4:
- Squash BCM21664 and BCM281xx bus clock bindings commits
--- .../devicetree/bindings/clock/brcm,kona-ccu.yaml | 49 ++++++++++++++++++++-- include/dt-bindings/clock/bcm21664.h | 13 ++++++ include/dt-bindings/clock/bcm281xx.h | 19 +++++++++ 3 files changed, 78 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/clock/brcm,kona-ccu.yaml +46 -3
@@ -40,7 +40,7 @@ properties: clock-output-names: minItems: 1 - maxItems: 10 + 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:
@@ -124,7 +143,9 @@ allOf: then: properties: clock-output-names: - const: hub_timer + items: + - const: hub_timer + - const: hub_timer_apb - if: properties: compatible:
@@ -142,6 +163,11 @@ allOf: - const: sdio2_sleep - const: sdio3_sleep - const: sdio4_sleep + - const: sdio1_ahb + - const: sdio2_ahb + - const: sdio3_ahb + - const: sdio4_ahb + - const: usb_otg_ahb - if: properties: compatible:
@@ -158,6 +184,13 @@ allOf: - const: bsc2 - const: bsc3 - const: bsc4 + - const: uartb_apb + - const: uartb2_apb + - const: uartb3_apb + - const: bsc1_apb + - const: bsc2_apb + - const: bsc3_apb + - const: bsc4_apb additionalProperties: false
@@ -176,6 +209,16 @@ examples: "bsc1", "bsc2", "bsc3", - "pwm"; + "pwm", + "uartb_apb", + "uartb2_apb", + "uartb3_apb", + "uartb4_apb", + "ssp0_apb", + "ssp2_apb", + "bsc1_apb", + "bsc2_apb", + "bsc3_apb", + "pwm_apb"; }; ...
include/dt-bindings/clock/bcm21664.h +13 -0
@@ -25,6 +25,7 @@/* aon CCU clock ids */ #define BCM21664_AON_CCU_HUB_TIMER 0 +#define BCM21664_AON_CCU_HUB_TIMER_APB 1/* master CCU clock ids */
@@ -36,6 +37,11 @@#define BCM21664_MASTER_CCU_SDIO2_SLEEP 5#define BCM21664_MASTER_CCU_SDIO3_SLEEP 6#define BCM21664_MASTER_CCU_SDIO4_SLEEP 7 +#define BCM21664_MASTER_CCU_SDIO1_AHB 8 +#define BCM21664_MASTER_CCU_SDIO2_AHB 9 +#define BCM21664_MASTER_CCU_SDIO3_AHB 10 +#define BCM21664_MASTER_CCU_SDIO4_AHB 11 +#define BCM21664_MASTER_CCU_USB_OTG_AHB 12/* slave CCU clock ids */
@@ -46,5 +52,12 @@#define BCM21664_SLAVE_CCU_BSC2 4#define BCM21664_SLAVE_CCU_BSC3 5#define BCM21664_SLAVE_CCU_BSC4 6 +#define BCM21664_SLAVE_CCU_UARTB_APB 7 +#define BCM21664_SLAVE_CCU_UARTB2_APB 8 +#define BCM21664_SLAVE_CCU_UARTB3_APB 9 +#define BCM21664_SLAVE_CCU_BSC1_APB 10 +#define BCM21664_SLAVE_CCU_BSC2_APB 11 +#define BCM21664_SLAVE_CCU_BSC3_APB 12 +#define BCM21664_SLAVE_CCU_BSC4_APB 13#endif /* _CLOCK_BCM21664_H */
include/dt-bindings/clock/bcm281xx.h +19 -0
@@ -33,6 +33,8 @@#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_HUB_TIMER_APB 3 +#define BCM281XX_AON_CCU_PMU_BSC_APB 4/* hub CCU clock ids */
@@ -47,6 +49,13 @@#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_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/* slave CCU clock ids */
@@ -60,5 +69,15 @@#define BCM281XX_SLAVE_CCU_BSC2 7#define BCM281XX_SLAVE_CCU_BSC3 8#define BCM281XX_SLAVE_CCU_PWM 9 +#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#endif /* _CLOCK_BCM281XX_H */
Signature · 1 line
2.51.0
PATCH RESEND v6 4/9 clk: bcm: kona: Make kona_peri_clk_ops const
In reply to Artur WeberFix a warning raised by checkpatch about non-const clk_ops by making the relevant struct const.
---
Changes in v6:
- Add this commit
--- drivers/clk/bcm/clk-kona.c | 2 +- drivers/clk/bcm/clk-kona.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/clk/bcm/clk-kona.c +1 -1
@@ -1154,7 +1154,7 @@ static int kona_peri_clk_set_rate(struct clk_hw *hw, unsigned long rate,return ret; } -struct clk_ops kona_peri_clk_ops = { +const struct clk_ops kona_peri_clk_ops = { .enable = kona_peri_clk_enable, .disable = kona_peri_clk_disable, .is_enabled = kona_peri_clk_is_enabled,
drivers/clk/bcm/clk-kona.h +1 -1
@@ -487,7 +487,7 @@ struct ccu_data {/* Exported globals */ -extern struct clk_ops kona_peri_clk_ops; +extern const struct clk_ops kona_peri_clk_ops;/* Externally visible functions */
Signature · 1 line
2.51.0
PATCH RESEND v6 5/9 clk: bcm: kona: Add support for bus clocks
In reply to Artur WeberIntroduce support for bus clocks into the Broadcom Kona common clock driver. Most of these functions have been adapted from their peripheral clock counterparts, as they are nearly identical (bus clocks are just much more limited in terms of allowed operations).
---
Changes in v6:
- Made kona_bus_clk_ops const
--- drivers/clk/bcm/clk-kona-setup.c | 116 +++++++++++++++++++++++++++++++++++++++ drivers/clk/bcm/clk-kona.c | 62 ++++++++++++++++++++- drivers/clk/bcm/clk-kona.h | 10 ++++ 3 files changed, 187 insertions(+), 1 deletion(-)
drivers/clk/bcm/clk-kona-setup.c +116 -0
@@ -167,6 +167,58 @@ static bool peri_clk_data_offsets_valid(struct kona_clk *bcm_clk)return true; } +static bool bus_clk_data_offsets_valid (struct kona_clk *bcm_clk) +{ +struct bus_clk_data *bus; +struct bcm_clk_policy *policy; +struct bcm_clk_gate *gate; +struct bcm_clk_hyst *hyst; +const char *name; +u32 range; +u32 limit; + +BUG_ON (bcm_clk->type != bcm_clk_bus); + bus = bcm_clk->u.bus; + name = bcm_clk->init_data.name; + range = bcm_clk->ccu->range; + + limit = range -sizeof (u32); + limit =round_down (limit,sizeof (u32)); + + policy = &bus->policy; +if (policy_exists (policy)) { +if (policy->offset > limit) { +pr_err ("%s: bad policy offset for %s (%u > %u)\n" , + __func__, name, policy->offset, limit); +return false; + } + } + + gate = &bus->gate; + hyst = &bus->hyst; +if (gate_exists (gate)) { +if (gate->offset > limit) { +pr_err ("%s: bad gate offset for %s (%u > %u)\n" , + __func__, name, gate->offset, limit); +return false; + } + +if (hyst_exists (hyst)) { +if (hyst->offset > limit) { +pr_err ("%s: bad hysteresis offset for %s " +"(%u > %u)\n" , __func__, + name, hyst->offset, limit); +return false; + } + } + }else if (hyst_exists (hyst)) { +pr_err ("%s: hysteresis but no gate for %s\n" , __func__, name); +return false; + } + +return true; +} +/* A bit position must be less than the number of bits in a 32-bit register. */ static bool bit_posn_valid (u32 bit_posn,const char *field_name,const char *clock_name)
@@ -481,9 +533,46 @@ peri_clk_data_valid(struct kona_clk *bcm_clk)return kona_dividers_valid (bcm_clk); } +/* Determine whether the set of bus clock registers are valid. */ +static bool +bus_clk_data_valid (struct kona_clk *bcm_clk) +{ +struct bus_clk_data *bus; +struct bcm_clk_policy *policy; +struct bcm_clk_gate *gate; +struct bcm_clk_hyst *hyst; +const char *name; + +BUG_ON (bcm_clk->type != bcm_clk_bus); + +if (!bus_clk_data_offsets_valid (bcm_clk)) +return false; + + bus = bcm_clk->u.bus; + name = bcm_clk->init_data.name; + + policy = &bus->policy; +if (policy_exists (policy) && !policy_valid (policy, name)) +return false; + + gate = &bus->gate; +if (gate_exists (gate) && !gate_valid (gate,"gate" , name)) +return false; + + hyst = &bus->hyst; +if (hyst_exists (hyst) && !hyst_valid (hyst, name)) +return false; + +return true; +} +static bool kona_clk_valid (struct kona_clk *bcm_clk) {switch (bcm_clk->type) { +case bcm_clk_bus: +if (!bus_clk_data_valid (bcm_clk)) +return false; +break ;case bcm_clk_peri:if (!peri_clk_data_valid (bcm_clk))return false;
@@ -656,6 +745,14 @@ static void peri_clk_teardown(struct peri_clk_data *data,clk_sel_teardown (&data->sel, init_data); } +static void bus_clk_teardown (struct bus_clk_data *data, +struct clk_init_data *init_data) +{ + init_data->num_parents =0 ; +kfree (init_data->parent_names); + init_data->parent_names =NULL ; +} +/* * Caller is responsible for freeing the parent_names[] and * parent_sel[] arrays in the peripheral clock's "data" structure
@@ -670,9 +767,23 @@ peri_clk_setup(struct peri_clk_data *data, struct clk_init_data *init_data)return clk_sel_setup (data->clocks, &data->sel, init_data); } +static int +bus_clk_setup (struct bus_clk_data *data,struct clk_init_data *init_data) +{ + init_data->flags =CLK_IGNORE_UNUSED ; + + init_data->parent_names =NULL ; + init_data->num_parents =0 ; + +return 0 ; +} +static void bcm_clk_teardown (struct kona_clk *bcm_clk) {switch (bcm_clk->type) { +case bcm_clk_bus: +bus_clk_teardown (bcm_clk->u.data, &bcm_clk->init_data); +break ;case bcm_clk_peri:peri_clk_teardown (bcm_clk->u.data, &bcm_clk->init_data);break ;
@@ -702,6 +813,11 @@ static int kona_clk_setup(struct kona_clk *bcm_clk)struct clk_init_data *init_data = &bcm_clk->init_data;switch (bcm_clk->type) { +case bcm_clk_bus: + ret =bus_clk_setup (bcm_clk->u.data, init_data); +if (ret) +return ret; +break ;case bcm_clk_peri: ret =peri_clk_setup (bcm_clk->u.data, init_data);if (ret)
drivers/clk/bcm/clk-kona.c +61 -1
77 lines not on this page · raw message
drivers/clk/bcm/clk-kona.h +10 -0
@@ -390,6 +390,14 @@ struct peri_clk_data {struct bcm_clk_sel sel;const char *clocks[];/* must be last; use CLOCKS() to declare */ }; + +struct bus_clk_data { +struct bcm_clk_policy policy; +struct bcm_clk_gate gate; +struct bcm_clk_hyst hyst; +const char *clocks[];/* must be last; use CLOCKS() to declare */ +}; +#define CLOCKS (...) { __VA_ARGS__, NULL, }#define NO_CLOCKS { NULL, }/* Must use of no parent clocks */
@@ -401,6 +409,7 @@ struct kona_clk {union {void *data;struct peri_clk_data *peri; +struct bus_clk_data *bus; } u; };#define to_kona_clk (_hw) \
@@ -488,6 +497,7 @@ struct ccu_data {/* Exported globals */ extern const struct clk_ops kona_peri_clk_ops; +extern const struct clk_ops kona_bus_clk_ops;/* Externally visible functions */
Signature · 1 line
2.51.0
PATCH RESEND v6 6/9 clk: bcm21664: Add corresponding bus clocks for peripheral clocks
In reply to Artur WeberNow that bus clock support has been implemented into the Broadcom Kona clock driver, add bus clocks corresponding to HUB_TIMER, SDIO, UART and BSC, as well as the USB OTG bus clock.
---
Changes in v4:
- Adapt to CLOCK_COUNT -> CLK_COUNT rename
- Change commit summary to match equivalent BCM281xx commit
Changes in v3:
- Adapt to CLOCK_COUNT defines being moved
Changes in v2:
- Adapt to dropped prereq clocks
--- drivers/clk/bcm/clk-bcm21664.c | 89 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 86 insertions(+), 3 deletions(-)
drivers/clk/bcm/clk-bcm21664.c +86 -3
@@ -41,7 +41,12 @@ static struct peri_clk_data hub_timer_data = { .trig = TRIGGER(0x0a40, 4), }; -#define BCM21664_AON_CCU_CLK_COUNT (BCM21664_AON_CCU_HUB_TIMER + 1) +static struct bus_clk_data hub_timer_apb_data = { + .gate =HW_SW_GATE (0x0414 ,18 ,3 ,2 ), + .hyst =HYST (0x0414 ,10 ,11 ), +}; + +#define BCM21664_AON_CCU_CLK_COUNT (BCM21664_AON_CCU_HUB_TIMER_APB + 1)static struct ccu_data aon_ccu_data = {BCM21664_CCU_COMMON (aon,AON ),
@@ -52,6 +57,8 @@ static struct ccu_data aon_ccu_data = { .kona_clks = { [BCM21664_AON_CCU_HUB_TIMER ] = KONA_CLK(aon, hub_timer, peri), + [BCM21664_AON_CCU_HUB_TIMER_APB ] = + KONA_CLK(aon, hub_timer_apb, bus), [BCM21664_AON_CCU_CLK_COUNT] = LAST_KONA_CLK, }, };
@@ -126,7 +133,27 @@ static struct peri_clk_data sdio4_sleep_data = { .gate = HW_SW_GATE(0x0360, 18, 2, 3), }; -#define BCM21664_MASTER_CCU_CLK_COUNT (BCM21664_MASTER_CCU_SDIO4_SLEEP + 1) +static struct bus_clk_data sdio1_ahb_data = { + .gate =HW_SW_GATE (0x0358 ,16 ,0 ,1 ), +}; + +static struct bus_clk_data sdio2_ahb_data = { + .gate =HW_SW_GATE (0x035c ,16 ,0 ,1 ), +}; + +static struct bus_clk_data sdio3_ahb_data = { + .gate =HW_SW_GATE (0x0364 ,16 ,0 ,1 ), +}; + +static struct bus_clk_data sdio4_ahb_data = { + .gate =HW_SW_GATE (0x0360 ,16 ,0 ,1 ), +}; + +static struct bus_clk_data usb_otg_ahb_data = { + .gate =HW_SW_GATE (0x0348 ,16 ,0 ,1 ), +}; + +#define BCM21664_MASTER_CCU_CLK_COUNT (BCM21664_MASTER_CCU_USB_OTG_AHB + 1)static struct ccu_data master_ccu_data = {BCM21664_CCU_COMMON (master,MASTER ),
@@ -151,6 +178,16 @@ static struct ccu_data master_ccu_data = { KONA_CLK(master, sdio3_sleep, peri), [BCM21664_MASTER_CCU_SDIO4_SLEEP ] = KONA_CLK(master, sdio4_sleep, peri), + [BCM21664_MASTER_CCU_SDIO1_AHB ] = + KONA_CLK(master, sdio1_ahb, bus), + [BCM21664_MASTER_CCU_SDIO2_AHB ] = + KONA_CLK(master, sdio2_ahb, bus), + [BCM21664_MASTER_CCU_SDIO3_AHB ] = + KONA_CLK(master, sdio3_ahb, bus), + [BCM21664_MASTER_CCU_SDIO4_AHB ] = + KONA_CLK(master, sdio4_ahb, bus), + [BCM21664_MASTER_CCU_USB_OTG_AHB ] = + KONA_CLK(master, usb_otg_ahb, bus), [BCM21664_MASTER_CCU_CLK_COUNT] = LAST_KONA_CLK, }, };
@@ -231,7 +268,39 @@ static struct peri_clk_data bsc4_data = { .trig = TRIGGER(0x0afc, 19), }; -#define BCM21664_SLAVE_CCU_CLK_COUNT (BCM21664_SLAVE_CCU_BSC4 + 1) +static struct bus_clk_data uartb_apb_data = { + .gate =HW_SW_GATE_AUTO (0x0400 ,16 ,0 ,1 ), +}; + +static struct bus_clk_data uartb2_apb_data = { + .gate =HW_SW_GATE_AUTO (0x0404 ,16 ,0 ,1 ), +}; + +static struct bus_clk_data uartb3_apb_data = { + .gate =HW_SW_GATE_AUTO (0x0408 ,16 ,0 ,1 ), +}; + +static struct bus_clk_data bsc1_apb_data = { + .gate =HW_SW_GATE_AUTO (0x0458 ,16 ,0 ,1 ), + .hyst =HYST (0x0458 ,8 ,9 ), +}; + +static struct bus_clk_data bsc2_apb_data = { + .gate =HW_SW_GATE_AUTO (0x045c ,16 ,0 ,1 ), + .hyst =HYST (0x045c ,8 ,9 ), +}; + +static struct bus_clk_data bsc3_apb_data = { + .gate =HW_SW_GATE_AUTO (0x0470 ,16 ,0 ,1 ), + .hyst =HYST (0x0470 ,8 ,9 ), +}; + +static struct bus_clk_data bsc4_apb_data = { + .gate =HW_SW_GATE_AUTO (0x0474 ,16 ,0 ,1 ), + .hyst =HYST (0x0474 ,8 ,9 ), +}; + +#define BCM21664_SLAVE_CCU_CLK_COUNT (BCM21664_SLAVE_CCU_BSC4_APB + 1)static struct ccu_data slave_ccu_data = {BCM21664_CCU_COMMON (slave,SLAVE ),
@@ -254,6 +323,20 @@ static struct ccu_data slave_ccu_data = { KONA_CLK(slave, bsc3, peri), [BCM21664_SLAVE_CCU_BSC4 ] = KONA_CLK(slave, bsc4, peri), + [BCM21664_SLAVE_CCU_UARTB_APB ] = + KONA_CLK(slave, uartb_apb, bus), + [BCM21664_SLAVE_CCU_UARTB2_APB ] = + KONA_CLK(slave, uartb2_apb, bus), + [BCM21664_SLAVE_CCU_UARTB3_APB ] = + KONA_CLK(slave, uartb3_apb, bus), + [BCM21664_SLAVE_CCU_BSC1_APB ] = + KONA_CLK(slave, bsc1_apb, bus), + [BCM21664_SLAVE_CCU_BSC2_APB ] = + KONA_CLK(slave, bsc2_apb, bus), + [BCM21664_SLAVE_CCU_BSC3_APB ] = + KONA_CLK(slave, bsc3_apb, bus), + [BCM21664_SLAVE_CCU_BSC4_APB ] = + KONA_CLK(slave, bsc4_apb, bus), [BCM21664_SLAVE_CCU_CLK_COUNT] = LAST_KONA_CLK, }, };
Signature · 1 line
2.51.0
PATCH RESEND v6 7/9 clk: bcm281xx: Add corresponding bus clocks for peripheral clocks
In reply to Artur WeberAdd bus clocks corresponding to peripheral clocks currently supported by the BCM281xx clock driver.
---
Changes in v4:
- Adapt to CLOCK_COUNT -> CLK_COUNT rename
Changes in v3:
- Adapt to CLOCK_COUNT defines being moved
Changes in v2:
- Add this patch (BCM281xx bus clocks)
--- drivers/clk/bcm/clk-bcm281xx.c | 127 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 124 insertions(+), 3 deletions(-)
drivers/clk/bcm/clk-bcm281xx.c +124 -3
@@ -59,7 +59,17 @@ static struct peri_clk_data pmu_bsc_var_data = { .trig = TRIGGER(0x0a40, 2), }; -#define BCM281XX_AON_CCU_CLK_COUNT (BCM281XX_AON_CCU_PMU_BSC_VAR + 1) +static struct bus_clk_data hub_timer_apb_data = { + .gate =HW_SW_GATE (0x0414 ,18 ,3 ,2 ), + .hyst =HYST (0x0414 ,10 ,11 ), +}; + +static struct bus_clk_data pmu_bsc_apb_data = { + .gate =HW_SW_GATE (0x0418 ,18 ,3 ,2 ), + .hyst =HYST (0x0418 ,10 ,11 ), +}; + +#define BCM281XX_AON_CCU_CLK_COUNT (BCM281XX_AON_CCU_PMU_BSC_APB + 1)static struct ccu_data aon_ccu_data = {BCM281XX_CCU_COMMON (aon,AON ),
@@ -70,6 +80,10 @@ static struct ccu_data aon_ccu_data = { KONA_CLK(aon, pmu_bsc, peri), [BCM281XX_AON_CCU_PMU_BSC_VAR ] = KONA_CLK(aon, pmu_bsc_var, peri), + [BCM281XX_AON_CCU_HUB_TIMER_APB ] = + KONA_CLK(aon, hub_timer_apb, bus), + [BCM281XX_AON_CCU_PMU_BSC_APB ] = + KONA_CLK(aon, pmu_bsc_apb, bus), [BCM281XX_AON_CCU_CLK_COUNT] = LAST_KONA_CLK, }, };
@@ -178,7 +192,36 @@ static struct peri_clk_data hsic2_12m_data = { .trig = TRIGGER(0x0afc, 5), }; -#define BCM281XX_MASTER_CCU_CLK_COUNT (BCM281XX_MASTER_CCU_HSIC2_12M + 1) +static struct bus_clk_data sdio1_ahb_data = { + .gate =HW_SW_GATE (0x0358 ,16 ,1 ,0 ), +}; + +static struct bus_clk_data sdio2_ahb_data = { + .gate =HW_SW_GATE (0x035c ,16 ,1 ,0 ), +}; + +static struct bus_clk_data sdio3_ahb_data = { + .gate =HW_SW_GATE (0x0364 ,16 ,1 ,0 ), +}; + +static struct bus_clk_data sdio4_ahb_data = { + .gate =HW_SW_GATE (0x0360 ,16 ,1 ,0 ), +}; + +static struct bus_clk_data usb_ic_ahb_data = { + .gate =HW_SW_GATE (0x0354 ,16 ,1 ,0 ), +}; + +/* also called usbh_ahb */ +static struct bus_clk_data hsic2_ahb_data = { + .gate =HW_SW_GATE (0x0370 ,16 ,1 ,0 ), +}; + +static struct bus_clk_data usb_otg_ahb_data = { + .gate =HW_SW_GATE (0x0348 ,16 ,1 ,0 ), +}; + +#define BCM281XX_MASTER_CCU_CLK_COUNT (BCM281XX_MASTER_CCU_USB_OTG_AHB + 1)static struct ccu_data master_ccu_data = {BCM281XX_CCU_COMMON (master,MASTER ),
@@ -197,6 +240,20 @@ static struct ccu_data master_ccu_data = { KONA_CLK(master, hsic2_48m, peri), [BCM281XX_MASTER_CCU_HSIC2_12M ] = KONA_CLK(master, hsic2_12m, peri), + [BCM281XX_MASTER_CCU_SDIO1_AHB ] = + KONA_CLK(master, sdio1_ahb, bus), + [BCM281XX_MASTER_CCU_SDIO2_AHB ] = + KONA_CLK(master, sdio2_ahb, bus), + [BCM281XX_MASTER_CCU_SDIO3_AHB ] = + KONA_CLK(master, sdio3_ahb, bus), + [BCM281XX_MASTER_CCU_SDIO4_AHB ] = + KONA_CLK(master, sdio4_ahb, bus), + [BCM281XX_MASTER_CCU_USB_IC_AHB ] = + KONA_CLK(master, usb_ic_ahb, bus), + [BCM281XX_MASTER_CCU_HSIC2_AHB ] = + KONA_CLK(master, hsic2_ahb, bus), + [BCM281XX_MASTER_CCU_USB_OTG_AHB ] = + KONA_CLK(master, usb_otg_ahb, bus), [BCM281XX_MASTER_CCU_CLK_COUNT] = LAST_KONA_CLK, }, };
@@ -309,7 +366,51 @@ static struct peri_clk_data pwm_data = { .trig = TRIGGER(0x0afc, 15), }; -#define BCM281XX_SLAVE_CCU_CLK_COUNT (BCM281XX_SLAVE_CCU_PWM + 1) +static struct bus_clk_data uartb_apb_data = { + .gate =HW_SW_GATE (0x0400 ,16 ,1 ,0 ), +}; + +static struct bus_clk_data uartb2_apb_data = { + .gate =HW_SW_GATE (0x0404 ,16 ,1 ,0 ), +}; + +static struct bus_clk_data uartb3_apb_data = { + .gate =HW_SW_GATE (0x0408 ,16 ,1 ,0 ), +}; + +static struct bus_clk_data uartb4_apb_data = { + .gate =HW_SW_GATE (0x040c ,16 ,1 ,0 ), +}; + +static struct bus_clk_data ssp0_apb_data = { + .gate =HW_SW_GATE (0x0410 ,16 ,1 ,0 ), +}; + +static struct bus_clk_data ssp2_apb_data = { + .gate =HW_SW_GATE (0x0418 ,16 ,1 ,0 ), +}; + +static struct bus_clk_data bsc1_apb_data = { + .gate =HW_SW_GATE (0x0458 ,16 ,1 ,0 ), + .hyst =HYST (0x0458 ,8 ,9 ), +}; + +static struct bus_clk_data bsc2_apb_data = { + .gate =HW_SW_GATE (0x045c ,16 ,1 ,0 ), + .hyst =HYST (0x045c ,8 ,9 ), +}; + +static struct bus_clk_data bsc3_apb_data = { + .gate =HW_SW_GATE (0x0484 ,16 ,1 ,0 ), + .hyst =HYST (0x0484 ,8 ,9 ), +}; + +static struct bus_clk_data pwm_apb_data = { + .gate =HW_SW_GATE (0x0468 ,16 ,1 ,0 ), + .hyst =HYST (0x0468 ,8 ,9 ), +}; + +#define BCM281XX_SLAVE_CCU_CLK_COUNT (BCM281XX_SLAVE_CCU_PWM_APB + 1)static struct ccu_data slave_ccu_data = {BCM281XX_CCU_COMMON (slave,SLAVE ),
@@ -334,6 +435,26 @@ static struct ccu_data slave_ccu_data = { KONA_CLK(slave, bsc3, peri), [BCM281XX_SLAVE_CCU_PWM ] = KONA_CLK(slave, pwm, peri), + [BCM281XX_SLAVE_CCU_UARTB_APB ] = + KONA_CLK(slave, uartb_apb, bus), + [BCM281XX_SLAVE_CCU_UARTB2_APB ] = + KONA_CLK(slave, uartb2_apb, bus), + [BCM281XX_SLAVE_CCU_UARTB3_APB ] = + KONA_CLK(slave, uartb3_apb, bus), + [BCM281XX_SLAVE_CCU_UARTB4_APB ] = + KONA_CLK(slave, uartb4_apb, bus), + [BCM281XX_SLAVE_CCU_SSP0_APB ] = + KONA_CLK(slave, ssp0_apb, bus), + [BCM281XX_SLAVE_CCU_SSP2_APB ] = + KONA_CLK(slave, ssp2_apb, bus), + [BCM281XX_SLAVE_CCU_BSC1_APB ] = + KONA_CLK(slave, bsc1_apb, bus), + [BCM281XX_SLAVE_CCU_BSC2_APB ] = + KONA_CLK(slave, bsc2_apb, bus), + [BCM281XX_SLAVE_CCU_BSC3_APB ] = + KONA_CLK(slave, bsc3_apb, bus), + [BCM281XX_SLAVE_CCU_PWM_APB ] = + KONA_CLK(slave, pwm_apb, bus), [BCM281XX_SLAVE_CCU_CLK_COUNT] = LAST_KONA_CLK, }, };
Signature · 1 line
2.51.0
PATCH RESEND v6 8/9 ARM: dts: bcm2166x-common: Add matching bus clocks for peripheral clocks
In reply to Artur WeberFollowing changes in the clock driver, add bus clocks for timer, SDIO, BSC and UART to the DTS clock output names. Replace the usb_otg_ahb fixed clock with the real bus clock.
---
Changes in v4:
- Change commit summary to match equivalent BCM281xx commit
--- arch/arm/boot/dts/broadcom/bcm2166x-common.dtsi | 28 ++++++++++++++++--------- 1 file changed, 18 insertions(+), 10 deletions(-)
arch/arm/boot/dts/broadcom/bcm2166x-common.dtsi +18 -10
@@ -148,7 +148,7 @@ usbotg: usb@e20000 { compatible = "snps,dwc2"; reg = <0x00e20000 0x10000>; interrupts = <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&usb_otg_ahb_clk>; + clocks = <&master_ccu BCM21664_MASTER_CCU_USB_OTG_AHB>; clock-names = "otg"; phys = <&usbphy>; phy-names = "usb2-phy";
@@ -253,12 +253,6 @@ var_52m_clk: var_52m { clock-frequency = <52000000>; }; - usb_otg_ahb_clk: usb_otg_ahb { - #clock-cells = <0>; - compatible = "fixed-clock"; - clock-frequency = <52000000>; - }; - ref_96m_clk: ref_96m { #clock-cells = <0>; compatible = "fixed-clock";
@@ -306,7 +300,8 @@ aon_ccu: aon_ccu@35002000 { compatible = "brcm,bcm21664-aon-ccu"; reg = <0x35002000 0x0f00>; #clock-cells = <1>; - clock-output-names = "hub_timer"; + clock-output-names = "hub_timer", + "hub_timer_apb"; }; slave_ccu: slave_ccu@3e011000 {
@@ -319,7 +314,15 @@ slave_ccu: slave_ccu@3e011000 { "bsc1", "bsc2", "bsc3", - "bsc4"; + "bsc4", + "uartb_apb", + "uartb2_apb", + "uartb3_apb", + "bsc1_apb", + "bsc2_apb", + "bsc3_apb", + "bsc4_apb"; + }; master_ccu: master_ccu@3f001000 {
@@ -333,7 +336,12 @@ master_ccu: master_ccu@3f001000 { "sdio1_sleep", "sdio2_sleep", "sdio3_sleep", - "sdio4_sleep"; + "sdio4_sleep", + "sdio1_ahb", + "sdio2_ahb", + "sdio3_ahb", + "sdio4_ahb", + "usb_otg_ahb"; }; }; };
Signature · 1 line
2.51.0
PATCH RESEND v6 9/9 ARM: dts: bcm11351: Add corresponding bus clocks for peripheral clocks
In reply to Artur WeberFollowing changes in the clock driver, add matching bus clocks for existing peripheral clocks. Replace the usb_otg_ahb fixed clock with the real bus clock.
---
Changes in v2:
- Add this patch (BCM281xx bus clocks)
--- arch/arm/boot/dts/broadcom/bcm11351.dtsi | 33 ++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-)
arch/arm/boot/dts/broadcom/bcm11351.dtsi +23 -10
@@ -233,7 +233,9 @@ aon_ccu: aon_ccu@35002000 { #clock-cells = <1>; clock-output-names = "hub_timer", "pmu_bsc", - "pmu_bsc_var"; + "pmu_bsc_var", + "hub_timer_apb", + "pmu_bsc_apb"; }; master_ccu: master_ccu@3f001000 {
@@ -246,7 +248,14 @@ master_ccu: master_ccu@3f001000 { "sdio4", "usb_ic", "hsic2_48m", - "hsic2_12m"; + "hsic2_12m", + "sdio1_ahb", + "sdio2_ahb", + "sdio3_ahb", + "sdio4_ahb", + "usb_ic_ahb", + "hsic2_ahb", + "usb_otg_ahb"; }; slave_ccu: slave_ccu@3e011000 {
@@ -262,7 +271,17 @@ slave_ccu: slave_ccu@3e011000 { "bsc1", "bsc2", "bsc3", - "pwm"; + "pwm", + "uartb_apb", + "uartb2_apb", + "uartb3_apb", + "uartb4_apb", + "ssp0_apb", + "ssp2_apb", + "bsc1_apb", + "bsc2_apb", + "bsc3_apb", + "pwm_apb"; }; ref_1m_clk: ref_1m {
@@ -325,12 +344,6 @@ var_52m_clk: var_52m { clock-frequency = <52000000>; }; - usb_otg_ahb_clk: usb_otg_ahb { - compatible = "fixed-clock"; - clock-frequency = <52000000>; - #clock-cells = <0>; - }; - ref_96m_clk: ref_96m { #clock-cells = <0>; compatible = "fixed-clock";
@@ -396,7 +409,7 @@ usbotg: usb@3f120000 { compatible = "snps,dwc2"; reg = <0x3f120000 0x10000>; interrupts = <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&usb_otg_ahb_clk>; + clocks = <&master_ccu BCM281XX_MASTER_CCU_USB_OTG_AHB>; clock-names = "otg"; phys = <&usbphy>; phy-names = "usb2-phy";
Signature · 1 line
2.51.0
Florian Fainelli
maintainerQuoted 9 lines · Artur Weber
This patchset does the following:
- Introduce support for bus clocks. These are fairly similar to peripheral clocks, but only implement policy, gate and hyst.
- Add matching bus clocks for BCM21664 and BCM281xx peripheral clocks and update device tree bindings to match.
Signed-off-by Artur Weber <[email protected]>
Stephen, are you OK with taking all of those patches through the clock tree? Patches #8 and #9 have a dependency on patches #2 and #3.
Thanks!
Signature · 1 line
Florian
Stephen Boyd
maintainerQuoting Florian Fainelli (2025-09-04 11:28:34)
Quoted 6 lines · Artur Weber
Quoted 5 lines
This patchset does the following:
- Introduce support for bus clocks. These are fairly similar to peripheral clocks, but only implement policy, gate and hyst.
Quoted 8 lines
Quoted 4 lines
- Add matching bus clocks for BCM21664 and BCM281xx peripheral clocks and update device tree bindings to match.
Signed-off-by Artur Weber <[email protected]>Stephen, are you OK with taking all of those patches through the clock tree? Patches #8 and #9 have a dependency on patches #2 and #3.
I don't normally do that but sure. Is that a Reviewed-by?
Quoted 10 lines · Stephen Boyd
Quoting Florian Fainelli (2025-09-04 11:28:34)
Quoted 9 lines · Artur Weber
Quoted 8 lines
This patchset does the following:
- Introduce support for bus clocks. These are fairly similar to peripheral clocks, but only implement policy, gate and hyst.
- Add matching bus clocks for BCM21664 and BCM281xx peripheral clocks and update device tree bindings to match.
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Signed-off-by Artur Weber <[email protected]>Stephen, are you OK with taking all of those patches through the clock tree? Patches #8 and #9 have a dependency on patches #2 and #3.
I don't normally do that but sure. Is that a Reviewed-by?
Sure, let's make it official:
if you prefer that I take those patches through the ARM SoC tree, that works just as well, I would need a suitable acknowledgement from you to do that.
Thanks
Signature · 1 line
Florian
Quoted 21 lines · Florian Fainelli
Quoted 10 lines · Stephen Boyd
Quoting Florian Fainelli (2025-09-04 11:28:34)
Quoted 9 lines · Artur Weber
Quoted 8 lines
This patchset does the following:
- Introduce support for bus clocks. These are fairly similar to peripheral clocks, but only implement policy, gate and hyst.
- Add matching bus clocks for BCM21664 and BCM281xx peripheral clocks and update device tree bindings to match.
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Signed-off-by Artur Weber <[email protected]>Stephen, are you OK with taking all of those patches through the clock tree? Patches #8 and #9 have a dependency on patches #2 and #3.
I don't normally do that but sure. Is that a Reviewed-by?
Quoted 7 lines
Sure, let's make it official:
Reviewed-by Florian Fainelli <[email protected]>if you prefer that I take those patches through the ARM SoC tree, that works just as well, I would need a suitable acknowledgement from you to do that.
Thanks
If it helps, I could re-submit the DTS commits as a separate patchset, and only keep the clock subsystem changes here. Then the clock patchset can be merged first, and the DTS patchset can be merged once that lands.
Best regards
Artur