Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Chunyan Zhang and committed by
Stephen Boyd
b3316a67 f7c14dd5

+76
+76
drivers/clk/sprd/sc9860-clk.c
··· 959 959 0x1000, BIT(6), 0, 0); 960 960 static SPRD_SC_GATE_CLK(emmc_2x_en, "emmc-2x-en", "aon-apb", 0x13c, 961 961 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); 962 1000 963 1001 static struct sprd_clk_common *sc9860_aon_gate[] = { 964 1002 /* address base is 0x402e0000 */ ··· 1068 1030 &sdio1_2x_en.common, 1069 1031 &sdio2_2x_en.common, 1070 1032 &emmc_2x_en.common, 1033 + &arch_rtc_eb.common, 1034 + &kpb_rtc_eb.common, 1035 + &aon_syst_rtc_eb.common, 1036 + &ap_syst_rtc_eb.common, 1037 + &aon_tmr_rtc_eb.common, 1038 + &ap_tmr0_rtc_eb.common, 1039 + &eic_rtc_eb.common, 1040 + &eic_rtcdv5_eb.common, 1041 + &ap_wdg_rtc_eb.common, 1042 + &ap_tmr1_rtc_eb.common, 1043 + &ap_tmr2_rtc_eb.common, 1044 + &dcxo_tmr_rtc_eb.common, 1045 + &bb_cal_rtc_eb.common, 1046 + &avs_big_rtc_eb.common, 1047 + &avs_lit_rtc_eb.common, 1048 + &avs_gpu0_rtc_eb.common, 1049 + &avs_gpu1_rtc_eb.common, 1050 + &gpu_ts_eb.common, 1051 + &rtcdv10_eb.common, 1071 1052 }; 1072 1053 1073 1054 static struct clk_hw_onecell_data sc9860_aon_gate_hws = { ··· 1159 1102 [CLK_SDIO1_2X_EN] = &sdio1_2x_en.common.hw, 1160 1103 [CLK_SDIO2_2X_EN] = &sdio2_2x_en.common.hw, 1161 1104 [CLK_EMMC_2X_EN] = &emmc_2x_en.common.hw, 1105 + [CLK_ARCH_RTC_EB] = &arch_rtc_eb.common.hw, 1106 + [CLK_KPB_RTC_EB] = &kpb_rtc_eb.common.hw, 1107 + [CLK_AON_SYST_RTC_EB] = &aon_syst_rtc_eb.common.hw, 1108 + [CLK_AP_SYST_RTC_EB] = &ap_syst_rtc_eb.common.hw, 1109 + [CLK_AON_TMR_RTC_EB] = &aon_tmr_rtc_eb.common.hw, 1110 + [CLK_AP_TMR0_RTC_EB] = &ap_tmr0_rtc_eb.common.hw, 1111 + [CLK_EIC_RTC_EB] = &eic_rtc_eb.common.hw, 1112 + [CLK_EIC_RTCDV5_EB] = &eic_rtcdv5_eb.common.hw, 1113 + [CLK_AP_WDG_RTC_EB] = &ap_wdg_rtc_eb.common.hw, 1114 + [CLK_AP_TMR1_RTC_EB] = &ap_tmr1_rtc_eb.common.hw, 1115 + [CLK_AP_TMR2_RTC_EB] = &ap_tmr2_rtc_eb.common.hw, 1116 + [CLK_DCXO_TMR_RTC_EB] = &dcxo_tmr_rtc_eb.common.hw, 1117 + [CLK_BB_CAL_RTC_EB] = &bb_cal_rtc_eb.common.hw, 1118 + [CLK_AVS_BIG_RTC_EB] = &avs_big_rtc_eb.common.hw, 1119 + [CLK_AVS_LIT_RTC_EB] = &avs_lit_rtc_eb.common.hw, 1120 + [CLK_AVS_GPU0_RTC_EB] = &avs_gpu0_rtc_eb.common.hw, 1121 + [CLK_AVS_GPU1_RTC_EB] = &avs_gpu1_rtc_eb.common.hw, 1122 + [CLK_GPU_TS_EB] = &gpu_ts_eb.common.hw, 1123 + [CLK_RTCDV10_EB] = &rtcdv10_eb.common.hw, 1162 1124 }, 1163 1125 .num = CLK_AON_GATE_NUM, 1164 1126 };