diff options
Diffstat (limited to 'drivers/clk/clk-stm32mp1.c')
| -rw-r--r-- | drivers/clk/clk-stm32mp1.c | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/drivers/clk/clk-stm32mp1.c b/drivers/clk/clk-stm32mp1.c index 6a31f7f434ce..a0ae8dc16909 100644 --- a/drivers/clk/clk-stm32mp1.c +++ b/drivers/clk/clk-stm32mp1.c | |||
| @@ -121,7 +121,7 @@ static const char * const cpu_src[] = { | |||
| 121 | }; | 121 | }; |
| 122 | 122 | ||
| 123 | static const char * const axi_src[] = { | 123 | static const char * const axi_src[] = { |
| 124 | "ck_hsi", "ck_hse", "pll2_p", "pll3_p" | 124 | "ck_hsi", "ck_hse", "pll2_p" |
| 125 | }; | 125 | }; |
| 126 | 126 | ||
| 127 | static const char * const per_src[] = { | 127 | static const char * const per_src[] = { |
| @@ -225,19 +225,19 @@ static const char * const usart6_src[] = { | |||
| 225 | }; | 225 | }; |
| 226 | 226 | ||
| 227 | static const char * const fdcan_src[] = { | 227 | static const char * const fdcan_src[] = { |
| 228 | "ck_hse", "pll3_q", "pll4_q" | 228 | "ck_hse", "pll3_q", "pll4_q", "pll4_r" |
| 229 | }; | 229 | }; |
| 230 | 230 | ||
| 231 | static const char * const sai_src[] = { | 231 | static const char * const sai_src[] = { |
| 232 | "pll4_q", "pll3_q", "i2s_ckin", "ck_per" | 232 | "pll4_q", "pll3_q", "i2s_ckin", "ck_per", "pll3_r" |
| 233 | }; | 233 | }; |
| 234 | 234 | ||
| 235 | static const char * const sai2_src[] = { | 235 | static const char * const sai2_src[] = { |
| 236 | "pll4_q", "pll3_q", "i2s_ckin", "ck_per", "spdif_ck_symb" | 236 | "pll4_q", "pll3_q", "i2s_ckin", "ck_per", "spdif_ck_symb", "pll3_r" |
| 237 | }; | 237 | }; |
| 238 | 238 | ||
| 239 | static const char * const adc12_src[] = { | 239 | static const char * const adc12_src[] = { |
| 240 | "pll4_q", "ck_per" | 240 | "pll4_r", "ck_per", "pll3_q" |
| 241 | }; | 241 | }; |
| 242 | 242 | ||
| 243 | static const char * const dsi_src[] = { | 243 | static const char * const dsi_src[] = { |
| @@ -269,7 +269,7 @@ static const struct clk_div_table axi_div_table[] = { | |||
| 269 | static const struct clk_div_table mcu_div_table[] = { | 269 | static const struct clk_div_table mcu_div_table[] = { |
| 270 | { 0, 1 }, { 1, 2 }, { 2, 4 }, { 3, 8 }, | 270 | { 0, 1 }, { 1, 2 }, { 2, 4 }, { 3, 8 }, |
| 271 | { 4, 16 }, { 5, 32 }, { 6, 64 }, { 7, 128 }, | 271 | { 4, 16 }, { 5, 32 }, { 6, 64 }, { 7, 128 }, |
| 272 | { 8, 512 }, { 9, 512 }, { 10, 512}, { 11, 512 }, | 272 | { 8, 256 }, { 9, 512 }, { 10, 512}, { 11, 512 }, |
| 273 | { 12, 512 }, { 13, 512 }, { 14, 512}, { 15, 512 }, | 273 | { 12, 512 }, { 13, 512 }, { 14, 512}, { 15, 512 }, |
| 274 | { 0 }, | 274 | { 0 }, |
| 275 | }; | 275 | }; |
| @@ -1286,10 +1286,11 @@ _clk_stm32_register_composite(struct device *dev, | |||
| 1286 | MGATE_MP1(_id, _name, _parent, _flags, _mgate) | 1286 | MGATE_MP1(_id, _name, _parent, _flags, _mgate) |
| 1287 | 1287 | ||
| 1288 | #define KCLK(_id, _name, _parents, _flags, _mgate, _mmux)\ | 1288 | #define KCLK(_id, _name, _parents, _flags, _mgate, _mmux)\ |
| 1289 | COMPOSITE(_id, _name, _parents, CLK_OPS_PARENT_ENABLE | _flags,\ | 1289 | COMPOSITE(_id, _name, _parents, CLK_OPS_PARENT_ENABLE |\ |
| 1290 | _MGATE_MP1(_mgate),\ | 1290 | CLK_SET_RATE_NO_REPARENT | _flags,\ |
| 1291 | _MMUX(_mmux),\ | 1291 | _MGATE_MP1(_mgate),\ |
| 1292 | _NO_DIV) | 1292 | _MMUX(_mmux),\ |
| 1293 | _NO_DIV) | ||
| 1293 | 1294 | ||
| 1294 | enum { | 1295 | enum { |
| 1295 | G_SAI1, | 1296 | G_SAI1, |
| @@ -1655,12 +1656,14 @@ static const struct stm32_mux_cfg ker_mux_cfg[M_LAST] = { | |||
| 1655 | 1656 | ||
| 1656 | static const struct clock_config stm32mp1_clock_cfg[] = { | 1657 | static const struct clock_config stm32mp1_clock_cfg[] = { |
| 1657 | /* Oscillator divider */ | 1658 | /* Oscillator divider */ |
| 1658 | DIV(NO_ID, "clk-hsi-div", "clk-hsi", 0, RCC_HSICFGR, 0, 2, | 1659 | DIV(NO_ID, "clk-hsi-div", "clk-hsi", CLK_DIVIDER_POWER_OF_TWO, |
| 1659 | CLK_DIVIDER_READ_ONLY), | 1660 | RCC_HSICFGR, 0, 2, CLK_DIVIDER_READ_ONLY), |
| 1660 | 1661 | ||
| 1661 | /* External / Internal Oscillators */ | 1662 | /* External / Internal Oscillators */ |
| 1662 | GATE_MP1(CK_HSE, "ck_hse", "clk-hse", 0, RCC_OCENSETR, 8, 0), | 1663 | GATE_MP1(CK_HSE, "ck_hse", "clk-hse", 0, RCC_OCENSETR, 8, 0), |
| 1663 | GATE_MP1(CK_CSI, "ck_csi", "clk-csi", 0, RCC_OCENSETR, 4, 0), | 1664 | /* ck_csi is used by IO compensation and should be critical */ |
| 1665 | GATE_MP1(CK_CSI, "ck_csi", "clk-csi", CLK_IS_CRITICAL, | ||
| 1666 | RCC_OCENSETR, 4, 0), | ||
| 1664 | GATE_MP1(CK_HSI, "ck_hsi", "clk-hsi-div", 0, RCC_OCENSETR, 0, 0), | 1667 | GATE_MP1(CK_HSI, "ck_hsi", "clk-hsi-div", 0, RCC_OCENSETR, 0, 0), |
| 1665 | GATE(CK_LSI, "ck_lsi", "clk-lsi", 0, RCC_RDLSICR, 0, 0), | 1668 | GATE(CK_LSI, "ck_lsi", "clk-lsi", 0, RCC_RDLSICR, 0, 0), |
| 1666 | GATE(CK_LSE, "ck_lse", "clk-lse", 0, RCC_BDCR, 0, 0), | 1669 | GATE(CK_LSE, "ck_lse", "clk-lse", 0, RCC_BDCR, 0, 0), |
| @@ -1952,14 +1955,14 @@ static const struct clock_config stm32mp1_clock_cfg[] = { | |||
| 1952 | MGATE_MP1(GPU_K, "gpu_k", "pll2_q", 0, G_GPU), | 1955 | MGATE_MP1(GPU_K, "gpu_k", "pll2_q", 0, G_GPU), |
| 1953 | MGATE_MP1(DAC12_K, "dac12_k", "ck_lsi", 0, G_DAC12), | 1956 | MGATE_MP1(DAC12_K, "dac12_k", "ck_lsi", 0, G_DAC12), |
| 1954 | 1957 | ||
| 1955 | COMPOSITE(ETHPTP_K, "ethptp_k", eth_src, CLK_OPS_PARENT_ENABLE, | 1958 | COMPOSITE(ETHPTP_K, "ethptp_k", eth_src, CLK_OPS_PARENT_ENABLE | |
| 1959 | CLK_SET_RATE_NO_REPARENT, | ||
| 1956 | _NO_GATE, | 1960 | _NO_GATE, |
| 1957 | _MMUX(M_ETHCK), | 1961 | _MMUX(M_ETHCK), |
| 1958 | _DIV(RCC_ETHCKSELR, 4, 4, CLK_DIVIDER_ALLOW_ZERO, NULL)), | 1962 | _DIV(RCC_ETHCKSELR, 4, 4, 0, NULL)), |
| 1959 | 1963 | ||
| 1960 | /* RTC clock */ | 1964 | /* RTC clock */ |
| 1961 | DIV(NO_ID, "ck_hse_rtc", "ck_hse", 0, RCC_RTCDIVR, 0, 7, | 1965 | DIV(NO_ID, "ck_hse_rtc", "ck_hse", 0, RCC_RTCDIVR, 0, 6, 0), |
| 1962 | CLK_DIVIDER_ALLOW_ZERO), | ||
| 1963 | 1966 | ||
| 1964 | COMPOSITE(RTC, "ck_rtc", rtc_src, CLK_OPS_PARENT_ENABLE | | 1967 | COMPOSITE(RTC, "ck_rtc", rtc_src, CLK_OPS_PARENT_ENABLE | |
| 1965 | CLK_SET_RATE_PARENT, | 1968 | CLK_SET_RATE_PARENT, |
