aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabriel Fernandez <gabriel.fernandez@st.com>2018-03-08 11:54:04 -0500
committerMichael Turquette <mturquette@baylibre.com>2018-03-11 18:40:34 -0400
commit44cd455a8edb4026ae2c1c6fb6895523712c4896 (patch)
tree4bb24b4d02b1c24ab0acb0412a3bd5fb6779b509
parent2c87c9d33117446dab774a7e1b23806802f95c98 (diff)
clk: stm32mp1: add MCO clocks
Two micro-controller clock output (MCO) pins are available: MCO1 and MCO2. For each output, it is possible to select a clock source. The selected clock can be divided thanks to configurable prescaler. Signed-off-by: Gabriel Fernandez <gabriel.fernandez@st.com> Signed-off-by: Michael Turquette <mturquette@baylibre.com>
-rw-r--r--drivers/clk/clk-stm32mp1.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/clk/clk-stm32mp1.c b/drivers/clk/clk-stm32mp1.c
index 51e3e76b8fa5..b3a6ec4d9e9e 100644
--- a/drivers/clk/clk-stm32mp1.c
+++ b/drivers/clk/clk-stm32mp1.c
@@ -252,6 +252,14 @@ static const char * const rtc_src[] = {
252 "off", "ck_lse", "ck_lsi", "ck_hse_rtc" 252 "off", "ck_lse", "ck_lsi", "ck_hse_rtc"
253}; 253};
254 254
255static const char * const mco1_src[] = {
256 "ck_hsi", "ck_hse", "ck_csi", "ck_lsi", "ck_lse"
257};
258
259static const char * const mco2_src[] = {
260 "ck_mpu", "ck_axi", "ck_mcu", "pll4_p", "ck_hse", "ck_hsi"
261};
262
255static const struct clk_div_table axi_div_table[] = { 263static const struct clk_div_table axi_div_table[] = {
256 { 0, 1 }, { 1, 2 }, { 2, 3 }, { 3, 4 }, 264 { 0, 1 }, { 1, 2 }, { 2, 3 }, { 3, 4 },
257 { 4, 4 }, { 5, 4 }, { 6, 4 }, { 7, 4 }, 265 { 4, 4 }, { 5, 4 }, { 6, 4 }, { 7, 4 },
@@ -1960,6 +1968,18 @@ static const struct clock_config stm32mp1_clock_cfg[] = {
1960 _MUX(RCC_BDCR, 16, 2, 0), 1968 _MUX(RCC_BDCR, 16, 2, 0),
1961 _NO_DIV), 1969 _NO_DIV),
1962 1970
1971 /* MCO clocks */
1972 COMPOSITE(CK_MCO1, "ck_mco1", mco1_src, CLK_OPS_PARENT_ENABLE |
1973 CLK_SET_RATE_NO_REPARENT,
1974 _GATE(RCC_MCO1CFGR, 12, 0),
1975 _MUX(RCC_MCO1CFGR, 0, 3, 0),
1976 _DIV(RCC_MCO1CFGR, 4, 4, 0, NULL)),
1977
1978 COMPOSITE(CK_MCO2, "ck_mco2", mco2_src, CLK_OPS_PARENT_ENABLE |
1979 CLK_SET_RATE_NO_REPARENT,
1980 _GATE(RCC_MCO2CFGR, 12, 0),
1981 _MUX(RCC_MCO2CFGR, 0, 3, 0),
1982 _DIV(RCC_MCO2CFGR, 4, 4, 0, NULL)),
1963}; 1983};
1964 1984
1965struct stm32_clock_match_data { 1985struct stm32_clock_match_data {