Skip to content

Commit d3d8871

Browse files
committed
Merge branches 'clk-ux500', 'clk-mtk', 'clk-tegra', 'clk-allwinner' and 'clk-imx' into clk-next
- Convert ux500 to clk_hw - Add the two missing CLKOUT clocks for U8500/DB8500 SoC - MediaTek MT8186 SoC clk support - Move MediaTek driver to clk_hw provider APIs * clk-ux500: clk: ux500: fix a possible off-by-one in u8500_prcc_reset_base() clk: ux500: Implement the missing CLKOUT clocks clk: ux500: Rewrite PRCMU clocks to use clk_hw_* clk: ux500: Drop .is_prepared state from PRCMU clocks clk: ux500: Drop .is_enabled state from PRCMU clocks dt-bindings: clock: u8500: Add clkout clock bindings * clk-mtk: (22 commits) clk: mediatek: mt8173: Switch to clk_hw provider APIs clk: mediatek: Switch to clk_hw provider APIs clk: mediatek: Replace 'struct clk' with 'struct clk_hw' clk: mediatek: apmixed: Drop error message from clk_register() failure clk: mediatek: Make mtk_clk_register_composite() static clk: mediatek: use en_mask as a pure div_en_mask clk: mediatek: update compatible string for MT7986 ethsys clk: mediatek: Add MT8186 ipesys clock support clk: mediatek: Add MT8186 mdpsys clock support clk: mediatek: Add MT8186 camsys clock support clk: mediatek: Add MT8186 vencsys clock support clk: mediatek: Add MT8186 vdecsys clock support clk: mediatek: Add MT8186 imgsys clock support clk: mediatek: Add MT8186 wpesys clock support clk: mediatek: Add MT8186 mmsys clock support clk: mediatek: Add MT8186 mfgsys clock support clk: mediatek: Add MT8186 imp i2c wrapper clock support clk: mediatek: Add MT8186 apmixedsys clock support clk: mediatek: Add MT8186 infrastructure clock support clk: mediatek: Add MT8186 topckgen clock support ... * clk-tegra: clk: tegra: Update kerneldoc to match prototypes clk: tegra: Replace .round_rate() with .determine_rate() clk: tegra: Register clocks from root to leaf clk: tegra: Add missing reset deassertion * clk-allwinner: clk: sunxi-ng: h616: Add PLL derived 32KHz clock clk: sunxi-ng: h6-r: Add RTC gate clock * clk-imx: clk: imx8mp: fix usb_root_clk parent clk: imx8mp: add clkout1/2 support clk: imx: scu: Use pm_runtime_resume_and_get to fix pm_runtime_get_sync() usage clk: imx8mp: Add DISP2 pixel clock clk: imx: scu: fix a potential memory leak in __imx_clk_gpr_scu() clk: imx: Add check for kcalloc clk: imx8mn: add GPT support dt-bindings: imx: add clock bindings for i.MX8MN GPT clk: imx: Remove the snvs clock clk: imx8m: check mcore_booted before register clk clk: imx: add mcore_booted module paratemter clk: imx8mq: add 27m phy pll ref clock
6 parents 2c29798 + bea0b66 + 5876ee7 + 8b9d9e9 + 0594058 + 3972b15 commit d3d8871

135 files changed

Lines changed: 3845 additions & 1006 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: "http://devicetree.org/schemas/arm/mediatek/mediatek,mt8186-clock.yaml#"
5+
$schema: "http://devicetree.org/meta-schemas/core.yaml#"
6+
7+
title: MediaTek Functional Clock Controller for MT8186
8+
9+
maintainers:
10+
- Chun-Jie Chen <chun-jie.chen@mediatek.com>
11+
12+
description: |
13+
The clock architecture in MediaTek like below
14+
PLLs -->
15+
dividers -->
16+
muxes
17+
-->
18+
clock gate
19+
20+
The devices provide clock gate control in different IP blocks.
21+
22+
properties:
23+
compatible:
24+
items:
25+
- enum:
26+
- mediatek,mt8186-imp_iic_wrap
27+
- mediatek,mt8186-mfgsys
28+
- mediatek,mt8186-wpesys
29+
- mediatek,mt8186-imgsys1
30+
- mediatek,mt8186-imgsys2
31+
- mediatek,mt8186-vdecsys
32+
- mediatek,mt8186-vencsys
33+
- mediatek,mt8186-camsys
34+
- mediatek,mt8186-camsys_rawa
35+
- mediatek,mt8186-camsys_rawb
36+
- mediatek,mt8186-mdpsys
37+
- mediatek,mt8186-ipesys
38+
reg:
39+
maxItems: 1
40+
41+
'#clock-cells':
42+
const: 1
43+
44+
required:
45+
- compatible
46+
- reg
47+
48+
additionalProperties: false
49+
50+
examples:
51+
- |
52+
imp_iic_wrap: clock-controller@11017000 {
53+
compatible = "mediatek,mt8186-imp_iic_wrap";
54+
reg = <0x11017000 0x1000>;
55+
#clock-cells = <1>;
56+
};
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: "http://devicetree.org/schemas/arm/mediatek/mediatek,mt8186-sys-clock.yaml#"
5+
$schema: "http://devicetree.org/meta-schemas/core.yaml#"
6+
7+
title: MediaTek System Clock Controller for MT8186
8+
9+
maintainers:
10+
- Chun-Jie Chen <chun-jie.chen@mediatek.com>
11+
12+
description: |
13+
The clock architecture in MediaTek like below
14+
PLLs -->
15+
dividers -->
16+
muxes
17+
-->
18+
clock gate
19+
20+
The apmixedsys provides most of PLLs which generated from SoC 26m.
21+
The topckgen provides dividers and muxes which provide the clock source to other IP blocks.
22+
The infracfg_ao provides clock gate in peripheral and infrastructure IP blocks.
23+
The mcusys provides mux control to select the clock source in AP MCU.
24+
The device nodes also provide the system control capacity for configuration.
25+
26+
properties:
27+
compatible:
28+
items:
29+
- enum:
30+
- mediatek,mt8186-mcusys
31+
- mediatek,mt8186-topckgen
32+
- mediatek,mt8186-infracfg_ao
33+
- mediatek,mt8186-apmixedsys
34+
- const: syscon
35+
36+
reg:
37+
maxItems: 1
38+
39+
'#clock-cells':
40+
const: 1
41+
42+
required:
43+
- compatible
44+
- reg
45+
46+
additionalProperties: false
47+
48+
examples:
49+
- |
50+
topckgen: syscon@10000000 {
51+
compatible = "mediatek,mt8186-topckgen", "syscon";
52+
reg = <0x10000000 0x1000>;
53+
#clock-cells = <1>;
54+
};

Documentation/devicetree/bindings/clock/stericsson,u8500-clks.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,25 @@ properties:
109109

110110
additionalProperties: false
111111

112+
clkout-clock:
113+
description: A subnode with three clock cells for externally routed clocks,
114+
output clocks. These are two PRCMU-internal clocks that can be divided and
115+
muxed out on the pads of the DB8500 SoC.
116+
type: object
117+
118+
properties:
119+
'#clock-cells':
120+
description:
121+
The first cell indicates which output clock we are using,
122+
possible values are 0 (CLKOUT1) and 1 (CLKOUT2).
123+
The second cell indicates which clock we want to use as source,
124+
possible values are 0 thru 7, see the defines for the different
125+
source clocks.
126+
The third cell is a divider, legal values are 1 thru 63.
127+
const: 3
128+
129+
additionalProperties: false
130+
112131
required:
113132
- compatible
114133
- reg
@@ -119,3 +138,41 @@ required:
119138
- smp-twd-clock
120139

121140
additionalProperties: false
141+
142+
examples:
143+
- |
144+
#include <dt-bindings/clock/ste-db8500-clkout.h>
145+
clocks@8012 {
146+
compatible = "stericsson,u8500-clks";
147+
reg = <0x8012f000 0x1000>, <0x8011f000 0x1000>,
148+
<0x8000f000 0x1000>, <0xa03ff000 0x1000>,
149+
<0xa03cf000 0x1000>;
150+
151+
prcmu_clk: prcmu-clock {
152+
#clock-cells = <1>;
153+
};
154+
155+
prcc_pclk: prcc-periph-clock {
156+
#clock-cells = <2>;
157+
};
158+
159+
prcc_kclk: prcc-kernel-clock {
160+
#clock-cells = <2>;
161+
};
162+
163+
prcc_reset: prcc-reset-controller {
164+
#reset-cells = <2>;
165+
};
166+
167+
rtc_clk: rtc32k-clock {
168+
#clock-cells = <0>;
169+
};
170+
171+
smp_twd_clk: smp-twd-clock {
172+
#clock-cells = <0>;
173+
};
174+
175+
clkout_clk: clkout-clock {
176+
#clock-cells = <3>;
177+
};
178+
};

drivers/clk/imx/clk-composite-8m.c

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ struct clk_hw *__imx8m_clk_hw_composite(const char *name,
178178
unsigned long flags)
179179
{
180180
struct clk_hw *hw = ERR_PTR(-ENOMEM), *mux_hw;
181-
struct clk_hw *div_hw, *gate_hw;
181+
struct clk_hw *div_hw, *gate_hw = NULL;
182182
struct clk_divider *div = NULL;
183183
struct clk_gate *gate = NULL;
184184
struct clk_mux *mux = NULL;
@@ -223,14 +223,17 @@ struct clk_hw *__imx8m_clk_hw_composite(const char *name,
223223
div->lock = &imx_ccm_lock;
224224
div->flags = CLK_DIVIDER_ROUND_CLOSEST;
225225

226-
gate = kzalloc(sizeof(*gate), GFP_KERNEL);
227-
if (!gate)
228-
goto fail;
226+
/* skip registering the gate ops if M4 is enabled */
227+
if (!mcore_booted) {
228+
gate = kzalloc(sizeof(*gate), GFP_KERNEL);
229+
if (!gate)
230+
goto fail;
229231

230-
gate_hw = &gate->hw;
231-
gate->reg = reg;
232-
gate->bit_idx = PCG_CGC_SHIFT;
233-
gate->lock = &imx_ccm_lock;
232+
gate_hw = &gate->hw;
233+
gate->reg = reg;
234+
gate->bit_idx = PCG_CGC_SHIFT;
235+
gate->lock = &imx_ccm_lock;
236+
}
234237

235238
hw = clk_hw_register_composite(NULL, name, parent_names, num_parents,
236239
mux_hw, mux_ops, div_hw,

drivers/clk/imx/clk-imx7d.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,6 @@ static void __init imx7d_clocks_init(struct device_node *ccm_node)
782782
hws[IMX7D_DRAM_PHYM_ALT_ROOT_CLK] = imx_clk_hw_gate2_flags("dram_phym_alt_root_clk", "dram_phym_alt_post_div", base + 0x4130, 0, CLK_IS_CRITICAL | CLK_OPS_PARENT_ENABLE);
783783
hws[IMX7D_DRAM_ALT_ROOT_CLK] = imx_clk_hw_gate2_flags("dram_alt_root_clk", "dram_alt_post_div", base + 0x4130, 0, CLK_IS_CRITICAL | CLK_OPS_PARENT_ENABLE);
784784
hws[IMX7D_OCOTP_CLK] = imx_clk_hw_gate4("ocotp_clk", "ipg_root_clk", base + 0x4230, 0);
785-
hws[IMX7D_SNVS_CLK] = imx_clk_hw_gate4("snvs_clk", "ipg_root_clk", base + 0x4250, 0);
786785
hws[IMX7D_MU_ROOT_CLK] = imx_clk_hw_gate4("mu_root_clk", "ipg_root_clk", base + 0x4270, 0);
787786
hws[IMX7D_CAAM_CLK] = imx_clk_hw_gate4("caam_clk", "ipg_root_clk", base + 0x4240, 0);
788787
hws[IMX7D_USB_HSIC_ROOT_CLK] = imx_clk_hw_gate4("usb_hsic_root_clk", "usb_hsic_post_div", base + 0x4690, 0);

drivers/clk/imx/clk-imx8mm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,6 @@ static int imx8mm_clocks_probe(struct platform_device *pdev)
560560
hws[IMX8MM_CLK_SAI5_IPG] = imx_clk_hw_gate2_shared2("sai5_ipg_clk", "ipg_audio_root", base + 0x4370, 0, &share_count_sai5);
561561
hws[IMX8MM_CLK_SAI6_ROOT] = imx_clk_hw_gate2_shared2("sai6_root_clk", "sai6", base + 0x4380, 0, &share_count_sai6);
562562
hws[IMX8MM_CLK_SAI6_IPG] = imx_clk_hw_gate2_shared2("sai6_ipg_clk", "ipg_audio_root", base + 0x4380, 0, &share_count_sai6);
563-
hws[IMX8MM_CLK_SNVS_ROOT] = imx_clk_hw_gate4("snvs_root_clk", "ipg_root", base + 0x4470, 0);
564563
hws[IMX8MM_CLK_UART1_ROOT] = imx_clk_hw_gate4("uart1_root_clk", "uart1", base + 0x4490, 0);
565564
hws[IMX8MM_CLK_UART2_ROOT] = imx_clk_hw_gate4("uart2_root_clk", "uart2", base + 0x44a0, 0);
566565
hws[IMX8MM_CLK_UART3_ROOT] = imx_clk_hw_gate4("uart3_root_clk", "uart3", base + 0x44b0, 0);
@@ -639,6 +638,8 @@ static struct platform_driver imx8mm_clk_driver = {
639638
},
640639
};
641640
module_platform_driver(imx8mm_clk_driver);
641+
module_param(mcore_booted, bool, S_IRUGO);
642+
MODULE_PARM_DESC(mcore_booted, "See Cortex-M core is booted or not");
642643

643644
MODULE_AUTHOR("Bai Ping <ping.bai@nxp.com>");
644645
MODULE_DESCRIPTION("NXP i.MX8MM clock driver");

drivers/clk/imx/clk-imx8mn.c

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,30 @@ static const char * const imx8mn_pwm4_sels[] = {"osc_24m", "sys_pll2_100m", "sys
227227
"sys_pll1_40m", "sys_pll3_out", "clk_ext2",
228228
"sys_pll1_80m", "video_pll1_out", };
229229

230+
static const char * const imx8mn_gpt1_sels[] = {"osc_24m", "sys_pll2_100m", "sys_pll1_400m",
231+
"sys_pll1_40m", "video_pll1_out", "sys_pll1_80m",
232+
"audio_pll1_out", "clk_ext1", };
233+
234+
static const char * const imx8mn_gpt2_sels[] = {"osc_24m", "sys_pll2_100m", "sys_pll1_400m",
235+
"sys_pll1_40m", "video_pll1_out", "sys_pll1_80m",
236+
"audio_pll1_out", "clk_ext1", };
237+
238+
static const char * const imx8mn_gpt3_sels[] = {"osc_24m", "sys_pll2_100m", "sys_pll1_400m",
239+
"sys_pll1_40m", "video_pll1_out", "sys_pll1_80m",
240+
"audio_pll1_out", "clk_ext1", };
241+
242+
static const char * const imx8mn_gpt4_sels[] = {"osc_24m", "sys_pll2_100m", "sys_pll1_400m",
243+
"sys_pll1_40m", "video_pll1_out", "sys_pll1_80m",
244+
"audio_pll1_out", "clk_ext1", };
245+
246+
static const char * const imx8mn_gpt5_sels[] = {"osc_24m", "sys_pll2_100m", "sys_pll1_400m",
247+
"sys_pll1_40m", "video_pll1_out", "sys_pll1_80m",
248+
"audio_pll1_out", "clk_ext1", };
249+
250+
static const char * const imx8mn_gpt6_sels[] = {"osc_24m", "sys_pll2_100m", "sys_pll1_400m",
251+
"sys_pll1_40m", "video_pll1_out", "sys_pll1_80m",
252+
"audio_pll1_out", "clk_ext1", };
253+
230254
static const char * const imx8mn_wdog_sels[] = {"osc_24m", "sys_pll1_133m", "sys_pll1_160m",
231255
"vpu_pll_out", "sys_pll2_125m", "sys_pll3_out",
232256
"sys_pll1_80m", "sys_pll2_166m", };
@@ -476,6 +500,12 @@ static int imx8mn_clocks_probe(struct platform_device *pdev)
476500
hws[IMX8MN_CLK_PWM2] = imx8m_clk_hw_composite("pwm2", imx8mn_pwm2_sels, base + 0xb400);
477501
hws[IMX8MN_CLK_PWM3] = imx8m_clk_hw_composite("pwm3", imx8mn_pwm3_sels, base + 0xb480);
478502
hws[IMX8MN_CLK_PWM4] = imx8m_clk_hw_composite("pwm4", imx8mn_pwm4_sels, base + 0xb500);
503+
hws[IMX8MN_CLK_GPT1] = imx8m_clk_hw_composite("gpt1", imx8mn_gpt1_sels, base + 0xb580);
504+
hws[IMX8MN_CLK_GPT2] = imx8m_clk_hw_composite("gpt2", imx8mn_gpt2_sels, base + 0xb600);
505+
hws[IMX8MN_CLK_GPT3] = imx8m_clk_hw_composite("gpt3", imx8mn_gpt3_sels, base + 0xb680);
506+
hws[IMX8MN_CLK_GPT4] = imx8m_clk_hw_composite("gpt4", imx8mn_gpt4_sels, base + 0xb700);
507+
hws[IMX8MN_CLK_GPT5] = imx8m_clk_hw_composite("gpt5", imx8mn_gpt5_sels, base + 0xb780);
508+
hws[IMX8MN_CLK_GPT6] = imx8m_clk_hw_composite("gpt6", imx8mn_gpt6_sels, base + 0xb800);
479509
hws[IMX8MN_CLK_WDOG] = imx8m_clk_hw_composite("wdog", imx8mn_wdog_sels, base + 0xb900);
480510
hws[IMX8MN_CLK_WRCLK] = imx8m_clk_hw_composite("wrclk", imx8mn_wrclk_sels, base + 0xb980);
481511
hws[IMX8MN_CLK_CLKO1] = imx8m_clk_hw_composite("clko1", imx8mn_clko1_sels, base + 0xba00);
@@ -501,6 +531,12 @@ static int imx8mn_clocks_probe(struct platform_device *pdev)
501531
hws[IMX8MN_CLK_GPIO3_ROOT] = imx_clk_hw_gate4("gpio3_root_clk", "ipg_root", base + 0x40d0, 0);
502532
hws[IMX8MN_CLK_GPIO4_ROOT] = imx_clk_hw_gate4("gpio4_root_clk", "ipg_root", base + 0x40e0, 0);
503533
hws[IMX8MN_CLK_GPIO5_ROOT] = imx_clk_hw_gate4("gpio5_root_clk", "ipg_root", base + 0x40f0, 0);
534+
hws[IMX8MN_CLK_GPT1_ROOT] = imx_clk_hw_gate4("gpt1_root_clk", "gpt1", base + 0x4100, 0);
535+
hws[IMX8MN_CLK_GPT2_ROOT] = imx_clk_hw_gate4("gpt2_root_clk", "gpt2", base + 0x4110, 0);
536+
hws[IMX8MN_CLK_GPT3_ROOT] = imx_clk_hw_gate4("gpt3_root_clk", "gpt3", base + 0x4120, 0);
537+
hws[IMX8MN_CLK_GPT4_ROOT] = imx_clk_hw_gate4("gpt4_root_clk", "gpt4", base + 0x4130, 0);
538+
hws[IMX8MN_CLK_GPT5_ROOT] = imx_clk_hw_gate4("gpt5_root_clk", "gpt5", base + 0x4140, 0);
539+
hws[IMX8MN_CLK_GPT6_ROOT] = imx_clk_hw_gate4("gpt6_root_clk", "gpt6", base + 0x4150, 0);
504540
hws[IMX8MN_CLK_I2C1_ROOT] = imx_clk_hw_gate4("i2c1_root_clk", "i2c1", base + 0x4170, 0);
505541
hws[IMX8MN_CLK_I2C2_ROOT] = imx_clk_hw_gate4("i2c2_root_clk", "i2c2", base + 0x4180, 0);
506542
hws[IMX8MN_CLK_I2C3_ROOT] = imx_clk_hw_gate4("i2c3_root_clk", "i2c3", base + 0x4190, 0);
@@ -522,7 +558,6 @@ static int imx8mn_clocks_probe(struct platform_device *pdev)
522558
hws[IMX8MN_CLK_SAI5_IPG] = imx_clk_hw_gate2_shared2("sai5_ipg_clk", "ipg_audio_root", base + 0x4370, 0, &share_count_sai5);
523559
hws[IMX8MN_CLK_SAI6_ROOT] = imx_clk_hw_gate2_shared2("sai6_root_clk", "sai6", base + 0x4380, 0, &share_count_sai6);
524560
hws[IMX8MN_CLK_SAI6_IPG] = imx_clk_hw_gate2_shared2("sai6_ipg_clk", "ipg_audio_root", base + 0x4380, 0, &share_count_sai6);
525-
hws[IMX8MN_CLK_SNVS_ROOT] = imx_clk_hw_gate4("snvs_root_clk", "ipg_root", base + 0x4470, 0);
526561
hws[IMX8MN_CLK_UART1_ROOT] = imx_clk_hw_gate4("uart1_root_clk", "uart1", base + 0x4490, 0);
527562
hws[IMX8MN_CLK_UART2_ROOT] = imx_clk_hw_gate4("uart2_root_clk", "uart2", base + 0x44a0, 0);
528563
hws[IMX8MN_CLK_UART3_ROOT] = imx_clk_hw_gate4("uart3_root_clk", "uart3", base + 0x44b0, 0);
@@ -549,6 +584,8 @@ static int imx8mn_clocks_probe(struct platform_device *pdev)
549584
hws[IMX8MN_CLK_SDMA3_ROOT] = imx_clk_hw_gate4("sdma3_clk", "ipg_audio_root", base + 0x45f0, 0);
550585
hws[IMX8MN_CLK_SAI7_ROOT] = imx_clk_hw_gate2_shared2("sai7_root_clk", "sai7", base + 0x4650, 0, &share_count_sai7);
551586

587+
hws[IMX8MN_CLK_GPT_3M] = imx_clk_hw_fixed_factor("gpt_3m", "osc_24m", 1, 8);
588+
552589
hws[IMX8MN_CLK_DRAM_ALT_ROOT] = imx_clk_hw_fixed_factor("dram_alt_root", "dram_alt", 1, 4);
553590

554591
hws[IMX8MN_CLK_ARM] = imx_clk_hw_cpu("arm", "arm_a53_core",
@@ -594,6 +631,8 @@ static struct platform_driver imx8mn_clk_driver = {
594631
},
595632
};
596633
module_platform_driver(imx8mn_clk_driver);
634+
module_param(mcore_booted, bool, S_IRUGO);
635+
MODULE_PARM_DESC(mcore_booted, "See Cortex-M core is booted or not");
597636

598637
MODULE_AUTHOR("Anson Huang <Anson.Huang@nxp.com>");
599638
MODULE_DESCRIPTION("NXP i.MX8MN clock driver");

drivers/clk/imx/clk-imx8mp.c

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ static const char * const imx8mp_media_mipi_phy1_ref_sels[] = {"osc_24m", "sys_p
358358
"clk_ext2", "audio_pll2_out",
359359
"video_pll1_out", };
360360

361-
static const char * const imx8mp_media_disp1_pix_sels[] = {"osc_24m", "video_pll1_out", "audio_pll2_out",
361+
static const char * const imx8mp_media_disp_pix_sels[] = {"osc_24m", "video_pll1_out", "audio_pll2_out",
362362
"audio_pll1_out", "sys_pll1_800m",
363363
"sys_pll2_1000m", "sys_pll3_out", "clk_ext4", };
364364

@@ -399,6 +399,11 @@ static const char * const imx8mp_sai7_sels[] = {"osc_24m", "audio_pll1_out", "au
399399

400400
static const char * const imx8mp_dram_core_sels[] = {"dram_pll_out", "dram_alt_root", };
401401

402+
static const char * const imx8mp_clkout_sels[] = {"audio_pll1_out", "audio_pll2_out", "video_pll1_out",
403+
"dummy", "dummy", "gpu_pll_out", "vpu_pll_out",
404+
"arm_pll_out", "sys_pll1", "sys_pll2", "sys_pll3",
405+
"dummy", "dummy", "osc_24m", "dummy", "osc_32k"};
406+
402407
static struct clk_hw **hws;
403408
static struct clk_hw_onecell_data *clk_hw_data;
404409

@@ -504,6 +509,15 @@ static int imx8mp_clocks_probe(struct platform_device *pdev)
504509
hws[IMX8MP_SYS_PLL2_500M] = imx_clk_hw_fixed_factor("sys_pll2_500m", "sys_pll2_out", 1, 2);
505510
hws[IMX8MP_SYS_PLL2_1000M] = imx_clk_hw_fixed_factor("sys_pll2_1000m", "sys_pll2_out", 1, 1);
506511

512+
hws[IMX8MP_CLK_CLKOUT1_SEL] = imx_clk_hw_mux2("clkout1_sel", anatop_base + 0x128, 4, 4,
513+
imx8mp_clkout_sels, ARRAY_SIZE(imx8mp_clkout_sels));
514+
hws[IMX8MP_CLK_CLKOUT1_DIV] = imx_clk_hw_divider("clkout1_div", "clkout1_sel", anatop_base + 0x128, 0, 4);
515+
hws[IMX8MP_CLK_CLKOUT1] = imx_clk_hw_gate("clkout1", "clkout1_div", anatop_base + 0x128, 8);
516+
hws[IMX8MP_CLK_CLKOUT2_SEL] = imx_clk_hw_mux2("clkout2_sel", anatop_base + 0x128, 20, 4,
517+
imx8mp_clkout_sels, ARRAY_SIZE(imx8mp_clkout_sels));
518+
hws[IMX8MP_CLK_CLKOUT2_DIV] = imx_clk_hw_divider("clkout2_div", "clkout2_sel", anatop_base + 0x128, 16, 4);
519+
hws[IMX8MP_CLK_CLKOUT2] = imx_clk_hw_gate("clkout2", "clkout2_div", anatop_base + 0x128, 24);
520+
507521
hws[IMX8MP_CLK_A53_DIV] = imx8m_clk_hw_composite_core("arm_a53_div", imx8mp_a53_sels, ccm_base + 0x8000);
508522
hws[IMX8MP_CLK_A53_SRC] = hws[IMX8MP_CLK_A53_DIV];
509523
hws[IMX8MP_CLK_A53_CG] = hws[IMX8MP_CLK_A53_DIV];
@@ -538,6 +552,7 @@ static int imx8mp_clocks_probe(struct platform_device *pdev)
538552
hws[IMX8MP_CLK_AHB] = imx8m_clk_hw_composite_bus_critical("ahb_root", imx8mp_ahb_sels, ccm_base + 0x9000);
539553
hws[IMX8MP_CLK_AUDIO_AHB] = imx8m_clk_hw_composite_bus("audio_ahb", imx8mp_audio_ahb_sels, ccm_base + 0x9100);
540554
hws[IMX8MP_CLK_MIPI_DSI_ESC_RX] = imx8m_clk_hw_composite_bus("mipi_dsi_esc_rx", imx8mp_mipi_dsi_esc_rx_sels, ccm_base + 0x9200);
555+
hws[IMX8MP_CLK_MEDIA_DISP2_PIX] = imx8m_clk_hw_composite("media_disp2_pix", imx8mp_media_disp_pix_sels, ccm_base + 0x9300);
541556

542557
hws[IMX8MP_CLK_IPG_ROOT] = imx_clk_hw_divider2("ipg_root", "ahb_root", ccm_base + 0x9080, 0, 1);
543558

@@ -600,7 +615,7 @@ static int imx8mp_clocks_probe(struct platform_device *pdev)
600615
hws[IMX8MP_CLK_USDHC3] = imx8m_clk_hw_composite("usdhc3", imx8mp_usdhc3_sels, ccm_base + 0xbc80);
601616
hws[IMX8MP_CLK_MEDIA_CAM1_PIX] = imx8m_clk_hw_composite("media_cam1_pix", imx8mp_media_cam1_pix_sels, ccm_base + 0xbd00);
602617
hws[IMX8MP_CLK_MEDIA_MIPI_PHY1_REF] = imx8m_clk_hw_composite("media_mipi_phy1_ref", imx8mp_media_mipi_phy1_ref_sels, ccm_base + 0xbd80);
603-
hws[IMX8MP_CLK_MEDIA_DISP1_PIX] = imx8m_clk_hw_composite("media_disp1_pix", imx8mp_media_disp1_pix_sels, ccm_base + 0xbe00);
618+
hws[IMX8MP_CLK_MEDIA_DISP1_PIX] = imx8m_clk_hw_composite("media_disp1_pix", imx8mp_media_disp_pix_sels, ccm_base + 0xbe00);
604619
hws[IMX8MP_CLK_MEDIA_CAM2_PIX] = imx8m_clk_hw_composite("media_cam2_pix", imx8mp_media_cam2_pix_sels, ccm_base + 0xbe80);
605620
hws[IMX8MP_CLK_MEDIA_LDB] = imx8m_clk_hw_composite("media_ldb", imx8mp_media_ldb_sels, ccm_base + 0xbf00);
606621
hws[IMX8MP_CLK_MEMREPAIR] = imx8m_clk_hw_composite_critical("mem_repair", imx8mp_memrepair_sels, ccm_base + 0xbf80);
@@ -654,12 +669,11 @@ static int imx8mp_clocks_probe(struct platform_device *pdev)
654669
hws[IMX8MP_CLK_SIM_ENET_ROOT] = imx_clk_hw_gate4("sim_enet_root_clk", "enet_axi", ccm_base + 0x4400, 0);
655670
hws[IMX8MP_CLK_GPU2D_ROOT] = imx_clk_hw_gate4("gpu2d_root_clk", "gpu2d_core", ccm_base + 0x4450, 0);
656671
hws[IMX8MP_CLK_GPU3D_ROOT] = imx_clk_hw_gate4("gpu3d_root_clk", "gpu3d_core", ccm_base + 0x4460, 0);
657-
hws[IMX8MP_CLK_SNVS_ROOT] = imx_clk_hw_gate4("snvs_root_clk", "ipg_root", ccm_base + 0x4470, 0);
658672
hws[IMX8MP_CLK_UART1_ROOT] = imx_clk_hw_gate4("uart1_root_clk", "uart1", ccm_base + 0x4490, 0);
659673
hws[IMX8MP_CLK_UART2_ROOT] = imx_clk_hw_gate4("uart2_root_clk", "uart2", ccm_base + 0x44a0, 0);
660674
hws[IMX8MP_CLK_UART3_ROOT] = imx_clk_hw_gate4("uart3_root_clk", "uart3", ccm_base + 0x44b0, 0);
661675
hws[IMX8MP_CLK_UART4_ROOT] = imx_clk_hw_gate4("uart4_root_clk", "uart4", ccm_base + 0x44c0, 0);
662-
hws[IMX8MP_CLK_USB_ROOT] = imx_clk_hw_gate4("usb_root_clk", "osc_32k", ccm_base + 0x44d0, 0);
676+
hws[IMX8MP_CLK_USB_ROOT] = imx_clk_hw_gate4("usb_root_clk", "hsio_axi", ccm_base + 0x44d0, 0);
663677
hws[IMX8MP_CLK_USB_PHY_ROOT] = imx_clk_hw_gate4("usb_phy_root_clk", "usb_phy_ref", ccm_base + 0x44f0, 0);
664678
hws[IMX8MP_CLK_USDHC1_ROOT] = imx_clk_hw_gate4("usdhc1_root_clk", "usdhc1", ccm_base + 0x4510, 0);
665679
hws[IMX8MP_CLK_USDHC2_ROOT] = imx_clk_hw_gate4("usdhc2_root_clk", "usdhc2", ccm_base + 0x4520, 0);
@@ -721,6 +735,8 @@ static struct platform_driver imx8mp_clk_driver = {
721735
},
722736
};
723737
module_platform_driver(imx8mp_clk_driver);
738+
module_param(mcore_booted, bool, S_IRUGO);
739+
MODULE_PARM_DESC(mcore_booted, "See Cortex-M core is booted or not");
724740

725741
MODULE_AUTHOR("Anson Huang <Anson.Huang@nxp.com>");
726742
MODULE_DESCRIPTION("NXP i.MX8MP clock driver");

0 commit comments

Comments
 (0)