Skip to content

Commit b3316a6

Browse files
Lyra-Zhangbebarino
authored andcommitted
clk: sprd: add RTC gate for SC9860
Add a few gate clocks which are used for gating RTC for some devices on AON area of SC9860. This patch has been tested on SC9860, with this patch and proper DT configurations, the watchdog can be initialized and work well. Signed-off-by: Chunyan Zhang <chunyan.zhang@spreadtrum.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent f7c14dd commit b3316a6

1 file changed

Lines changed: 76 additions & 0 deletions

File tree

‎drivers/clk/sprd/sc9860-clk.c‎

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,44 @@ static SPRD_SC_GATE_CLK(sdio2_2x_en, "sdio2-2x-en", "aon-apb", 0x13c,
959959
0x1000, BIT(6), 0, 0);
960960
static SPRD_SC_GATE_CLK(emmc_2x_en, "emmc-2x-en", "aon-apb", 0x13c,
961961
0x1000, BIT(9), 0, 0);
962+
static SPRD_SC_GATE_CLK(arch_rtc_eb, "arch-rtc-eb", "aon-apb", 0x10,
963+
0x1000, BIT(0), CLK_IGNORE_UNUSED, 0);
964+
static SPRD_SC_GATE_CLK(kpb_rtc_eb, "kpb-rtc-eb", "aon-apb", 0x10,
965+
0x1000, BIT(1), CLK_IGNORE_UNUSED, 0);
966+
static SPRD_SC_GATE_CLK(aon_syst_rtc_eb, "aon-syst-rtc-eb", "aon-apb", 0x10,
967+
0x1000, BIT(2), CLK_IGNORE_UNUSED, 0);
968+
static SPRD_SC_GATE_CLK(ap_syst_rtc_eb, "ap-syst-rtc-eb", "aon-apb", 0x10,
969+
0x1000, BIT(3), CLK_IGNORE_UNUSED, 0);
970+
static SPRD_SC_GATE_CLK(aon_tmr_rtc_eb, "aon-tmr-rtc-eb", "aon-apb", 0x10,
971+
0x1000, BIT(4), CLK_IGNORE_UNUSED, 0);
972+
static SPRD_SC_GATE_CLK(ap_tmr0_rtc_eb, "ap-tmr0-rtc-eb", "aon-apb", 0x10,
973+
0x1000, BIT(5), CLK_IGNORE_UNUSED, 0);
974+
static SPRD_SC_GATE_CLK(eic_rtc_eb, "eic-rtc-eb", "aon-apb", 0x10,
975+
0x1000, BIT(6), CLK_IGNORE_UNUSED, 0);
976+
static SPRD_SC_GATE_CLK(eic_rtcdv5_eb, "eic-rtcdv5-eb", "aon-apb", 0x10,
977+
0x1000, BIT(7), CLK_IGNORE_UNUSED, 0);
978+
static SPRD_SC_GATE_CLK(ap_wdg_rtc_eb, "ap-wdg-rtc-eb", "aon-apb", 0x10,
979+
0x1000, BIT(9), CLK_IGNORE_UNUSED, 0);
980+
static SPRD_SC_GATE_CLK(ap_tmr1_rtc_eb, "ap-tmr1-rtc-eb", "aon-apb", 0x10,
981+
0x1000, BIT(15), CLK_IGNORE_UNUSED, 0);
982+
static SPRD_SC_GATE_CLK(ap_tmr2_rtc_eb, "ap-tmr2-rtc-eb", "aon-apb", 0x10,
983+
0x1000, BIT(16), CLK_IGNORE_UNUSED, 0);
984+
static SPRD_SC_GATE_CLK(dcxo_tmr_rtc_eb, "dcxo-tmr-rtc-eb", "aon-apb", 0x10,
985+
0x1000, BIT(17), CLK_IGNORE_UNUSED, 0);
986+
static SPRD_SC_GATE_CLK(bb_cal_rtc_eb, "bb-cal-rtc-eb", "aon-apb", 0x10,
987+
0x1000, BIT(18), CLK_IGNORE_UNUSED, 0);
988+
static SPRD_SC_GATE_CLK(avs_big_rtc_eb, "avs-big-rtc-eb", "aon-apb", 0x10,
989+
0x1000, BIT(20), CLK_IGNORE_UNUSED, 0);
990+
static SPRD_SC_GATE_CLK(avs_lit_rtc_eb, "avs-lit-rtc-eb", "aon-apb", 0x10,
991+
0x1000, BIT(21), CLK_IGNORE_UNUSED, 0);
992+
static SPRD_SC_GATE_CLK(avs_gpu0_rtc_eb, "avs-gpu0-rtc-eb", "aon-apb", 0x10,
993+
0x1000, BIT(22), CLK_IGNORE_UNUSED, 0);
994+
static SPRD_SC_GATE_CLK(avs_gpu1_rtc_eb, "avs-gpu1-rtc-eb", "aon-apb", 0x10,
995+
0x1000, BIT(23), CLK_IGNORE_UNUSED, 0);
996+
static SPRD_SC_GATE_CLK(gpu_ts_eb, "gpu-ts-eb", "aon-apb", 0x10,
997+
0x1000, BIT(24), CLK_IGNORE_UNUSED, 0);
998+
static SPRD_SC_GATE_CLK(rtcdv10_eb, "rtcdv10-eb", "aon-apb", 0x10,
999+
0x1000, BIT(27), CLK_IGNORE_UNUSED, 0);
9621000

9631001
static struct sprd_clk_common *sc9860_aon_gate[] = {
9641002
/* address base is 0x402e0000 */
@@ -1030,6 +1068,25 @@ static struct sprd_clk_common *sc9860_aon_gate[] = {
10301068
&sdio1_2x_en.common,
10311069
&sdio2_2x_en.common,
10321070
&emmc_2x_en.common,
1071+
&arch_rtc_eb.common,
1072+
&kpb_rtc_eb.common,
1073+
&aon_syst_rtc_eb.common,
1074+
&ap_syst_rtc_eb.common,
1075+
&aon_tmr_rtc_eb.common,
1076+
&ap_tmr0_rtc_eb.common,
1077+
&eic_rtc_eb.common,
1078+
&eic_rtcdv5_eb.common,
1079+
&ap_wdg_rtc_eb.common,
1080+
&ap_tmr1_rtc_eb.common,
1081+
&ap_tmr2_rtc_eb.common,
1082+
&dcxo_tmr_rtc_eb.common,
1083+
&bb_cal_rtc_eb.common,
1084+
&avs_big_rtc_eb.common,
1085+
&avs_lit_rtc_eb.common,
1086+
&avs_gpu0_rtc_eb.common,
1087+
&avs_gpu1_rtc_eb.common,
1088+
&gpu_ts_eb.common,
1089+
&rtcdv10_eb.common,
10331090
};
10341091

10351092
static struct clk_hw_onecell_data sc9860_aon_gate_hws = {
@@ -1102,6 +1159,25 @@ static struct clk_hw_onecell_data sc9860_aon_gate_hws = {
11021159
[CLK_SDIO1_2X_EN] = &sdio1_2x_en.common.hw,
11031160
[CLK_SDIO2_2X_EN] = &sdio2_2x_en.common.hw,
11041161
[CLK_EMMC_2X_EN] = &emmc_2x_en.common.hw,
1162+
[CLK_ARCH_RTC_EB] = &arch_rtc_eb.common.hw,
1163+
[CLK_KPB_RTC_EB] = &kpb_rtc_eb.common.hw,
1164+
[CLK_AON_SYST_RTC_EB] = &aon_syst_rtc_eb.common.hw,
1165+
[CLK_AP_SYST_RTC_EB] = &ap_syst_rtc_eb.common.hw,
1166+
[CLK_AON_TMR_RTC_EB] = &aon_tmr_rtc_eb.common.hw,
1167+
[CLK_AP_TMR0_RTC_EB] = &ap_tmr0_rtc_eb.common.hw,
1168+
[CLK_EIC_RTC_EB] = &eic_rtc_eb.common.hw,
1169+
[CLK_EIC_RTCDV5_EB] = &eic_rtcdv5_eb.common.hw,
1170+
[CLK_AP_WDG_RTC_EB] = &ap_wdg_rtc_eb.common.hw,
1171+
[CLK_AP_TMR1_RTC_EB] = &ap_tmr1_rtc_eb.common.hw,
1172+
[CLK_AP_TMR2_RTC_EB] = &ap_tmr2_rtc_eb.common.hw,
1173+
[CLK_DCXO_TMR_RTC_EB] = &dcxo_tmr_rtc_eb.common.hw,
1174+
[CLK_BB_CAL_RTC_EB] = &bb_cal_rtc_eb.common.hw,
1175+
[CLK_AVS_BIG_RTC_EB] = &avs_big_rtc_eb.common.hw,
1176+
[CLK_AVS_LIT_RTC_EB] = &avs_lit_rtc_eb.common.hw,
1177+
[CLK_AVS_GPU0_RTC_EB] = &avs_gpu0_rtc_eb.common.hw,
1178+
[CLK_AVS_GPU1_RTC_EB] = &avs_gpu1_rtc_eb.common.hw,
1179+
[CLK_GPU_TS_EB] = &gpu_ts_eb.common.hw,
1180+
[CLK_RTCDV10_EB] = &rtcdv10_eb.common.hw,
11051181
},
11061182
.num = CLK_AON_GATE_NUM,
11071183
};

0 commit comments

Comments
 (0)