Lines Matching +full:osc +full:- +full:bypass
1 // SPDX-License-Identifier: GPL-2.0-or-later
6 #include <dt-bindings/clock/imx6ul-clock.h>
9 #include <linux/clk-provider.h>
13 #include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
21 static const char *pll_bypass_src_sels[] = { "osc", "dummy", };
30 static const char *step_sels[] = { "osc", "ca7_secondary_sel", };
36 static const char *periph_clk2_sels[] = { "pll3_usb_otg", "osc", "pll2_bypass_src", };
37 static const char *periph2_clk2_sels[] = { "pll3_usb_otg", "osc", };
53 static const char *can_sels[] = { "pll3_60m", "osc", "pll3_80m", "dummy", };
54 static const char *ecspi_sels[] = { "pll3_60m", "osc", };
55 static const char *uart_sels[] = { "pll3_80m", "osc", };
56 static const char *perclk_sels[] = { "ipg", "osc", };
58 static const char *csi_sels[] = { "osc", "pll2_pfd2_396m", "pll3_120m", "pll3_pfd1_540m", };
67 "dummy", "dummy", "dummy", "dummy", "dummy", "dummy", "osc", "dummy",
138 clk_hw_data->num = IMX6UL_CLK_END; in imx6ul_clocks_init()
139 hws = clk_hw_data->hws; in imx6ul_clocks_init()
144 hws[IMX6UL_CLK_OSC] = imx_get_clk_hw_by_name(ccm_node, "osc"); in imx6ul_clocks_init()
150 np = of_find_compatible_node(NULL, NULL, "fsl,imx6ul-anatop"); in imx6ul_clocks_init()
163 hws[IMX6UL_CLK_PLL1] = imx_clk_hw_pllv3(IMX_PLLV3_SYS, "pll1", "osc", base + 0x00, 0x7f); in imx6ul_clocks_init()
164 hws[IMX6UL_CLK_PLL2] = imx_clk_hw_pllv3(IMX_PLLV3_GENERIC, "pll2", "osc", base + 0x30, 0x1); in imx6ul_clocks_init()
165 hws[IMX6UL_CLK_PLL3] = imx_clk_hw_pllv3(IMX_PLLV3_USB, "pll3", "osc", base + 0x10, 0x3); in imx6ul_clocks_init()
166 hws[IMX6UL_CLK_PLL4] = imx_clk_hw_pllv3(IMX_PLLV3_AV, "pll4", "osc", base + 0x70, 0x7f); in imx6ul_clocks_init()
167 hws[IMX6UL_CLK_PLL5] = imx_clk_hw_pllv3(IMX_PLLV3_AV, "pll5", "osc", base + 0xa0, 0x7f); in imx6ul_clocks_init()
168 hws[IMX6UL_CLK_PLL6] = imx_clk_hw_pllv3(IMX_PLLV3_ENET, "pll6", "osc", base + 0xe0, 0x3); in imx6ul_clocks_init()
169 hws[IMX6UL_CLK_PLL7] = imx_clk_hw_pllv3(IMX_PLLV3_USB, "pll7", "osc", base + 0x20, 0x3); in imx6ul_clocks_init()
179 /* Do not bypass PLLs initially */ in imx6ul_clocks_init()
180 clk_set_parent(hws[IMX6UL_PLL1_BYPASS]->clk, hws[IMX6UL_CLK_PLL1]->clk); in imx6ul_clocks_init()
181 clk_set_parent(hws[IMX6UL_PLL2_BYPASS]->clk, hws[IMX6UL_CLK_PLL2]->clk); in imx6ul_clocks_init()
182 clk_set_parent(hws[IMX6UL_PLL3_BYPASS]->clk, hws[IMX6UL_CLK_PLL3]->clk); in imx6ul_clocks_init()
183 clk_set_parent(hws[IMX6UL_PLL4_BYPASS]->clk, hws[IMX6UL_CLK_PLL4]->clk); in imx6ul_clocks_init()
184 clk_set_parent(hws[IMX6UL_PLL5_BYPASS]->clk, hws[IMX6UL_CLK_PLL5]->clk); in imx6ul_clocks_init()
185 clk_set_parent(hws[IMX6UL_PLL6_BYPASS]->clk, hws[IMX6UL_CLK_PLL6]->clk); in imx6ul_clocks_init()
186 clk_set_parent(hws[IMX6UL_PLL7_BYPASS]->clk, hws[IMX6UL_CLK_PLL7]->clk); in imx6ul_clocks_init()
197 * Bit 20 is the reserved and read-only bit, we do this only for: in imx6ul_clocks_init()
198 * - Do nothing for usbphy clk_enable/disable in imx6ul_clocks_init()
199 * - Keep refcount when do usbphy clk_enable/disable, in that case, in imx6ul_clocks_init()
245 hws[IMX6UL_CLK_GPT_3M] = imx_clk_hw_fixed_factor("gpt_3m", "osc", 1, 8); in imx6ul_clocks_init()
491 hws[IMX6UL_CLK_ENET1_REF_SEL] = imx_clk_gpr_mux("enet1_ref_sel", "fsl,imx6ul-iomuxc-gpr", in imx6ul_clocks_init()
496 hws[IMX6UL_CLK_ENET2_REF_SEL] = imx_clk_gpr_mux("enet2_ref_sel", "fsl,imx6ul-iomuxc-gpr", in imx6ul_clocks_init()
511 clk_set_rate(hws[IMX6UL_CLK_AHB]->clk, 99000000); in imx6ul_clocks_init()
514 clk_set_parent(hws[IMX6UL_CLK_PERIPH_CLK2_SEL]->clk, hws[IMX6UL_CLK_OSC]->clk); in imx6ul_clocks_init()
515 clk_set_parent(hws[IMX6UL_CLK_PERIPH]->clk, hws[IMX6UL_CLK_PERIPH_CLK2]->clk); in imx6ul_clocks_init()
516 clk_set_parent(hws[IMX6UL_CLK_PERIPH_PRE]->clk, hws[IMX6UL_CLK_PLL2_BUS]->clk); in imx6ul_clocks_init()
517 clk_set_parent(hws[IMX6UL_CLK_PERIPH]->clk, hws[IMX6UL_CLK_PERIPH_PRE]->clk); in imx6ul_clocks_init()
520 clk_set_rate(hws[IMX6UL_CLK_AHB]->clk, 132000000); in imx6ul_clocks_init()
522 /* set perclk to from OSC */ in imx6ul_clocks_init()
523 clk_set_parent(hws[IMX6UL_CLK_PERCLK_SEL]->clk, hws[IMX6UL_CLK_OSC]->clk); in imx6ul_clocks_init()
525 clk_set_rate(hws[IMX6UL_CLK_ENET_REF]->clk, 50000000); in imx6ul_clocks_init()
526 clk_set_rate(hws[IMX6UL_CLK_ENET2_REF]->clk, 50000000); in imx6ul_clocks_init()
527 clk_set_rate(hws[IMX6UL_CLK_CSI]->clk, 24000000); in imx6ul_clocks_init()
530 clk_prepare_enable(hws[IMX6UL_CLK_AIPSTZ3]->clk); in imx6ul_clocks_init()
533 clk_prepare_enable(hws[IMX6UL_CLK_USBPHY1_GATE]->clk); in imx6ul_clocks_init()
534 clk_prepare_enable(hws[IMX6UL_CLK_USBPHY2_GATE]->clk); in imx6ul_clocks_init()
537 clk_set_parent(hws[IMX6UL_CLK_CAN_SEL]->clk, hws[IMX6UL_CLK_PLL3_80M]->clk); in imx6ul_clocks_init()
539 clk_set_parent(hws[IMX6UL_CLK_SIM_PRE_SEL]->clk, hws[IMX6UL_CLK_PLL3_USB_OTG]->clk); in imx6ul_clocks_init()
541 clk_set_parent(hws[IMX6ULL_CLK_EPDC_PRE_SEL]->clk, hws[IMX6UL_CLK_PLL3_PFD2]->clk); in imx6ul_clocks_init()
543 clk_set_parent(hws[IMX6UL_CLK_ENFC_SEL]->clk, hws[IMX6UL_CLK_PLL2_PFD2]->clk); in imx6ul_clocks_init()
545 clk_set_parent(hws[IMX6UL_CLK_ENET1_REF_SEL]->clk, hws[IMX6UL_CLK_ENET1_REF_125M]->clk); in imx6ul_clocks_init()
546 clk_set_parent(hws[IMX6UL_CLK_ENET2_REF_SEL]->clk, hws[IMX6UL_CLK_ENET2_REF_125M]->clk); in imx6ul_clocks_init()
551 CLK_OF_DECLARE(imx6ul, "fsl,imx6ul-ccm", imx6ul_clocks_init);