Skip to content

Commit

Permalink
clk: bcm21664: add pmu_bsc and pmu_bsc_apb clocks
Browse files Browse the repository at this point in the history
The pmu_bsc clock is used by the PMU BSC, which is used by the PMIC
on BCM21664/BCM23550 devices.

Signed-off-by: Artur Weber <aweber.kernel@gmail.com>
  • Loading branch information
refractionware committed Aug 4, 2023
1 parent d11f938 commit 9742e21
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
20 changes: 20 additions & 0 deletions drivers/clk/bcm/clk-bcm21664.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,22 @@ static struct peri_clk_data hub_timer_data = {
.trig = TRIGGER(0x0a40, 4),
};

static struct clk_reg_data pmu_bsc_apb_data = {
.gate = HW_SW_GATE(0x0418, 18, 2, 3),
.hyst = HYST(0x0418, 10, 11),
};

static struct peri_clk_data pmu_data = {
.gate = HW_SW_GATE(0x0418, 16, 0, 1),
.hyst = HYST(0x0418, 8, 9),
.clocks = CLOCKS("ref_crystal",
"pmu_bsc_var",
"bbl_32k"),
.sel = SELECTOR(0x0a04, 0, 3),
.div = DIVIDER(0x0a04, 3, 4),
.trig = TRIGGER(0x0a40, 0),
};

static struct ccu_data aon_ccu_data = {
BCM21664_CCU_COMMON(aon, AON),
.policy = {
Expand All @@ -48,6 +64,10 @@ static struct ccu_data aon_ccu_data = {
.kona_clks = {
[BCM21664_AON_CCU_HUB_TIMER] =
KONA_CLK(aon, hub_timer, peri),
[BCM21664_AON_CCU_PMU_BSC_APB] =
KONA_CLK(aon, pmu_bsc_apb, bus),
[BCM21664_AON_CCU_PMU_BSC] =
KONA_CLK(aon, pmu_bsc, peri),
[BCM21664_AON_CCU_CLOCK_COUNT] = LAST_KONA_CLK,
},
};
Expand Down
4 changes: 3 additions & 1 deletion include/dt-bindings/clock/bcm21664.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
/* aon CCU clock ids */

#define BCM21664_AON_CCU_HUB_TIMER 0
#define BCM21664_AON_CCU_CLOCK_COUNT 1
#define BCM21664_AON_CCU_PMU_BSC_APB 1
#define BCM21664_AON_CCU_PMU_BSC 2
#define BCM21664_AON_CCU_CLOCK_COUNT 3

/* master CCU clock ids */

Expand Down

0 comments on commit 9742e21

Please sign in to comment.