All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] clk: tegra30: init PLL_C to sane rate
@ 2016-02-29 20:46 ` Lucas Stach
  0 siblings, 0 replies; 9+ messages in thread
From: Lucas Stach @ 2016-02-29 20:46 UTC (permalink / raw)
  To: Peter De Schrijver, Prashant Gaikwad
  Cc: Michael Turquette, Stephen Boyd, Stephen Warren, Thierry Reding,
	Alexandre Courbot, linux-clk-u79uwXL29TY76Z2rM5mHXA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA

If the bootloader does not touch PLL_C it will stay in its reset
state, failing to lock when enabled. This leads to consumers of
this clock to fail probing. Fix this by always programming the
PLL with a sane rate, which allows it to lock, at startup.

Signed-off-by: Lucas Stach <dev-8ppwABl0HbeELgA04lAiVw@public.gmane.org>
---
 drivers/clk/tegra/clk-tegra30.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/tegra/clk-tegra30.c b/drivers/clk/tegra/clk-tegra30.c
index 0478565..236e2db 100644
--- a/drivers/clk/tegra/clk-tegra30.c
+++ b/drivers/clk/tegra/clk-tegra30.c
@@ -1372,6 +1372,7 @@ static struct tegra_clk_init_table init_table[] __initdata = {
 	{ TEGRA30_CLK_SBC4, TEGRA30_CLK_PLL_P, 100000000, 0 },
 	{ TEGRA30_CLK_SBC5, TEGRA30_CLK_PLL_P, 100000000, 0 },
 	{ TEGRA30_CLK_SBC6, TEGRA30_CLK_PLL_P, 100000000, 0 },
+	{ TEGRA30_CLK_PLL_C, TEGRA30_CLK_CLK_MAX, 600000000, 0 },
 	{ TEGRA30_CLK_HOST1X, TEGRA30_CLK_PLL_C, 150000000, 0 },
 	{ TEGRA30_CLK_DISP1, TEGRA30_CLK_PLL_P, 600000000, 0 },
 	{ TEGRA30_CLK_DISP2, TEGRA30_CLK_PLL_P, 600000000, 0 },
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 1/2] clk: tegra30: init PLL_C to sane rate
@ 2016-02-29 20:46 ` Lucas Stach
  0 siblings, 0 replies; 9+ messages in thread
From: Lucas Stach @ 2016-02-29 20:46 UTC (permalink / raw)
  To: Peter De Schrijver, Prashant Gaikwad
  Cc: Michael Turquette, Stephen Boyd, Stephen Warren, Thierry Reding,
	Alexandre Courbot, linux-clk, linux-tegra

If the bootloader does not touch PLL_C it will stay in its reset
state, failing to lock when enabled. This leads to consumers of
this clock to fail probing. Fix this by always programming the
PLL with a sane rate, which allows it to lock, at startup.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
 drivers/clk/tegra/clk-tegra30.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/tegra/clk-tegra30.c b/drivers/clk/tegra/clk-tegra30.c
index 0478565..236e2db 100644
--- a/drivers/clk/tegra/clk-tegra30.c
+++ b/drivers/clk/tegra/clk-tegra30.c
@@ -1372,6 +1372,7 @@ static struct tegra_clk_init_table init_table[] __initdata = {
 	{ TEGRA30_CLK_SBC4, TEGRA30_CLK_PLL_P, 100000000, 0 },
 	{ TEGRA30_CLK_SBC5, TEGRA30_CLK_PLL_P, 100000000, 0 },
 	{ TEGRA30_CLK_SBC6, TEGRA30_CLK_PLL_P, 100000000, 0 },
+	{ TEGRA30_CLK_PLL_C, TEGRA30_CLK_CLK_MAX, 600000000, 0 },
 	{ TEGRA30_CLK_HOST1X, TEGRA30_CLK_PLL_C, 150000000, 0 },
 	{ TEGRA30_CLK_DISP1, TEGRA30_CLK_PLL_P, 600000000, 0 },
 	{ TEGRA30_CLK_DISP2, TEGRA30_CLK_PLL_P, 600000000, 0 },
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/2] clk: tegra30: fix PLL_U post divider and init rate
  2016-02-29 20:46 ` Lucas Stach
@ 2016-02-29 20:46     ` Lucas Stach
  -1 siblings, 0 replies; 9+ messages in thread
From: Lucas Stach @ 2016-02-29 20:46 UTC (permalink / raw)
  To: Peter De Schrijver, Prashant Gaikwad
  Cc: Michael Turquette, Stephen Boyd, Stephen Warren, Thierry Reding,
	Alexandre Courbot, linux-clk-u79uwXL29TY76Z2rM5mHXA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA

The post divider value in the frequency table is wrong as it
would lead to the PLL producing a output rate of 960MHz instead
of the desired 480MHz. This wasn't a problem as nothing used the
table to actually init the PLL rate, but the bootloader
configuration was used unaltered.

If the bootloader does not set up the PLL it will fail to come
when used under Linux. To fix this don't rely on the bootloader,
but set the correct rate in the clock driver.

Signed-off-by: Lucas Stach <dev-8ppwABl0HbeELgA04lAiVw@public.gmane.org>
---
 drivers/clk/tegra/clk-tegra30.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/tegra/clk-tegra30.c b/drivers/clk/tegra/clk-tegra30.c
index 236e2db..9396f49 100644
--- a/drivers/clk/tegra/clk-tegra30.c
+++ b/drivers/clk/tegra/clk-tegra30.c
@@ -339,11 +339,11 @@ static const struct pdiv_map pllu_p[] = {
 };
 
 static struct tegra_clk_pll_freq_table pll_u_freq_table[] = {
-	{ 12000000, 480000000, 960, 12, 1, 12 },
-	{ 13000000, 480000000, 960, 13, 1, 12 },
-	{ 16800000, 480000000, 400,  7, 1,  5 },
-	{ 19200000, 480000000, 200,  4, 1,  3 },
-	{ 26000000, 480000000, 960, 26, 1, 12 },
+	{ 12000000, 480000000, 960, 12, 2, 12 },
+	{ 13000000, 480000000, 960, 13, 2, 12 },
+	{ 16800000, 480000000, 400,  7, 2,  5 },
+	{ 19200000, 480000000, 200,  4, 2,  3 },
+	{ 26000000, 480000000, 960, 26, 2, 12 },
 	{        0,         0,   0,  0, 0,  0 },
 };
 
@@ -1380,6 +1380,7 @@ static struct tegra_clk_init_table init_table[] __initdata = {
 	{ TEGRA30_CLK_GR2D, TEGRA30_CLK_PLL_C, 300000000, 0 },
 	{ TEGRA30_CLK_GR3D, TEGRA30_CLK_PLL_C, 300000000, 0 },
 	{ TEGRA30_CLK_GR3D2, TEGRA30_CLK_PLL_C, 300000000, 0 },
+	{ TEGRA30_CLK_PLL_U, TEGRA30_CLK_CLK_MAX, 480000000, 0 },
 	/* must be the last entry */
 	{ TEGRA30_CLK_CLK_MAX, TEGRA30_CLK_CLK_MAX, 0, 0 },
 };
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/2] clk: tegra30: fix PLL_U post divider and init rate
@ 2016-02-29 20:46     ` Lucas Stach
  0 siblings, 0 replies; 9+ messages in thread
From: Lucas Stach @ 2016-02-29 20:46 UTC (permalink / raw)
  To: Peter De Schrijver, Prashant Gaikwad
  Cc: Michael Turquette, Stephen Boyd, Stephen Warren, Thierry Reding,
	Alexandre Courbot, linux-clk, linux-tegra

The post divider value in the frequency table is wrong as it
would lead to the PLL producing a output rate of 960MHz instead
of the desired 480MHz. This wasn't a problem as nothing used the
table to actually init the PLL rate, but the bootloader
configuration was used unaltered.

If the bootloader does not set up the PLL it will fail to come
when used under Linux. To fix this don't rely on the bootloader,
but set the correct rate in the clock driver.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
 drivers/clk/tegra/clk-tegra30.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/tegra/clk-tegra30.c b/drivers/clk/tegra/clk-tegra30.c
index 236e2db..9396f49 100644
--- a/drivers/clk/tegra/clk-tegra30.c
+++ b/drivers/clk/tegra/clk-tegra30.c
@@ -339,11 +339,11 @@ static const struct pdiv_map pllu_p[] = {
 };
 
 static struct tegra_clk_pll_freq_table pll_u_freq_table[] = {
-	{ 12000000, 480000000, 960, 12, 1, 12 },
-	{ 13000000, 480000000, 960, 13, 1, 12 },
-	{ 16800000, 480000000, 400,  7, 1,  5 },
-	{ 19200000, 480000000, 200,  4, 1,  3 },
-	{ 26000000, 480000000, 960, 26, 1, 12 },
+	{ 12000000, 480000000, 960, 12, 2, 12 },
+	{ 13000000, 480000000, 960, 13, 2, 12 },
+	{ 16800000, 480000000, 400,  7, 2,  5 },
+	{ 19200000, 480000000, 200,  4, 2,  3 },
+	{ 26000000, 480000000, 960, 26, 2, 12 },
 	{        0,         0,   0,  0, 0,  0 },
 };
 
@@ -1380,6 +1380,7 @@ static struct tegra_clk_init_table init_table[] __initdata = {
 	{ TEGRA30_CLK_GR2D, TEGRA30_CLK_PLL_C, 300000000, 0 },
 	{ TEGRA30_CLK_GR3D, TEGRA30_CLK_PLL_C, 300000000, 0 },
 	{ TEGRA30_CLK_GR3D2, TEGRA30_CLK_PLL_C, 300000000, 0 },
+	{ TEGRA30_CLK_PLL_U, TEGRA30_CLK_CLK_MAX, 480000000, 0 },
 	/* must be the last entry */
 	{ TEGRA30_CLK_CLK_MAX, TEGRA30_CLK_CLK_MAX, 0, 0 },
 };
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] clk: tegra30: init PLL_C to sane rate
  2016-02-29 20:46 ` Lucas Stach
@ 2016-04-21 18:16     ` Lucas Stach
  -1 siblings, 0 replies; 9+ messages in thread
From: Lucas Stach @ 2016-04-21 18:16 UTC (permalink / raw)
  To: Peter De Schrijver, Prashant Gaikwad
  Cc: Michael Turquette, Stephen Boyd, Stephen Warren, Thierry Reding,
	Alexandre Courbot, linux-clk-u79uwXL29TY76Z2rM5mHXA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA

Am Montag, den 29.02.2016, 21:46 +0100 schrieb Lucas Stach:
> If the bootloader does not touch PLL_C it will stay in its reset
> state, failing to lock when enabled. This leads to consumers of
> this clock to fail probing. Fix this by always programming the
> PLL with a sane rate, which allows it to lock, at startup.
> 
Those 2 patches haven't been applied, as far as I can see. Any comments
on them?

> Signed-off-by: Lucas Stach <dev-8ppwABl0HbeELgA04lAiVw@public.gmane.org>
> ---
>  drivers/clk/tegra/clk-tegra30.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/clk/tegra/clk-tegra30.c b/drivers/clk/tegra/clk-
> tegra30.c
> index 0478565..236e2db 100644
> --- a/drivers/clk/tegra/clk-tegra30.c
> +++ b/drivers/clk/tegra/clk-tegra30.c
> @@ -1372,6 +1372,7 @@ static struct tegra_clk_init_table init_table[]
> __initdata = {
>  	{ TEGRA30_CLK_SBC4, TEGRA30_CLK_PLL_P, 100000000, 0 },
>  	{ TEGRA30_CLK_SBC5, TEGRA30_CLK_PLL_P, 100000000, 0 },
>  	{ TEGRA30_CLK_SBC6, TEGRA30_CLK_PLL_P, 100000000, 0 },
> +	{ TEGRA30_CLK_PLL_C, TEGRA30_CLK_CLK_MAX, 600000000, 0 },
>  	{ TEGRA30_CLK_HOST1X, TEGRA30_CLK_PLL_C, 150000000, 0 },
>  	{ TEGRA30_CLK_DISP1, TEGRA30_CLK_PLL_P, 600000000, 0 },
>  	{ TEGRA30_CLK_DISP2, TEGRA30_CLK_PLL_P, 600000000, 0 },

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] clk: tegra30: init PLL_C to sane rate
@ 2016-04-21 18:16     ` Lucas Stach
  0 siblings, 0 replies; 9+ messages in thread
From: Lucas Stach @ 2016-04-21 18:16 UTC (permalink / raw)
  To: Peter De Schrijver, Prashant Gaikwad
  Cc: Michael Turquette, Stephen Boyd, Stephen Warren, Thierry Reding,
	Alexandre Courbot, linux-clk, linux-tegra

Am Montag, den 29.02.2016, 21:46 +0100 schrieb Lucas Stach:
> If the bootloader does not touch PLL_C it will stay in its reset
> state, failing to lock when enabled. This leads to consumers of
> this clock to fail probing. Fix this by always programming the
> PLL with a sane rate, which allows it to lock, at startup.
> 
Those 2 patches haven't been applied, as far as I can see. Any comments
on them?

> Signed-off-by: Lucas Stach <dev@lynxeye.de>
> ---
>  drivers/clk/tegra/clk-tegra30.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/clk/tegra/clk-tegra30.c b/drivers/clk/tegra/clk-
> tegra30.c
> index 0478565..236e2db 100644
> --- a/drivers/clk/tegra/clk-tegra30.c
> +++ b/drivers/clk/tegra/clk-tegra30.c
> @@ -1372,6 +1372,7 @@ static struct tegra_clk_init_table init_table[]
> __initdata = {
>  	{ TEGRA30_CLK_SBC4, TEGRA30_CLK_PLL_P, 100000000, 0 },
>  	{ TEGRA30_CLK_SBC5, TEGRA30_CLK_PLL_P, 100000000, 0 },
>  	{ TEGRA30_CLK_SBC6, TEGRA30_CLK_PLL_P, 100000000, 0 },
> +	{ TEGRA30_CLK_PLL_C, TEGRA30_CLK_CLK_MAX, 600000000, 0 },
>  	{ TEGRA30_CLK_HOST1X, TEGRA30_CLK_PLL_C, 150000000, 0 },
>  	{ TEGRA30_CLK_DISP1, TEGRA30_CLK_PLL_P, 600000000, 0 },
>  	{ TEGRA30_CLK_DISP2, TEGRA30_CLK_PLL_P, 600000000, 0 },

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] clk: tegra30: init PLL_C to sane rate
  2016-02-29 20:46 ` Lucas Stach
  (?)
  (?)
@ 2016-04-22 11:52 ` Thierry Reding
  -1 siblings, 0 replies; 9+ messages in thread
From: Thierry Reding @ 2016-04-22 11:52 UTC (permalink / raw)
  To: Lucas Stach
  Cc: Peter De Schrijver, Prashant Gaikwad, Michael Turquette,
	Stephen Boyd, Stephen Warren, Alexandre Courbot, linux-clk,
	linux-tegra

[-- Attachment #1: Type: text/plain, Size: 491 bytes --]

On Mon, Feb 29, 2016 at 09:46:06PM +0100, Lucas Stach wrote:
> If the bootloader does not touch PLL_C it will stay in its reset
> state, failing to lock when enabled. This leads to consumers of
> this clock to fail probing. Fix this by always programming the
> PLL with a sane rate, which allows it to lock, at startup.
> 
> Signed-off-by: Lucas Stach <dev@lynxeye.de>
> ---
>  drivers/clk/tegra/clk-tegra30.c | 1 +
>  1 file changed, 1 insertion(+)

Applied, thanks.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] clk: tegra30: fix PLL_U post divider and init rate
  2016-02-29 20:46     ` Lucas Stach
@ 2016-04-22 11:53         ` Thierry Reding
  -1 siblings, 0 replies; 9+ messages in thread
From: Thierry Reding @ 2016-04-22 11:53 UTC (permalink / raw)
  To: Lucas Stach
  Cc: Peter De Schrijver, Prashant Gaikwad, Michael Turquette,
	Stephen Boyd, Stephen Warren, Alexandre Courbot,
	linux-clk-u79uwXL29TY76Z2rM5mHXA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 767 bytes --]

On Mon, Feb 29, 2016 at 09:46:07PM +0100, Lucas Stach wrote:
> The post divider value in the frequency table is wrong as it
> would lead to the PLL producing a output rate of 960MHz instead
> of the desired 480MHz. This wasn't a problem as nothing used the
> table to actually init the PLL rate, but the bootloader
> configuration was used unaltered.
> 
> If the bootloader does not set up the PLL it will fail to come
> when used under Linux. To fix this don't rely on the bootloader,
> but set the correct rate in the clock driver.
> 
> Signed-off-by: Lucas Stach <dev-8ppwABl0HbeELgA04lAiVw@public.gmane.org>
> ---
>  drivers/clk/tegra/clk-tegra30.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)

Applied, thanks.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] clk: tegra30: fix PLL_U post divider and init rate
@ 2016-04-22 11:53         ` Thierry Reding
  0 siblings, 0 replies; 9+ messages in thread
From: Thierry Reding @ 2016-04-22 11:53 UTC (permalink / raw)
  To: Lucas Stach
  Cc: Peter De Schrijver, Prashant Gaikwad, Michael Turquette,
	Stephen Boyd, Stephen Warren, Alexandre Courbot, linux-clk,
	linux-tegra

[-- Attachment #1: Type: text/plain, Size: 738 bytes --]

On Mon, Feb 29, 2016 at 09:46:07PM +0100, Lucas Stach wrote:
> The post divider value in the frequency table is wrong as it
> would lead to the PLL producing a output rate of 960MHz instead
> of the desired 480MHz. This wasn't a problem as nothing used the
> table to actually init the PLL rate, but the bootloader
> configuration was used unaltered.
> 
> If the bootloader does not set up the PLL it will fail to come
> when used under Linux. To fix this don't rely on the bootloader,
> but set the correct rate in the clock driver.
> 
> Signed-off-by: Lucas Stach <dev@lynxeye.de>
> ---
>  drivers/clk/tegra/clk-tegra30.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)

Applied, thanks.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-04-22 11:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-29 20:46 [PATCH 1/2] clk: tegra30: init PLL_C to sane rate Lucas Stach
2016-02-29 20:46 ` Lucas Stach
     [not found] ` <1456778767-18413-1-git-send-email-dev-8ppwABl0HbeELgA04lAiVw@public.gmane.org>
2016-02-29 20:46   ` [PATCH 2/2] clk: tegra30: fix PLL_U post divider and init rate Lucas Stach
2016-02-29 20:46     ` Lucas Stach
     [not found]     ` <1456778767-18413-2-git-send-email-dev-8ppwABl0HbeELgA04lAiVw@public.gmane.org>
2016-04-22 11:53       ` Thierry Reding
2016-04-22 11:53         ` Thierry Reding
2016-04-21 18:16   ` [PATCH 1/2] clk: tegra30: init PLL_C to sane rate Lucas Stach
2016-04-21 18:16     ` Lucas Stach
2016-04-22 11:52 ` Thierry Reding

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.