Skip to content

Commit af05917

Browse files
committed
Merge tag 'clk-imx-6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/abelvesa/linux into clk-imx
Pull i.MX clk driver updates from Abel Vesa: - Add reset controller support to audiomix block control - Add CLK_SET_RATE_PARENT flag to all audiomix clocks and to i.MX7D lcdif_pixel_src clock - Fix parent clocks for earc_phy and audpll on i.MX8MP - Fix default parents for enet[12]_ref_sel on i.MX6UL - Add ops in composite 8M and 93 that allow no-op on disable - Add check for PCC present bit on composite 7ULP register - Fix fractional part for fracn-gppll on prepare - Fix clock tree update for TF-A managed clocks on i.MX8M - Drop CLK_SET_PARENT_GATE for DRAM mux on i.MX7D - Add the SAI7 IPG clock for i.MX8MN - Mark the 'nand_usdhc_bus' clock as non-critical on i.MX8MM - Add LVDS bypass clocks on i.MX8QXP - Add muxes for MIPI and PHY ref clocks - Reorder dc0_bypass0_clk, lcd_pxl and dc1_disp clocks on i.MX8QXP - Add 1039.5MHz and 800MHz rates to fracn-gppll table - Add CLK_SET_RATE_PARENT for media_disp pixel clocks on i.MX8QXP - Add some module descriptions to the i.MX generic and the i.MXRT1050 driver. - Fix return value for bypass for composite 7ULP * tag 'clk-imx-6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/abelvesa/linux: (22 commits) clk: imx: composite-7ulp: Use NULL instead of 0 clk: imx: add missing MODULE_DESCRIPTION() macros clk: imx: clk-imx8mp: Allow media_disp pixel clock reconfigure parent rate clk: imx: fracn-gppll: update rate table clk: imx: imx8qxp: Parent should be initialized earlier than the clock clk: imx: imx8qxp: Register dc0_bypass0_clk before disp clk clk: imx: imx8qxp: Add clock muxes for MIPI and PHY ref clocks clk: imx: imx8qxp: Add LVDS bypass clocks clk: imx: imx8mm: Change the 'nand_usdhc_bus' clock to non-critical one clk: imx: imx8mn: add sai7_ipg_clk clock settings clk: imx: add CLK_SET_RATE_PARENT for lcdif_pixel_src for i.MX7D clk: imx: Remove CLK_SET_PARENT_GATE for DRAM mux for i.MX7D clk: imx: imx8mp: fix clock tree update of TF-A managed clocks clk: imx: fracn-gppll: fix fractional part of PLL getting lost clk: imx: composite-7ulp: Check the PCC present bit clk: imx: composite-93: keep root clock on when mcore enabled clk: imx: composite-8m: Enable gate clk with mcore_booted clk: imx: imx6ul: fix default parent for enet*_ref_sel clk: imx: clk-audiomix: Correct parent clock for earc_phy and audpll clk: imx: clk-audiomix: Add CLK_SET_RATE_PARENT flags for clocks ...
2 parents 1613e60 + 466da3d commit af05917

File tree

16 files changed

+197
-52
lines changed

16 files changed

+197
-52
lines changed

Documentation/devicetree/bindings/clock/imx8mp-audiomix.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ properties:
4444
ID in its "clocks" phandle cell. See include/dt-bindings/clock/imx8mp-clock.h
4545
for the full list of i.MX8MP IMX8MP_CLK_AUDIOMIX_ clock IDs.
4646

47+
'#reset-cells':
48+
const: 1
49+
4750
required:
4851
- compatible
4952
- reg

drivers/clk/imx/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ config CLK_IMX8MP
8181
tristate "IMX8MP CCM Clock Driver"
8282
depends on ARCH_MXC || COMPILE_TEST
8383
select MXC_CLK
84+
select AUXILIARY_BUS if RESET_CONTROLLER
8485
help
8586
Build the driver for i.MX8MP CCM Clock Driver
8687

drivers/clk/imx/clk-composite-7ulp.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "../clk-fractional-divider.h"
1515
#include "clk.h"
1616

17+
#define PCG_PR_MASK BIT(31)
1718
#define PCG_PCS_SHIFT 24
1819
#define PCG_PCS_MASK 0x7
1920
#define PCG_CGC_SHIFT 30
@@ -78,6 +79,12 @@ static struct clk_hw *imx_ulp_clk_hw_composite(const char *name,
7879
struct clk_hw *hw;
7980
u32 val;
8081

82+
val = readl(reg);
83+
if (!(val & PCG_PR_MASK)) {
84+
pr_info("PCC PR is 0 for clk:%s, bypass\n", name);
85+
return NULL;
86+
}
87+
8188
if (mux_present) {
8289
mux = kzalloc(sizeof(*mux), GFP_KERNEL);
8390
if (!mux)

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

Lines changed: 42 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,34 @@ static const struct clk_ops imx8m_clk_composite_mux_ops = {
204204
.determine_rate = imx8m_clk_composite_mux_determine_rate,
205205
};
206206

207+
static int imx8m_clk_composite_gate_enable(struct clk_hw *hw)
208+
{
209+
struct clk_gate *gate = to_clk_gate(hw);
210+
unsigned long flags;
211+
u32 val;
212+
213+
spin_lock_irqsave(gate->lock, flags);
214+
215+
val = readl(gate->reg);
216+
val |= BIT(gate->bit_idx);
217+
writel(val, gate->reg);
218+
219+
spin_unlock_irqrestore(gate->lock, flags);
220+
221+
return 0;
222+
}
223+
224+
static void imx8m_clk_composite_gate_disable(struct clk_hw *hw)
225+
{
226+
/* composite clk requires the disable hook */
227+
}
228+
229+
static const struct clk_ops imx8m_clk_composite_gate_ops = {
230+
.enable = imx8m_clk_composite_gate_enable,
231+
.disable = imx8m_clk_composite_gate_disable,
232+
.is_enabled = clk_gate_is_enabled,
233+
};
234+
207235
struct clk_hw *__imx8m_clk_hw_composite(const char *name,
208236
const char * const *parent_names,
209237
int num_parents, void __iomem *reg,
@@ -217,6 +245,7 @@ struct clk_hw *__imx8m_clk_hw_composite(const char *name,
217245
struct clk_mux *mux;
218246
const struct clk_ops *divider_ops;
219247
const struct clk_ops *mux_ops;
248+
const struct clk_ops *gate_ops;
220249

221250
mux = kzalloc(sizeof(*mux), GFP_KERNEL);
222251
if (!mux)
@@ -257,20 +286,22 @@ struct clk_hw *__imx8m_clk_hw_composite(const char *name,
257286
div->flags = CLK_DIVIDER_ROUND_CLOSEST;
258287

259288
/* skip registering the gate ops if M4 is enabled */
260-
if (!mcore_booted) {
261-
gate = kzalloc(sizeof(*gate), GFP_KERNEL);
262-
if (!gate)
263-
goto free_div;
264-
265-
gate_hw = &gate->hw;
266-
gate->reg = reg;
267-
gate->bit_idx = PCG_CGC_SHIFT;
268-
gate->lock = &imx_ccm_lock;
269-
}
289+
gate = kzalloc(sizeof(*gate), GFP_KERNEL);
290+
if (!gate)
291+
goto free_div;
292+
293+
gate_hw = &gate->hw;
294+
gate->reg = reg;
295+
gate->bit_idx = PCG_CGC_SHIFT;
296+
gate->lock = &imx_ccm_lock;
297+
if (!mcore_booted)
298+
gate_ops = &clk_gate_ops;
299+
else
300+
gate_ops = &imx8m_clk_composite_gate_ops;
270301

271302
hw = clk_hw_register_composite(NULL, name, parent_names, num_parents,
272303
mux_hw, mux_ops, div_hw,
273-
divider_ops, gate_hw, &clk_gate_ops, flags);
304+
divider_ops, gate_hw, gate_ops, flags);
274305
if (IS_ERR(hw))
275306
goto free_gate;
276307

drivers/clk/imx/clk-composite-93.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ static int imx93_clk_composite_gate_enable(struct clk_hw *hw)
7676

7777
static void imx93_clk_composite_gate_disable(struct clk_hw *hw)
7878
{
79+
/*
80+
* Skip disable the root clock gate if mcore enabled.
81+
* The root clock may be used by the mcore.
82+
*/
83+
if (mcore_booted)
84+
return;
85+
7986
imx93_clk_composite_gate_endisable(hw, 0);
8087
}
8188

@@ -222,7 +229,7 @@ struct clk_hw *imx93_clk_composite_flags(const char *name, const char * const *p
222229
hw = clk_hw_register_composite(NULL, name, parent_names, num_parents,
223230
mux_hw, &clk_mux_ro_ops, div_hw,
224231
&clk_divider_ro_ops, NULL, NULL, flags);
225-
} else if (!mcore_booted) {
232+
} else {
226233
gate = kzalloc(sizeof(*gate), GFP_KERNEL);
227234
if (!gate)
228235
goto fail;
@@ -238,12 +245,6 @@ struct clk_hw *imx93_clk_composite_flags(const char *name, const char * const *p
238245
&imx93_clk_composite_divider_ops, gate_hw,
239246
&imx93_clk_composite_gate_ops,
240247
flags | CLK_SET_RATE_NO_REPARENT);
241-
} else {
242-
hw = clk_hw_register_composite(NULL, name, parent_names, num_parents,
243-
mux_hw, &imx93_clk_composite_mux_ops, div_hw,
244-
&imx93_clk_composite_divider_ops, NULL,
245-
&imx93_clk_composite_gate_ops,
246-
flags | CLK_SET_RATE_NO_REPARENT);
247248
}
248249

249250
if (IS_ERR(hw))

drivers/clk/imx/clk-fracn-gppll.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ struct clk_fracn_gppll {
7878
* The Fvco should be in range 2.5Ghz to 5Ghz
7979
*/
8080
static const struct imx_fracn_gppll_rate_table fracn_tbl[] = {
81+
PLL_FRACN_GP(1039500000U, 173, 25, 100, 1, 4),
8182
PLL_FRACN_GP(650000000U, 162, 50, 100, 0, 6),
8283
PLL_FRACN_GP(594000000U, 198, 0, 1, 0, 8),
8384
PLL_FRACN_GP(560000000U, 140, 0, 1, 0, 6),
@@ -106,6 +107,7 @@ static const struct imx_fracn_gppll_rate_table int_tbl[] = {
106107
PLL_FRACN_GP_INTEGER(1700000000U, 141, 1, 2),
107108
PLL_FRACN_GP_INTEGER(1400000000U, 175, 1, 3),
108109
PLL_FRACN_GP_INTEGER(900000000U, 150, 1, 4),
110+
PLL_FRACN_GP_INTEGER(800000000U, 200, 1, 6),
109111
};
110112

111113
struct imx_fracn_gppll_clk imx_fracn_gppll_integer = {
@@ -291,6 +293,10 @@ static int clk_fracn_gppll_prepare(struct clk_hw *hw)
291293
if (val & POWERUP_MASK)
292294
return 0;
293295

296+
if (pll->flags & CLK_FRACN_GPPLL_FRACN)
297+
writel_relaxed(readl_relaxed(pll->base + PLL_NUMERATOR),
298+
pll->base + PLL_NUMERATOR);
299+
294300
val |= CLKMUX_BYPASS;
295301
writel_relaxed(val, pll->base + PLL_CTRL);
296302

drivers/clk/imx/clk-imx6ul.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,8 +542,8 @@ static void __init imx6ul_clocks_init(struct device_node *ccm_node)
542542

543543
clk_set_parent(hws[IMX6UL_CLK_ENFC_SEL]->clk, hws[IMX6UL_CLK_PLL2_PFD2]->clk);
544544

545-
clk_set_parent(hws[IMX6UL_CLK_ENET1_REF_SEL]->clk, hws[IMX6UL_CLK_ENET_REF]->clk);
546-
clk_set_parent(hws[IMX6UL_CLK_ENET2_REF_SEL]->clk, hws[IMX6UL_CLK_ENET2_REF]->clk);
545+
clk_set_parent(hws[IMX6UL_CLK_ENET1_REF_SEL]->clk, hws[IMX6UL_CLK_ENET1_REF_125M]->clk);
546+
clk_set_parent(hws[IMX6UL_CLK_ENET2_REF_SEL]->clk, hws[IMX6UL_CLK_ENET2_REF_125M]->clk);
547547

548548
imx_register_uart_clocks();
549549
}

drivers/clk/imx/clk-imx7d.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,14 +498,14 @@ static void __init imx7d_clocks_init(struct device_node *ccm_node)
498498
hws[IMX7D_ENET_AXI_ROOT_SRC] = imx_clk_hw_mux2_flags("enet_axi_src", base + 0x8900, 24, 3, enet_axi_sel, ARRAY_SIZE(enet_axi_sel), CLK_SET_PARENT_GATE);
499499
hws[IMX7D_NAND_USDHC_BUS_ROOT_SRC] = imx_clk_hw_mux2_flags("nand_usdhc_src", base + 0x8980, 24, 3, nand_usdhc_bus_sel, ARRAY_SIZE(nand_usdhc_bus_sel), CLK_SET_PARENT_GATE);
500500
hws[IMX7D_DRAM_PHYM_ROOT_SRC] = imx_clk_hw_mux2_flags("dram_phym_src", base + 0x9800, 24, 1, dram_phym_sel, ARRAY_SIZE(dram_phym_sel), CLK_SET_PARENT_GATE);
501-
hws[IMX7D_DRAM_ROOT_SRC] = imx_clk_hw_mux2_flags("dram_src", base + 0x9880, 24, 1, dram_sel, ARRAY_SIZE(dram_sel), CLK_SET_PARENT_GATE);
501+
hws[IMX7D_DRAM_ROOT_SRC] = imx_clk_hw_mux2("dram_src", base + 0x9880, 24, 1, dram_sel, ARRAY_SIZE(dram_sel));
502502
hws[IMX7D_DRAM_PHYM_ALT_ROOT_SRC] = imx_clk_hw_mux2_flags("dram_phym_alt_src", base + 0xa000, 24, 3, dram_phym_alt_sel, ARRAY_SIZE(dram_phym_alt_sel), CLK_SET_PARENT_GATE);
503-
hws[IMX7D_DRAM_ALT_ROOT_SRC] = imx_clk_hw_mux2_flags("dram_alt_src", base + 0xa080, 24, 3, dram_alt_sel, ARRAY_SIZE(dram_alt_sel), CLK_SET_PARENT_GATE);
503+
hws[IMX7D_DRAM_ALT_ROOT_SRC] = imx_clk_hw_mux2("dram_alt_src", base + 0xa080, 24, 3, dram_alt_sel, ARRAY_SIZE(dram_alt_sel));
504504
hws[IMX7D_USB_HSIC_ROOT_SRC] = imx_clk_hw_mux2_flags("usb_hsic_src", base + 0xa100, 24, 3, usb_hsic_sel, ARRAY_SIZE(usb_hsic_sel), CLK_SET_PARENT_GATE);
505505
hws[IMX7D_PCIE_CTRL_ROOT_SRC] = imx_clk_hw_mux2_flags("pcie_ctrl_src", base + 0xa180, 24, 3, pcie_ctrl_sel, ARRAY_SIZE(pcie_ctrl_sel), CLK_SET_PARENT_GATE);
506506
hws[IMX7D_PCIE_PHY_ROOT_SRC] = imx_clk_hw_mux2_flags("pcie_phy_src", base + 0xa200, 24, 3, pcie_phy_sel, ARRAY_SIZE(pcie_phy_sel), CLK_SET_PARENT_GATE);
507507
hws[IMX7D_EPDC_PIXEL_ROOT_SRC] = imx_clk_hw_mux2_flags("epdc_pixel_src", base + 0xa280, 24, 3, epdc_pixel_sel, ARRAY_SIZE(epdc_pixel_sel), CLK_SET_PARENT_GATE);
508-
hws[IMX7D_LCDIF_PIXEL_ROOT_SRC] = imx_clk_hw_mux2_flags("lcdif_pixel_src", base + 0xa300, 24, 3, lcdif_pixel_sel, ARRAY_SIZE(lcdif_pixel_sel), CLK_SET_PARENT_GATE);
508+
hws[IMX7D_LCDIF_PIXEL_ROOT_SRC] = imx_clk_hw_mux2_flags("lcdif_pixel_src", base + 0xa300, 24, 3, lcdif_pixel_sel, ARRAY_SIZE(lcdif_pixel_sel), CLK_SET_PARENT_GATE | CLK_SET_RATE_PARENT);
509509
hws[IMX7D_MIPI_DSI_ROOT_SRC] = imx_clk_hw_mux2_flags("mipi_dsi_src", base + 0xa380, 24, 3, mipi_dsi_sel, ARRAY_SIZE(mipi_dsi_sel), CLK_SET_PARENT_GATE);
510510
hws[IMX7D_MIPI_CSI_ROOT_SRC] = imx_clk_hw_mux2_flags("mipi_csi_src", base + 0xa400, 24, 3, mipi_csi_sel, ARRAY_SIZE(mipi_csi_sel), CLK_SET_PARENT_GATE);
511511
hws[IMX7D_MIPI_DPHY_ROOT_SRC] = imx_clk_hw_mux2_flags("mipi_dphy_src", base + 0xa480, 24, 3, mipi_dphy_sel, ARRAY_SIZE(mipi_dphy_sel), CLK_SET_PARENT_GATE);

drivers/clk/imx/clk-imx8mm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ static int imx8mm_clocks_probe(struct platform_device *pdev)
432432
/* BUS */
433433
hws[IMX8MM_CLK_MAIN_AXI] = imx8m_clk_hw_composite_bus_critical("main_axi", imx8mm_main_axi_sels, base + 0x8800);
434434
hws[IMX8MM_CLK_ENET_AXI] = imx8m_clk_hw_composite_bus("enet_axi", imx8mm_enet_axi_sels, base + 0x8880);
435-
hws[IMX8MM_CLK_NAND_USDHC_BUS] = imx8m_clk_hw_composite_bus_critical("nand_usdhc_bus", imx8mm_nand_usdhc_sels, base + 0x8900);
435+
hws[IMX8MM_CLK_NAND_USDHC_BUS] = imx8m_clk_hw_composite("nand_usdhc_bus", imx8mm_nand_usdhc_sels, base + 0x8900);
436436
hws[IMX8MM_CLK_VPU_BUS] = imx8m_clk_hw_composite_bus("vpu_bus", imx8mm_vpu_bus_sels, base + 0x8980);
437437
hws[IMX8MM_CLK_DISP_AXI] = imx8m_clk_hw_composite_bus("disp_axi", imx8mm_disp_axi_sels, base + 0x8a00);
438438
hws[IMX8MM_CLK_DISP_APB] = imx8m_clk_hw_composite_bus("disp_apb", imx8mm_disp_apb_sels, base + 0x8a80);

drivers/clk/imx/clk-imx8mn.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,7 @@ static int imx8mn_clocks_probe(struct platform_device *pdev)
583583
hws[IMX8MN_CLK_SDMA2_ROOT] = imx_clk_hw_gate4("sdma2_clk", "ipg_audio_root", base + 0x43b0, 0);
584584
hws[IMX8MN_CLK_SDMA3_ROOT] = imx_clk_hw_gate4("sdma3_clk", "ipg_audio_root", base + 0x45f0, 0);
585585
hws[IMX8MN_CLK_SAI7_ROOT] = imx_clk_hw_gate2_shared2("sai7_root_clk", "sai7", base + 0x4650, 0, &share_count_sai7);
586+
hws[IMX8MN_CLK_SAI7_IPG] = imx_clk_hw_gate2_shared2("sai7_ipg_clk", "ipg_audio_root", base + 0x4650, 0, &share_count_sai7);
586587

587588
hws[IMX8MN_CLK_GPT_3M] = imx_clk_hw_fixed_factor("gpt_3m", "osc_24m", 1, 8);
588589

0 commit comments

Comments
 (0)