diff options
author | Gabriel Fernandez <gabriel.fernandez@st.com> | 2018-03-08 11:54:03 -0500 |
---|---|---|
committer | Michael Turquette <mturquette@baylibre.com> | 2018-03-11 18:40:33 -0400 |
commit | 2c87c9d33117446dab774a7e1b23806802f95c98 (patch) | |
tree | 847d00a9136acdfe8b46a0564f685982a2aab53f | |
parent | 1f80590b6bdabffc90b9ed6a2d05dd9d24122879 (diff) |
clk: stm32mp1: add RTC clock
This patch adds the RTC clock.
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@st.com>
Signed-off-by: Michael Turquette <mturquette@baylibre.com>
-rw-r--r-- | drivers/clk/clk-stm32mp1.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/clk/clk-stm32mp1.c b/drivers/clk/clk-stm32mp1.c index b5379a224183..51e3e76b8fa5 100644 --- a/drivers/clk/clk-stm32mp1.c +++ b/drivers/clk/clk-stm32mp1.c | |||
@@ -248,6 +248,10 @@ static const char * const dsi_src[] = { | |||
248 | "ck_dsi_phy", "pll4_p" | 248 | "ck_dsi_phy", "pll4_p" |
249 | }; | 249 | }; |
250 | 250 | ||
251 | static const char * const rtc_src[] = { | ||
252 | "off", "ck_lse", "ck_lsi", "ck_hse_rtc" | ||
253 | }; | ||
254 | |||
251 | static const struct clk_div_table axi_div_table[] = { | 255 | static const struct clk_div_table axi_div_table[] = { |
252 | { 0, 1 }, { 1, 2 }, { 2, 3 }, { 3, 4 }, | 256 | { 0, 1 }, { 1, 2 }, { 2, 3 }, { 3, 4 }, |
253 | { 4, 4 }, { 5, 4 }, { 6, 4 }, { 7, 4 }, | 257 | { 4, 4 }, { 5, 4 }, { 6, 4 }, { 7, 4 }, |
@@ -1945,6 +1949,17 @@ static const struct clock_config stm32mp1_clock_cfg[] = { | |||
1945 | _NO_GATE, | 1949 | _NO_GATE, |
1946 | _MMUX(M_ETHCK), | 1950 | _MMUX(M_ETHCK), |
1947 | _DIV(RCC_ETHCKSELR, 4, 4, CLK_DIVIDER_ALLOW_ZERO, NULL)), | 1951 | _DIV(RCC_ETHCKSELR, 4, 4, CLK_DIVIDER_ALLOW_ZERO, NULL)), |
1952 | |||
1953 | /* RTC clock */ | ||
1954 | DIV(NO_ID, "ck_hse_rtc", "ck_hse", 0, RCC_RTCDIVR, 0, 7, | ||
1955 | CLK_DIVIDER_ALLOW_ZERO), | ||
1956 | |||
1957 | COMPOSITE(RTC, "ck_rtc", rtc_src, CLK_OPS_PARENT_ENABLE | | ||
1958 | CLK_SET_RATE_PARENT, | ||
1959 | _GATE(RCC_BDCR, 20, 0), | ||
1960 | _MUX(RCC_BDCR, 16, 2, 0), | ||
1961 | _NO_DIV), | ||
1962 | |||
1948 | }; | 1963 | }; |
1949 | 1964 | ||
1950 | struct stm32_clock_match_data { | 1965 | struct stm32_clock_match_data { |