All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
To: "Terje Bergström" <tbergstrom-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Cc: Thierry Reding
	<thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>,
	"linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH 1/2] ARM: tegra: Add Tegra20 host1x support
Date: Wed, 14 Nov 2012 11:12:57 -0700	[thread overview]
Message-ID: <50A3DF29.1070806@wwwdotorg.org> (raw)
In-Reply-To: <50A3CAA3.2060908-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

On 11/14/2012 09:45 AM, Terje Bergström wrote:
> On 14.11.2012 18:19, Stephen Warren wrote:
>> I'd rather initialize it explicitly. If setting it to 216MHz works
>> fine as Terje indicated, we may as well just do that.
> 
> I'd prefer explicit setting, too.
> 
>> I suspect the issue with the original code:
>>
>>> { "host1x",     "pll_c",        144000000,      false },
>>
>> ... is that perhaps the requested 144MHz can't be generated from
>> pll_c's 600MHz rate, since there's a simple U7.1 divider there (you
>> could get 120, 133.333, 150), so the clock ends up being programmed to
>> some incorrect value. In the pll_p/216MHz case, pll_p is programmed to
>> generate 216MHz anyway, so requesting the same rate for host1x yields
>> a divider of 1 exactly which works fine.
> 
> I could try the values you proposed tomorrow when I get back to office.
> I believe we've always kept host1x under non-fractional dividers, so I'd
> like to try 150MHz on Ventana and 150MHz and 300MHz on Cardhu.
> 
> 600MHz sounds pretty high for PLLC on Tegra20. For Tegra30 it would be
> understandable. In internal kernel I believe we have lower rate for
> Tegra20 PLLC. Do we have anything running from PLLC in Tegra20 upstream
> kernel?

Yes, sclk/... appear to derive from it:

> 	{ "pll_c",	"clk_m",	600000000,	true },
> 	{ "pll_c_out1",	"pll_c",	120000000,	true },
> 	{ "sclk",	"pll_c_out1",	120000000,	true },
> 	{ "hclk",	"sclk",		120000000,	true },
> 	{ "pclk",	"hclk",		60000000,	true },

Git archaeology shows that the following commits are relevant, the first
and last one in particular:

> commit 9abafa021e223f04d6589ee2b977bbaf2e1f1367
> Author: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> Date:   Thu Apr 12 14:13:05 2012 -0600
> 
>     ARM: tegra: change pll_p_out4's rate to 24MHz
>     
>     pll_p_out4 is used on all/most Tegra boards to drive the cdev2 output pin
>     to provide a reference clock to a ULPI USB PHY. This reference clock must
>     run at 24MHz, and the cdev2 output has no additional dividers.
>     
>     Remove board-paz00.c's now-duplicate initialization of this clock.
>     
>     Reported-by: Marc Dietrich <marvin24-Mmb7MZpHnFY@public.gmane.org>
>     Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> 
> commit 7ff4db0967bd7d617c77dc5a66c0d95166277817
> Author: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> Date:   Fri Apr 20 16:58:18 2012 -0600
> 
>     ARM: tegra: fix pclk rate
>     
>     Commit 40f9cf0 "ARM: tegra: reparent sclk to pll_c_out1" changed the
>     rate of hclk. Since pclk is derived from that, and only has integer
>     dividers, the pclk rate needs to change in the same fashion, from 54MHz
>     to 60MHz.
>     
>     Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> 
> commit 60f975b98cf41476ba0e156f7523b197b046cf2b
> Author: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> Date:   Thu Apr 12 14:09:39 2012 -0600
> 
>     ARM: tegra: reparent sclk to pll_c_out1
>     
>     pll_p_out4 needs to be used for other purposes. Reparent sclk so that
>     it runs from pll_c. Change sclk's rate to 120MHz from 108MHz since this
>     is the lowest precise rate that can be achieved by dividing the pll_c
>     rate without reducing the sclk rate. (600/5=120, 600/5.5=109.0909...,
>     600/6=100).
>     
>     Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> 
> commit c8b62ab41f76218efca5e4baa5c22ef52a9fe3a5
> Author: Allen Martin <amartin-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> Date:   Fri Sep 10 09:17:33 2010 -0500
> 
>     ARM: tegra: Add pllc clock init table
>     
>     pll_c will be used as a clock source. Fill in tegra_pll_c_freq_table[]
>     so that it's possible to explicitly initialize the PLL.
>     
>     NVIDIA's downstream nv-3.1 kernel and the ChromeOS kernel have different
>     pll_c tables. nv-3.1 contains entries for 522MHz and 598MHz output,
>     whereas the ChromeOS kernel contains entries for 600MHz output. I chose
>     to upstream the ChromeOS values for now, since the 600MHz rate appears
>     to match the default rate of this PLL when the HW boots, and it's not
>     clear to me why 522 or 598MHz are more useful.
>     
>     Signed-off-by: Allen Martin <amartin-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>     Signed-off-by: Olof Johansson <olofj-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
>     Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>     [swarren: wrote commit description]

WARNING: multiple messages have this Message-ID (diff)
From: Stephen Warren <swarren@wwwdotorg.org>
To: "Terje Bergström" <tbergstrom@nvidia.com>
Cc: Thierry Reding <thierry.reding@avionic-design.de>,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] ARM: tegra: Add Tegra20 host1x support
Date: Wed, 14 Nov 2012 11:12:57 -0700	[thread overview]
Message-ID: <50A3DF29.1070806@wwwdotorg.org> (raw)
In-Reply-To: <50A3CAA3.2060908@nvidia.com>

On 11/14/2012 09:45 AM, Terje Bergström wrote:
> On 14.11.2012 18:19, Stephen Warren wrote:
>> I'd rather initialize it explicitly. If setting it to 216MHz works
>> fine as Terje indicated, we may as well just do that.
> 
> I'd prefer explicit setting, too.
> 
>> I suspect the issue with the original code:
>>
>>> { "host1x",     "pll_c",        144000000,      false },
>>
>> ... is that perhaps the requested 144MHz can't be generated from
>> pll_c's 600MHz rate, since there's a simple U7.1 divider there (you
>> could get 120, 133.333, 150), so the clock ends up being programmed to
>> some incorrect value. In the pll_p/216MHz case, pll_p is programmed to
>> generate 216MHz anyway, so requesting the same rate for host1x yields
>> a divider of 1 exactly which works fine.
> 
> I could try the values you proposed tomorrow when I get back to office.
> I believe we've always kept host1x under non-fractional dividers, so I'd
> like to try 150MHz on Ventana and 150MHz and 300MHz on Cardhu.
> 
> 600MHz sounds pretty high for PLLC on Tegra20. For Tegra30 it would be
> understandable. In internal kernel I believe we have lower rate for
> Tegra20 PLLC. Do we have anything running from PLLC in Tegra20 upstream
> kernel?

Yes, sclk/... appear to derive from it:

> 	{ "pll_c",	"clk_m",	600000000,	true },
> 	{ "pll_c_out1",	"pll_c",	120000000,	true },
> 	{ "sclk",	"pll_c_out1",	120000000,	true },
> 	{ "hclk",	"sclk",		120000000,	true },
> 	{ "pclk",	"hclk",		60000000,	true },

Git archaeology shows that the following commits are relevant, the first
and last one in particular:

> commit 9abafa021e223f04d6589ee2b977bbaf2e1f1367
> Author: Stephen Warren <swarren@nvidia.com>
> Date:   Thu Apr 12 14:13:05 2012 -0600
> 
>     ARM: tegra: change pll_p_out4's rate to 24MHz
>     
>     pll_p_out4 is used on all/most Tegra boards to drive the cdev2 output pin
>     to provide a reference clock to a ULPI USB PHY. This reference clock must
>     run at 24MHz, and the cdev2 output has no additional dividers.
>     
>     Remove board-paz00.c's now-duplicate initialization of this clock.
>     
>     Reported-by: Marc Dietrich <marvin24@gmx.de>
>     Signed-off-by: Stephen Warren <swarren@nvidia.com>
> 
> commit 7ff4db0967bd7d617c77dc5a66c0d95166277817
> Author: Stephen Warren <swarren@nvidia.com>
> Date:   Fri Apr 20 16:58:18 2012 -0600
> 
>     ARM: tegra: fix pclk rate
>     
>     Commit 40f9cf0 "ARM: tegra: reparent sclk to pll_c_out1" changed the
>     rate of hclk. Since pclk is derived from that, and only has integer
>     dividers, the pclk rate needs to change in the same fashion, from 54MHz
>     to 60MHz.
>     
>     Signed-off-by: Stephen Warren <swarren@nvidia.com>
> 
> commit 60f975b98cf41476ba0e156f7523b197b046cf2b
> Author: Stephen Warren <swarren@nvidia.com>
> Date:   Thu Apr 12 14:09:39 2012 -0600
> 
>     ARM: tegra: reparent sclk to pll_c_out1
>     
>     pll_p_out4 needs to be used for other purposes. Reparent sclk so that
>     it runs from pll_c. Change sclk's rate to 120MHz from 108MHz since this
>     is the lowest precise rate that can be achieved by dividing the pll_c
>     rate without reducing the sclk rate. (600/5=120, 600/5.5=109.0909...,
>     600/6=100).
>     
>     Signed-off-by: Stephen Warren <swarren@nvidia.com>
> 
> commit c8b62ab41f76218efca5e4baa5c22ef52a9fe3a5
> Author: Allen Martin <amartin@nvidia.com>
> Date:   Fri Sep 10 09:17:33 2010 -0500
> 
>     ARM: tegra: Add pllc clock init table
>     
>     pll_c will be used as a clock source. Fill in tegra_pll_c_freq_table[]
>     so that it's possible to explicitly initialize the PLL.
>     
>     NVIDIA's downstream nv-3.1 kernel and the ChromeOS kernel have different
>     pll_c tables. nv-3.1 contains entries for 522MHz and 598MHz output,
>     whereas the ChromeOS kernel contains entries for 600MHz output. I chose
>     to upstream the ChromeOS values for now, since the 600MHz rate appears
>     to match the default rate of this PLL when the HW boots, and it's not
>     clear to me why 522 or 598MHz are more useful.
>     
>     Signed-off-by: Allen Martin <amartin@nvidia.com>
>     Signed-off-by: Olof Johansson <olofj@chromium.org>
>     Signed-off-by: Stephen Warren <swarren@nvidia.com>
>     [swarren: wrote commit description]



  parent reply	other threads:[~2012-11-14 18:12 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-09 13:20 [PATCH 0/2] Device tree updates for host1x support Thierry Reding
2012-11-09 13:20 ` Thierry Reding
2012-11-09 13:20 ` [PATCH 1/2] ARM: tegra: Add Tegra20 " Thierry Reding
     [not found]   ` <1352467202-27903-2-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2012-11-12  9:39     ` Mark Zhang
2012-11-12  9:39       ` Mark Zhang
     [not found]       ` <50A0C3BF.90509-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-11-13  4:38         ` Mark Zhang
2012-11-13  4:38           ` Mark Zhang
     [not found]           ` <50A1CECA.3090804-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-11-13  6:41             ` Thierry Reding
2012-11-13  6:41               ` Thierry Reding
     [not found]               ` <20121113064135.GA31443-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2012-11-13  7:37                 ` Mark Zhang
2012-11-13  7:37                   ` Mark Zhang
2012-11-14  8:35     ` Terje Bergström
2012-11-14  8:35       ` Terje Bergström
     [not found]       ` <50A357D3.9080002-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-11-14  8:49         ` Thierry Reding
2012-11-14  8:49           ` Thierry Reding
     [not found]           ` <20121114084931.GA31837-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2012-11-14 10:23             ` Terje Bergström
2012-11-14 10:23               ` Terje Bergström
     [not found]               ` <50A3712E.7000104-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-11-14 10:54                 ` Thierry Reding
2012-11-14 10:54                   ` Thierry Reding
2012-11-14 16:19                   ` Stephen Warren
     [not found]                     ` <50A3C485.7080704-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-11-14 16:45                       ` Terje Bergström
2012-11-14 16:45                         ` Terje Bergström
     [not found]                         ` <50A3CAA3.2060908-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-11-14 18:12                           ` Stephen Warren [this message]
2012-11-14 18:12                             ` Stephen Warren
2012-11-14 20:04                       ` Thierry Reding
2012-11-14 20:04                         ` Thierry Reding
     [not found]                         ` <20121114200415.GA10335-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2012-11-14 20:15                           ` Stephen Warren
2012-11-14 20:15                             ` Stephen Warren
     [not found]                             ` <50A3FBFA.3080008-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-11-14 20:21                               ` Thierry Reding
2012-11-14 20:21                                 ` Thierry Reding
2012-11-15  6:56                           ` Terje Bergström
2012-11-15  6:56                             ` Terje Bergström
2012-11-15  7:11                             ` Thierry Reding
2012-11-14 15:01         ` Thierry Reding
2012-11-14 15:01           ` Thierry Reding
     [not found]           ` <20121114150125.GA11050-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2012-11-14 15:29             ` Terje Bergström
2012-11-14 15:29               ` Terje Bergström
     [not found]               ` <50A3B8DD.7010607-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-11-14 15:33                 ` Thierry Reding
2012-11-14 15:33                   ` Thierry Reding
2012-11-13  7:45   ` Mark Zhang
     [not found]     ` <50A1FA7C.4010507-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-11-13  7:52       ` Thierry Reding
2012-11-13  7:52         ` Thierry Reding
     [not found]         ` <20121113075247.GB8409-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2012-11-13  8:00           ` Mark Zhang
2012-11-13  8:00             ` Mark Zhang
     [not found]             ` <50A1FE2F.8000107-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-11-13  8:04               ` Thierry Reding
2012-11-13  8:04                 ` Thierry Reding
2012-11-13  8:29                 ` Mark Zhang
2012-11-09 13:20 ` [PATCH 2/2] ARM: tegra: Add Tegra30 " Thierry Reding
     [not found]   ` <1352467202-27903-3-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2012-11-13  4:37     ` Mark Zhang
2012-11-13  4:37       ` Mark Zhang
2012-11-13  7:45     ` Mark Zhang
2012-11-13  7:45       ` Mark Zhang
     [not found]       ` <50A1FAB0.8040700-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-11-13  7:53         ` Thierry Reding
2012-11-13  7:53           ` Thierry Reding
     [not found] ` <1352467202-27903-1-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2012-11-09 17:34   ` [PATCH 0/2] Device tree updates for " Stephen Warren
2012-11-09 17:34     ` Stephen Warren
     [not found]     ` <509D3EB1.8040703-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-11-09 18:44       ` Thierry Reding
2012-11-09 18:44         ` Thierry Reding
     [not found]         ` <20121109184409.GB7663-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2012-11-09 21:10           ` Stephen Warren
2012-11-09 21:10             ` Stephen Warren
     [not found]             ` <509D7145.9000203-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-11-15  8:21               ` Prashant Gaikwad
2012-11-15  8:21                 ` Prashant Gaikwad
2012-11-15  8:50                 ` Thierry Reding

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50A3DF29.1070806@wwwdotorg.org \
    --to=swarren-3lzwwm7+weoh9zmkesr00q@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=tbergstrom-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.