Skip to content

Commit 6b60c3a

Browse files
MrVanabelvesa
authored andcommitted
clk: imx: imx93: Add nic and A55 clk
The A55 clock logic as below: A55_PLL ----------------->\ A55_SEL-->A55_CORE A55_CCM_ROOT--->A55_GATE->/ Add A55 CPU clk to support freq change. Add NIC CLK to reflect the clk status Signed-off-by: Peng Fan <[email protected]> Reviewed-by: Abel Vesa <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Abel Vesa <[email protected]>
1 parent 5fd7b00 commit 6b60c3a

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

drivers/clk/imx/clk-imx93.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ static u32 share_count_sai2;
3333
static u32 share_count_sai3;
3434
static u32 share_count_mub;
3535

36+
static const char * const a55_core_sels[] = {"a55_alt", "arm_pll"};
3637
static const char *parent_names[MAX_SEL][4] = {
3738
{"osc_24m", "sys_pll_pfd0_div2", "sys_pll_pfd1_div2", "video_pll"},
3839
{"osc_24m", "sys_pll_pfd0_div2", "sys_pll_pfd1_div2", "sys_pll_pfd2_div2"},
@@ -55,7 +56,7 @@ static const struct imx93_clk_root {
5556
/* a55/m33/bus critical clk for system run */
5657
{ IMX93_CLK_A55_PERIPH, "a55_periph_root", 0x0000, FAST_SEL, CLK_IS_CRITICAL },
5758
{ IMX93_CLK_A55_MTR_BUS, "a55_mtr_bus_root", 0x0080, LOW_SPEED_IO_SEL, CLK_IS_CRITICAL },
58-
{ IMX93_CLK_A55, "a55_root", 0x0100, FAST_SEL, CLK_IS_CRITICAL },
59+
{ IMX93_CLK_A55, "a55_alt_root", 0x0100, FAST_SEL, CLK_IS_CRITICAL },
5960
{ IMX93_CLK_M33, "m33_root", 0x0180, LOW_SPEED_IO_SEL, CLK_IS_CRITICAL },
6061
{ IMX93_CLK_BUS_WAKEUP, "bus_wakeup_root", 0x0280, LOW_SPEED_IO_SEL, CLK_IS_CRITICAL },
6162
{ IMX93_CLK_BUS_AON, "bus_aon_root", 0x0300, LOW_SPEED_IO_SEL, CLK_IS_CRITICAL },
@@ -117,6 +118,7 @@ static const struct imx93_clk_root {
117118
{ IMX93_CLK_HSIO_USB_TEST_60M, "hsio_usb_test_60m_root", 0x1f00, LOW_SPEED_IO_SEL, },
118119
{ IMX93_CLK_HSIO_ACSCAN_80M, "hsio_acscan_80m_root", 0x1f80, LOW_SPEED_IO_SEL, },
119120
{ IMX93_CLK_HSIO_ACSCAN_480M, "hsio_acscan_480m_root", 0x2000, MISC_SEL, },
121+
{ IMX93_CLK_NIC_AXI, "nic_axi_root", 0x2080, FAST_SEL, CLK_IS_CRITICAL, },
120122
{ IMX93_CLK_ML_APB, "ml_apb_root", 0x2180, LOW_SPEED_IO_SEL, },
121123
{ IMX93_CLK_ML, "ml_root", 0x2200, FAST_SEL, },
122124
{ IMX93_CLK_MEDIA_AXI, "media_axi_root", 0x2280, FAST_SEL, },
@@ -153,7 +155,7 @@ static const struct imx93_clk_ccgr {
153155
unsigned long flags;
154156
u32 *shared_count;
155157
} ccgr_array[] = {
156-
{ IMX93_CLK_A55_GATE, "a55", "a55_root", 0x8000, },
158+
{ IMX93_CLK_A55_GATE, "a55_alt", "a55_alt_root", 0x8000, },
157159
/* M33 critical clk for system run */
158160
{ IMX93_CLK_CM33_GATE, "cm33", "m33_root", 0x8040, CLK_IS_CRITICAL },
159161
{ IMX93_CLK_ADC1_GATE, "adc1", "adc_root", 0x82c0, },
@@ -291,6 +293,9 @@ static int imx93_clocks_probe(struct platform_device *pdev)
291293
if (WARN_ON(!anatop_base))
292294
return -ENOMEM;
293295

296+
clks[IMX93_CLK_ARM_PLL] = imx_clk_fracn_gppll_integer("arm_pll", "osc_24m",
297+
anatop_base + 0x1000,
298+
&imx_fracn_gppll_integer);
294299
clks[IMX93_CLK_AUDIO_PLL] = imx_clk_fracn_gppll("audio_pll", "osc_24m", anatop_base + 0x1200,
295300
&imx_fracn_gppll);
296301
clks[IMX93_CLK_VIDEO_PLL] = imx_clk_fracn_gppll("video_pll", "osc_24m", anatop_base + 0x1400,
@@ -318,6 +323,14 @@ static int imx93_clocks_probe(struct platform_device *pdev)
318323
ccgr->shared_count);
319324
}
320325

326+
clks[IMX93_CLK_A55_SEL] = imx_clk_hw_mux2("a55_sel", base + 0x4820, 0, 1, a55_core_sels,
327+
ARRAY_SIZE(a55_core_sels));
328+
clks[IMX93_CLK_A55_CORE] = imx_clk_hw_cpu("a55_core", "a55_sel",
329+
clks[IMX93_CLK_A55_SEL]->clk,
330+
clks[IMX93_CLK_A55_SEL]->clk,
331+
clks[IMX93_CLK_ARM_PLL]->clk,
332+
clks[IMX93_CLK_A55_GATE]->clk);
333+
321334
imx_check_clk_hws(clks, IMX93_CLK_END);
322335

323336
ret = of_clk_add_hw_provider(np, of_clk_hw_onecell_get, clk_hw_data);

0 commit comments

Comments
 (0)