diff options
author | Gabriel Fernandez <gabriel.fernandez@st.com> | 2018-03-08 11:54:05 -0500 |
---|---|---|
committer | Michael Turquette <mturquette@baylibre.com> | 2018-03-11 18:40:34 -0400 |
commit | 3a430067838a4e47ff473999b2f6a5a7be92dba7 (patch) | |
tree | 303e72291f58449e72d526c4d82dee8626e5ae07 | |
parent | 44cd455a8edb4026ae2c1c6fb6895523712c4896 (diff) |
clk: stm32mp1: add Debug clocks
RCC manages clock for debug and trace.
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 | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/clk/clk-stm32mp1.c b/drivers/clk/clk-stm32mp1.c index b3a6ec4d9e9e..f1d5967b4b39 100644 --- a/drivers/clk/clk-stm32mp1.c +++ b/drivers/clk/clk-stm32mp1.c | |||
@@ -260,6 +260,10 @@ static const char * const mco2_src[] = { | |||
260 | "ck_mpu", "ck_axi", "ck_mcu", "pll4_p", "ck_hse", "ck_hsi" | 260 | "ck_mpu", "ck_axi", "ck_mcu", "pll4_p", "ck_hse", "ck_hsi" |
261 | }; | 261 | }; |
262 | 262 | ||
263 | static const char * const ck_trace_src[] = { | ||
264 | "ck_axi" | ||
265 | }; | ||
266 | |||
263 | static const struct clk_div_table axi_div_table[] = { | 267 | static const struct clk_div_table axi_div_table[] = { |
264 | { 0, 1 }, { 1, 2 }, { 2, 3 }, { 3, 4 }, | 268 | { 0, 1 }, { 1, 2 }, { 2, 3 }, { 3, 4 }, |
265 | { 4, 4 }, { 5, 4 }, { 6, 4 }, { 7, 4 }, | 269 | { 4, 4 }, { 5, 4 }, { 6, 4 }, { 7, 4 }, |
@@ -280,6 +284,12 @@ static const struct clk_div_table apb_div_table[] = { | |||
280 | { 0 }, | 284 | { 0 }, |
281 | }; | 285 | }; |
282 | 286 | ||
287 | static const struct clk_div_table ck_trace_div_table[] = { | ||
288 | { 0, 1 }, { 1, 2 }, { 2, 4 }, { 3, 8 }, | ||
289 | { 4, 16 }, { 5, 16 }, { 6, 16 }, { 7, 16 }, | ||
290 | { 0 }, | ||
291 | }; | ||
292 | |||
283 | #define MAX_MUX_CLK 2 | 293 | #define MAX_MUX_CLK 2 |
284 | 294 | ||
285 | struct stm32_mmux { | 295 | struct stm32_mmux { |
@@ -1980,6 +1990,18 @@ static const struct clock_config stm32mp1_clock_cfg[] = { | |||
1980 | _GATE(RCC_MCO2CFGR, 12, 0), | 1990 | _GATE(RCC_MCO2CFGR, 12, 0), |
1981 | _MUX(RCC_MCO2CFGR, 0, 3, 0), | 1991 | _MUX(RCC_MCO2CFGR, 0, 3, 0), |
1982 | _DIV(RCC_MCO2CFGR, 4, 4, 0, NULL)), | 1992 | _DIV(RCC_MCO2CFGR, 4, 4, 0, NULL)), |
1993 | |||
1994 | /* Debug clocks */ | ||
1995 | FIXED_FACTOR(NO_ID, "ck_axi_div2", "ck_axi", 0, 1, 2), | ||
1996 | |||
1997 | GATE(DBG, "ck_apb_dbg", "ck_axi_div2", 0, RCC_DBGCFGR, 8, 0), | ||
1998 | |||
1999 | GATE(CK_DBG, "ck_sys_dbg", "ck_axi", 0, RCC_DBGCFGR, 8, 0), | ||
2000 | |||
2001 | COMPOSITE(CK_TRACE, "ck_trace", ck_trace_src, CLK_OPS_PARENT_ENABLE, | ||
2002 | _GATE(RCC_DBGCFGR, 9, 0), | ||
2003 | _NO_MUX, | ||
2004 | _DIV(RCC_DBGCFGR, 0, 3, 0, ck_trace_div_table)), | ||
1983 | }; | 2005 | }; |
1984 | 2006 | ||
1985 | struct stm32_clock_match_data { | 2007 | struct stm32_clock_match_data { |