After commit f53947456f98 ("ARM: clk: imx: update pllv3 to support imx7"),
the former used BM_PLL_POWER bit is not correct anymore for IMX7 ENET.
Instead, pll->powerdown holds the correct bit, so using powerdown bit
in clk_pllv3_{prepare | unprepare} functions.
Fixes: f53947456f98 ("ARM: clk: imx: update pllv3 to support imx7")
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
drivers/clk/imx/clk-pllv3.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
From: Anson Huang <redacted>
DRAM root clk should be either from pll dram main clk
or dram alt root clk.
Signed-off-by: Anson Huang <redacted>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
drivers/clk/imx/clk-imx7d.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
pllx_bypass_src mux shouldn't be the parent of pllx clock
since it's only valid when when pllx BYPASS bit is set.
Thus it is actually one parent of pllx_bypass only.
Instead, pllx parent should be fixed to osc according to
reference manual.
Other plls have the same issue.
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
drivers/clk/imx/clk-imx6sx.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
pllx_bypass_src mux shouldn't be the parent of pllx clock
since it's only valid when when pllx BYPASS bit is set.
Thus it is actually one parent of pllx_bypass only.
Instead, pllx parent should be fixed to osc according to
reference manual.
Other plls have the same issue.
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
drivers/clk/imx/clk-imx6sl.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
pllx_bypass_src mux shouldn't be the parent of pllx clock
since it's only valid when when pllx BYPASS bit is set.
Thus it is actually one parent of pllx_bypass only.
Instead, pllx parent should be fixed to osc according to
reference manual.
Other plls have the same issue.
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
drivers/clk/imx/clk-imx6q.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
pllx_bypass_src mux shouldn't be the parent of pllx clock
since it's only valid when when pllx BYPASS bit is set.
Thus it is actually one parent of pllx_bypass only.
Instead, pllx parent should be fixed to osc according to
reference manual.
Other plls have the same issue.
e.g. before fix, the pll tree is:
osc 6 6 24000000 0 0
pll1_bypass_src 0 0 24000000 0 0
pll1 0 0 792000000 0 0
pll1_bypass 0 0 792000000 0 0
pll1_sys 0 0 792000000 0 0
After the fix, it's:
osc 6 6 24000000 0 0
pll1 0 0 792000000 0 0
pll1_bypass 0 0 792000000 0 0
pll1_sys 0 0 792000000 0 0
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
drivers/clk/imx/clk-imx6ul.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
There's a powerdown bit already, so let's change the name of
powerup_set bit to power_invert to reflects the power polarity
to make it less confusing.
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
drivers/clk/imx/clk-pllv3.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
@@ -55,7 +55,7 @@ static int clk_pllv3_wait_lock(struct clk_pllv3 *pll)u32val=readl_relaxed(pll->base)&pll->powerdown;/* No need to wait for lock when pll is not powered up */-if((pll->powerup_set&&!val)||(!pll->powerup_set&&val))+if((pll->power_invert&&!val)||(!pll->power_invert&&val))return0;/* Wait for PLL to lock */
@@ -76,7 +76,7 @@ static int clk_pllv3_prepare(struct clk_hw *hw)u32val;val=readl_relaxed(pll->base);-if(pll->powerup_set)+if(pll->power_invert)val|=pll->powerdown;elseval&=~pll->powerdown;
From: Anson Huang <redacted>
The audio/video PLL's rate calculation is as below in RM:
Fref * (DIV_SELECT + NUM / DENOM), in origin clk-pllv3's
code, below code is used:
(parent_rate * div) + ((parent_rate / mfd) * mfn
as it does NOT consider the float data using div, so below
formula should be used as a decent method:
(parent_rate * div) + ((parent_rate * mfn) / mfd)
and we also need to consider parent_rate * mfd may overflow
a 32 bit value, 64 bit value should be used.
After updating this formula, the dram PLL's rate is
1066MHz, which is correct, while the old formula gets
1056MHz.
[Aisheng: fix clk_pllv3_av_round_rate too]
Signed-off-by: Anson Huang <redacted>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
drivers/clk/imx/clk-pllv3.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
pllx_bypass_src mux shouldn't be the parent of pllx clock
since it's only valid when when pllx BYPASS bit is set.
Thus it is actually one parent of pllx_bypass only.
Instead, pllx parent should be fixed to osc according to
reference manual.
Other plls have the same issue.
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
drivers/clk/imx/clk-imx7d.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
From: Anson Huang <redacted>
DRAM PLL is a audio/video type PLL, need to correct
it to get correct ops of PLL.
Signed-off-by: Anson Huang <redacted>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
drivers/clk/imx/clk-imx7d.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Hi,
On Wed, 8 Jun 2016 22:33:34 +0800 Dong Aisheng wrote:
quoted hunk
There's a powerdown bit already, so let's change the name of
powerup_set bit to power_invert to reflects the power polarity
to make it less confusing.
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
drivers/clk/imx/clk-pllv3.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
On Wed, Jun 08, 2016 at 10:33:31PM +0800, Dong Aisheng wrote:
From: Anson Huang <redacted>
The audio/video PLL's rate calculation is as below in RM:
Fref * (DIV_SELECT + NUM / DENOM), in origin clk-pllv3's
code, below code is used:
(parent_rate * div) + ((parent_rate / mfd) * mfn
as it does NOT consider the float data using div, so below
formula should be used as a decent method:
(parent_rate * div) + ((parent_rate * mfn) / mfd)
and we also need to consider parent_rate * mfd may overflow
a 32 bit value, 64 bit value should be used.
After updating this formula, the dram PLL's rate is
1066MHz, which is correct, while the old formula gets
1056MHz.
[Aisheng: fix clk_pllv3_av_round_rate too]
Signed-off-by: Anson Huang <redacted>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
On Wed, Jun 08, 2016 at 10:33:32PM +0800, Dong Aisheng wrote:
From: Anson Huang <redacted>
DRAM root clk should be either from pll dram main clk
or dram alt root clk.
Signed-off-by: Anson Huang <redacted>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
On Wed, Jun 08, 2016 at 10:33:33PM +0800, Dong Aisheng wrote:
From: Anson Huang <redacted>
DRAM PLL is a audio/video type PLL, need to correct
it to get correct ops of PLL.
Signed-off-by: Anson Huang <redacted>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
'clk: imx7d: ' for patch prefix would be more clear. Updated it and
applied the patch.
Shawn
--
1.9.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
On Wed, Jun 08, 2016 at 10:33:34PM +0800, Dong Aisheng wrote:
quoted hunk
There's a powerdown bit already, so let's change the name of
powerup_set bit to power_invert to reflects the power polarity
to make it less confusing.
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
drivers/clk/imx/clk-pllv3.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
@@ -55,7 +55,7 @@ static int clk_pllv3_wait_lock(struct clk_pllv3 *pll) u32 val = readl_relaxed(pll->base) & pll->powerdown; /* No need to wait for lock when pll is not powered up */- if ((pll->powerup_set && !val) || (!pll->powerup_set && val))+ if ((pll->power_invert && !val) || (!pll->power_invert && val)) return 0; /* Wait for PLL to lock */
@@ -76,7 +76,7 @@ static int clk_pllv3_prepare(struct clk_hw *hw) u32 val; val = readl_relaxed(pll->base);- if (pll->powerup_set)+ if (pll->power_invert) val |= pll->powerdown; else val &= ~pll->powerdown;
@@ -91,7 +91,7 @@ static void clk_pllv3_unprepare(struct clk_hw *hw) u32 val; val = readl_relaxed(pll->base);- if (pll->powerup_set)+ if (pll->power_invert) val &= ~pll->powerdown; else val |= pll->powerdown;
--
1.9.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
On Wed, Jun 08, 2016 at 10:33:36PM +0800, Dong Aisheng wrote:
pllx_bypass_src mux shouldn't be the parent of pllx clock
since it's only valid when when pllx BYPASS bit is set.
Thus it is actually one parent of pllx_bypass only.
Instead, pllx parent should be fixed to osc according to
reference manual.
Other plls have the same issue.
e.g. before fix, the pll tree is:
osc 6 6 24000000 0 0
pll1_bypass_src 0 0 24000000 0 0
pll1 0 0 792000000 0 0
pll1_bypass 0 0 792000000 0 0
pll1_sys 0 0 792000000 0 0
After the fix, it's:
osc 6 6 24000000 0 0
pll1 0 0 792000000 0 0
pll1_bypass 0 0 792000000 0 0
pll1_sys 0 0 792000000 0 0
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
I squashed 7 ~ 11 into one patch and applied it, thanks.
Shawn
Hi Shawn,
On Sun, Jun 12, 2016 at 07:36:27PM +0800, Shawn Guo wrote:
On Wed, Jun 08, 2016 at 10:33:34PM +0800, Dong Aisheng wrote:
quoted
There's a powerdown bit already, so let's change the name of
powerup_set bit to power_invert to reflects the power polarity
to make it less confusing.
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
drivers/clk/imx/clk-pllv3.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
I think 'powerdown' is more confusing here. I prefer to rename it to
something like 'power_mask' and keep 'powerdown' as it is.
A bit confused, you mean rename which one?
powerdown bit is defined by the spec so i just keep it.
Since *invert is wildly used in gpio subsystem, so i
change the powerup_set to power_invert to indicate the invert using
of powerdown bit.
Regards
Dong Aisheng
Shawn
quoted
+ * @power_invert: set powerdown bit to power up the PLL
* @div_mask: mask of divider bits
* @div_shift: shift of divider bits
*
@@ -55,7 +55,7 @@ static int clk_pllv3_wait_lock(struct clk_pllv3 *pll) u32 val = readl_relaxed(pll->base) & pll->powerdown; /* No need to wait for lock when pll is not powered up */- if ((pll->powerup_set && !val) || (!pll->powerup_set && val))+ if ((pll->power_invert && !val) || (!pll->power_invert && val)) return 0; /* Wait for PLL to lock */
@@ -76,7 +76,7 @@ static int clk_pllv3_prepare(struct clk_hw *hw) u32 val; val = readl_relaxed(pll->base);- if (pll->powerup_set)+ if (pll->power_invert) val |= pll->powerdown; else val &= ~pll->powerdown;
@@ -91,7 +91,7 @@ static void clk_pllv3_unprepare(struct clk_hw *hw) u32 val; val = readl_relaxed(pll->base);- if (pll->powerup_set)+ if (pll->power_invert) val &= ~pll->powerdown; else val |= pll->powerdown;
--
1.9.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
--
To unsubscribe from this list: send the line "unsubscribe linux-clk" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
On Sun, Jun 12, 2016 at 07:43:53PM +0800, Shawn Guo wrote:
On Wed, Jun 08, 2016 at 10:33:36PM +0800, Dong Aisheng wrote:
quoted
pllx_bypass_src mux shouldn't be the parent of pllx clock
since it's only valid when when pllx BYPASS bit is set.
Thus it is actually one parent of pllx_bypass only.
Instead, pllx parent should be fixed to osc according to
reference manual.
Other plls have the same issue.
e.g. before fix, the pll tree is:
osc 6 6 24000000 0 0
pll1_bypass_src 0 0 24000000 0 0
pll1 0 0 792000000 0 0
pll1_bypass 0 0 792000000 0 0
pll1_sys 0 0 792000000 0 0
After the fix, it's:
osc 6 6 24000000 0 0
pll1 0 0 792000000 0 0
pll1_bypass 0 0 792000000 0 0
pll1_sys 0 0 792000000 0 0
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
I squashed 7 ~ 11 into one patch and applied it, thanks.
I'm fine.
Thanks
Regards
Dong Aisheng
Shawn
--
To unsubscribe from this list: send the line "unsubscribe linux-clk" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Yes, sorry the careless.
Will resend it.
Regards
Dong Aisheng
Shawn
quoted
clks[IMX6UL_CLK_UART2_IPG] = imx_clk_gate2("uart2_ipg", "ipg", base + 0x68, 28);
clks[IMX6UL_CLK_UART2_SERIAL] = imx_clk_gate2("uart2_serial", "uart_podf", base + 0x68, 28);
clks[IMX6UL_CLK_AIPSTZ3] = imx_clk_gate2("aips_tz3", "ahb", base + 0x68, 30);
--
1.9.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
--
To unsubscribe from this list: send the line "unsubscribe linux-clk" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
On Thu, Jun 09, 2016 at 09:43:28AM +0200, Lothar Wa??mann wrote:
Hi,
On Wed, 8 Jun 2016 22:33:34 +0800 Dong Aisheng wrote:
quoted
There's a powerdown bit already, so let's change the name of
powerup_set bit to power_invert to reflects the power polarity
to make it less confusing.
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
drivers/clk/imx/clk-pllv3.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
It is set.
By default set the powerdown bit will powerdown the PLL according
to spec.
However, for IMX_PLLV3_USB, it's actually power up the PLL,
so the power_invert reflect such using.
Regards
Dong Aisheng
On Sun, Jun 12, 2016 at 07:36:27PM +0800, Shawn Guo wrote:
On Wed, Jun 08, 2016 at 10:33:34PM +0800, Dong Aisheng wrote:
quoted
There's a powerdown bit already, so let's change the name of
powerup_set bit to power_invert to reflects the power polarity
to make it less confusing.
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
drivers/clk/imx/clk-pllv3.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
I think 'powerdown' is more confusing here. I prefer to rename it to
something like 'power_mask' and keep 'powerdown' as it is.
I understand your point.
How about using power_bit and powerup_set?
* @power_bit: pll power bit offset
* @powerup_set: set power_bit to power up the PLL
Regards
Dong Aisheng
Shawn
quoted
+ * @power_invert: set powerdown bit to power up the PLL
* @div_mask: mask of divider bits
* @div_shift: shift of divider bits
*
@@ -55,7 +55,7 @@ static int clk_pllv3_wait_lock(struct clk_pllv3 *pll) u32 val = readl_relaxed(pll->base) & pll->powerdown; /* No need to wait for lock when pll is not powered up */- if ((pll->powerup_set && !val) || (!pll->powerup_set && val))+ if ((pll->power_invert && !val) || (!pll->power_invert && val)) return 0; /* Wait for PLL to lock */
@@ -76,7 +76,7 @@ static int clk_pllv3_prepare(struct clk_hw *hw) u32 val; val = readl_relaxed(pll->base);- if (pll->powerup_set)+ if (pll->power_invert) val |= pll->powerdown; else val &= ~pll->powerdown;
@@ -91,7 +91,7 @@ static void clk_pllv3_unprepare(struct clk_hw *hw) u32 val; val = readl_relaxed(pll->base);- if (pll->powerup_set)+ if (pll->power_invert) val &= ~pll->powerdown; else val |= pll->powerdown;
--
1.9.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
--
To unsubscribe from this list: send the line "unsubscribe linux-clk" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
On Sun, Jun 12, 2016 at 07:52:04PM +0800, Dong Aisheng wrote:
On Sun, Jun 12, 2016 at 07:43:53PM +0800, Shawn Guo wrote:
quoted
On Wed, Jun 08, 2016 at 10:33:36PM +0800, Dong Aisheng wrote:
quoted
pllx_bypass_src mux shouldn't be the parent of pllx clock
since it's only valid when when pllx BYPASS bit is set.
Thus it is actually one parent of pllx_bypass only.
Instead, pllx parent should be fixed to osc according to
reference manual.
Other plls have the same issue.
e.g. before fix, the pll tree is:
osc 6 6 24000000 0 0
pll1_bypass_src 0 0 24000000 0 0
pll1 0 0 792000000 0 0
pll1_bypass 0 0 792000000 0 0
pll1_sys 0 0 792000000 0 0
After the fix, it's:
osc 6 6 24000000 0 0
pll1 0 0 792000000 0 0
pll1_bypass 0 0 792000000 0 0
pll1_sys 0 0 792000000 0 0
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
I squashed 7 ~ 11 into one patch and applied it, thanks.
I'm fine.
Thanks
You probably may need to change the patch title after merge.
clk: imx: fix pll clock parents
Regards
Dong Aisheng
Regards
Dong Aisheng
quoted
Shawn
--
To unsubscribe from this list: send the line "unsubscribe linux-clk" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Shawn,
On Wed, Jun 8, 2016 at 10:33 PM, Dong Aisheng [off-list ref] wrote:
After commit f53947456f98 ("ARM: clk: imx: update pllv3 to support imx7"),
the former used BM_PLL_POWER bit is not correct anymore for IMX7 ENET.
Instead, pll->powerdown holds the correct bit, so using powerdown bit
in clk_pllv3_{prepare | unprepare} functions.
Fixes: f53947456f98 ("ARM: clk: imx: update pllv3 to support imx7")
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
On Sun, Jun 12, 2016 at 10:56:38PM +0800, Dong Aisheng wrote:
Hi Shawn,
On Wed, Jun 8, 2016 at 10:33 PM, Dong Aisheng [off-list ref] wrote:
quoted
After commit f53947456f98 ("ARM: clk: imx: update pllv3 to support imx7"),
the former used BM_PLL_POWER bit is not correct anymore for IMX7 ENET.
Instead, pll->powerdown holds the correct bit, so using powerdown bit
in clk_pllv3_{prepare | unprepare} functions.
Fixes: f53947456f98 ("ARM: clk: imx: update pllv3 to support imx7")
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Any comments about this one?
Sorry. I thought I had applied it. Applied it now, thanks.
Shawn
The powerdown bit is a bit confused, let's change it to power_bit
to relfect both powerdown and powerup case according to different
plls.
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
drivers/clk/imx/clk-pllv3.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
@@ -52,7 +52,7 @@ struct clk_pllv3 {staticintclk_pllv3_wait_lock(structclk_pllv3*pll){unsignedlongtimeout=jiffies+msecs_to_jiffies(10);-u32val=readl_relaxed(pll->base)&pll->powerdown;+u32val=readl_relaxed(pll->base)&pll->power_bit;/* No need to wait for lock when pll is not powered up */if((pll->powerup_set&&!val)||(!pll->powerup_set&&val))
@@ -77,7 +77,7 @@ static int clk_pllv3_prepare(struct clk_hw *hw)val=readl_relaxed(pll->base);if(pll->powerup_set)-val|=pll->powerdown;+val|=pll->power_bit;elseval&=~pll->powerdown;writel_relaxed(val,pll->base);
The powerdown bit is a bit confused, let's change it to power_bit
to relfect both powerdown and powerup case according to different
plls.
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
Changes from v2:
Sorry for sending the patch too quickly.
There's a rebase error in V2, fixed it.
---
drivers/clk/imx/clk-pllv3.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
@@ -52,7 +52,7 @@ struct clk_pllv3 {staticintclk_pllv3_wait_lock(structclk_pllv3*pll){unsignedlongtimeout=jiffies+msecs_to_jiffies(10);-u32val=readl_relaxed(pll->base)&pll->powerdown;+u32val=readl_relaxed(pll->base)&pll->power_bit;/* No need to wait for lock when pll is not powered up */if((pll->powerup_set&&!val)||(!pll->powerup_set&&val))
@@ -77,9 +77,9 @@ static int clk_pllv3_prepare(struct clk_hw *hw)val=readl_relaxed(pll->base);if(pll->powerup_set)-val|=pll->powerdown;+val|=pll->power_bit;else-val&=~pll->powerdown;+val&=~pll->power_bit;writel_relaxed(val,pll->base);returnclk_pllv3_wait_lock(pll);
On Mon, Jun 13, 2016 at 08:24:52PM +0800, Dong Aisheng wrote:
The powerdown bit is a bit confused, let's change it to power_bit
to relfect both powerdown and powerup case according to different
plls.
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>