Skip to content

Commit f539474

Browse files
nxpfranklishawnguo2
authored andcommitted
ARM: clk: imx: update pllv3 to support imx7
Add type IMX_PLLV3_ENET_IMX7 Signed-off-by: Frank Li <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
1 parent d930d56 commit f539474

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

drivers/clk/imx/clk-pllv3.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@
2424

2525
#define BM_PLL_POWER (0x1 << 12)
2626
#define BM_PLL_LOCK (0x1 << 31)
27+
#define IMX7_ENET_PLL_POWER (0x1 << 5)
2728

2829
/**
2930
* struct clk_pllv3 - IMX PLL clock version 3
3031
* @clk_hw: clock source
3132
* @base: base address of PLL registers
3233
* @powerup_set: set POWER bit to power up the PLL
34+
* @powerdown: pll powerdown offset bit
3335
* @div_mask: mask of divider bits
3436
* @div_shift: shift of divider bits
3537
*
@@ -40,6 +42,7 @@ struct clk_pllv3 {
4042
struct clk_hw hw;
4143
void __iomem *base;
4244
bool powerup_set;
45+
u32 powerdown;
4346
u32 div_mask;
4447
u32 div_shift;
4548
};
@@ -49,7 +52,7 @@ struct clk_pllv3 {
4952
static int clk_pllv3_wait_lock(struct clk_pllv3 *pll)
5053
{
5154
unsigned long timeout = jiffies + msecs_to_jiffies(10);
52-
u32 val = readl_relaxed(pll->base) & BM_PLL_POWER;
55+
u32 val = readl_relaxed(pll->base) & pll->powerdown;
5356

5457
/* No need to wait for lock when pll is not powered up */
5558
if ((pll->powerup_set && !val) || (!pll->powerup_set && val))
@@ -293,6 +296,8 @@ struct clk *imx_clk_pllv3(enum imx_pllv3_type type, const char *name,
293296
if (!pll)
294297
return ERR_PTR(-ENOMEM);
295298

299+
pll->powerdown = BM_PLL_POWER;
300+
296301
switch (type) {
297302
case IMX_PLLV3_SYS:
298303
ops = &clk_pllv3_sys_ops;
@@ -306,6 +311,8 @@ struct clk *imx_clk_pllv3(enum imx_pllv3_type type, const char *name,
306311
case IMX_PLLV3_AV:
307312
ops = &clk_pllv3_av_ops;
308313
break;
314+
case IMX_PLLV3_ENET_IMX7:
315+
pll->powerdown = IMX7_ENET_PLL_POWER;
309316
case IMX_PLLV3_ENET:
310317
ops = &clk_pllv3_enet_ops;
311318
break;

drivers/clk/imx/clk.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ enum imx_pllv3_type {
3939
IMX_PLLV3_USB_VF610,
4040
IMX_PLLV3_AV,
4141
IMX_PLLV3_ENET,
42+
IMX_PLLV3_ENET_IMX7,
4243
};
4344

4445
struct clk *imx_clk_pllv3(enum imx_pllv3_type type, const char *name,

0 commit comments

Comments
 (0)