linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Valentine <valentine.barshak@cogentembedded.com>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH 2/5] arm: shmobile: r8a7790: Add SATA clock
Date: Thu, 19 Dec 2013 01:00:03 +0000	[thread overview]
Message-ID: <52B24513.8090909@cogentembedded.com> (raw)
In-Reply-To: <1375892397-5822-3-git-send-email-laurent.pinchart+renesas@ideasonboard.com>

On 12/18/2013 06:19 PM, Laurent Pinchart wrote:
> Hi Valentine,

Hi Laurent, Morimoto-san,

>
> Thank you for the patch.
>
> On Wednesday 18 December 2013 16:44:17 Valentine Barshak wrote:
>> This adds SATA 0/1 clock support. External 100MHz SATA 0/1
>> reference clock is supposed to be applied to the following pins:
>>    CICREFP0_SATA/CICREFP1_SATA;
>>    CICREFN0_SATA/CICREFN1_SATA.
>>
>> Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
>> ---
>>   arch/arm/mach-shmobile/clock-r8a7790.c | 19 +++++++++++++++++++
>>   1 file changed, 19 insertions(+)
>>
>> diff --git a/arch/arm/mach-shmobile/clock-r8a7790.c
>> b/arch/arm/mach-shmobile/clock-r8a7790.c index 3e27200..c4b567b 100644
>> --- a/arch/arm/mach-shmobile/clock-r8a7790.c
>> +++ b/arch/arm/mach-shmobile/clock-r8a7790.c
>> @@ -73,6 +73,18 @@ static struct clk extal_clk = {
>>   	.mapping	= &cpg_mapping,
>>   };
>>
>> +/* External SATA0 reference clock: 100MHz fixed */
>> +static struct clk sata0_clk = {
>> +	.rate		= 100000000,
>> +	.mapping	= &cpg_mapping,
>> +};
>> +
>> +/* External SATA1 reference clock: 100MHz fixed */
>> +static struct clk sata1_clk = {
>> +	.rate		= 100000000,
>> +	.mapping	= &cpg_mapping,
>> +};
>> +
>>   static struct sh_clk_ops followparent_clk_ops = {
>>   	.recalc	= followparent_recalc,
>>   };
>> @@ -140,6 +152,8 @@ static struct clk *main_clks[] = {
>>   	&ddr_clk,
>>   	&mp_clk,
>>   	&cp_clk,
>> +	&sata0_clk,
>> +	&sata1_clk,
>>   };
>>
>>   /* SDHI (DIV4) clock */
>> @@ -187,6 +201,7 @@ enum {
>>   	MSTP1009, MSTP1008, MSTP1007, MSTP1006, MSTP1005,
>>   	MSTP931, MSTP930, MSTP929, MSTP928,
>>   	MSTP917,
>> +	MSTP815, MSTP814,
>>   	MSTP813,
>>   	MSTP726, MSTP725, MSTP724, MSTP723, MSTP722, MSTP721, MSTP720,
>>   	MSTP717, MSTP716,
>> @@ -215,6 +230,8 @@ static struct clk mstp_clks[MSTP_NR] = {
>>   	[MSTP929] = SH_CLK_MSTP32(&p_clk, SMSTPCR9, 29, 0), /* I2C2 */
>>   	[MSTP928] = SH_CLK_MSTP32(&p_clk, SMSTPCR9, 28, 0), /* I2C3 */
>>   	[MSTP917] = SH_CLK_MSTP32(&qspi_clk, SMSTPCR9, 17, 0), /* QSPI */
>> +	[MSTP815] = SH_CLK_MSTP32(&sata0_clk, SMSTPCR8, 15, 0), /* SATA0 */
>> +	[MSTP814] = SH_CLK_MSTP32(&sata1_clk, SMSTPCR8, 14, 0),	/* SATA1 */
>
> Are those two clocks really children of the external reference clocks ? I got
> the impression that the external reference clocks would be used by the PHY
> only and that the functional clocks for the SATA controllers would be children
> of an internal clock generated by the CPG. Morimoto-san, do you have any
> information about this ?

If understand the h/w manual correctly, the external clock is connected directly to the SATA module:

"Pin Name: CICREFP0_SATA CICREFN0_SATA CICREFP1_SATA CICREFN1_SATA
Description: Reference clock input to the PLL circuit in the Serial-ATA module (differential input).
Apply a 100-MHz clock."

Morimoto-san, could you confirm, please?

>
>>   	[MSTP813] = SH_CLK_MSTP32(&p_clk, SMSTPCR8, 13, 0), /* Ether */
>>   	[MSTP726] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 26, 0), /* LVDS0 */
>>   	[MSTP725] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 25, 0), /* LVDS1 */
>> @@ -321,6 +338,8 @@ static struct clk_lookup lookups[] = {
>>   	CLKDEV_DEV_ID("pci-rcar-gen2.0", &mstp_clks[MSTP703]),
>>   	CLKDEV_DEV_ID("pci-rcar-gen2.1", &mstp_clks[MSTP703]),
>>   	CLKDEV_DEV_ID("pci-rcar-gen2.2", &mstp_clks[MSTP703]),
>> +	CLKDEV_DEV_ID("sata-r8a7790.0", &mstp_clks[MSTP815]),
>> +	CLKDEV_DEV_ID("sata-r8a7790.1", &mstp_clks[MSTP814]),
>>
>>   	/* ICK */
>>   	CLKDEV_ICK_ID("usbhs", "usb_phy_rcar_gen2", &mstp_clks[MSTP704]),

Thanks,
Val.

  parent reply	other threads:[~2013-12-19  1:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-07 16:19 [PATCH 2/5] ARM: shmobile: r8a7790: Add DU and LVDS clocks Laurent Pinchart
2013-12-18 12:44 ` [PATCH 2/5] arm: shmobile: r8a7790: Add SATA clock Valentine Barshak
2013-12-18 14:19 ` Laurent Pinchart
2013-12-19  1:00 ` Valentine [this message]
2013-12-19  1:04 ` Laurent Pinchart
2013-12-19  4:58 ` Kuninori Morimoto
2013-12-23 21:24 ` Valentine
2013-12-26 14:16 ` Laurent Pinchart
2013-12-26 14:35 ` Valentine
2014-01-06  1:25 ` Kuninori Morimoto
2014-01-06 13:58 ` Valentine
2014-01-07  0:14 ` Kuninori Morimoto
2014-02-12 17:59 ` [PATCH 2/5] ARM: shmobile: r8a7790: add dmac0 dmac1 nodes Ben Dooks
2014-02-12 19:18 ` Geert Uytterhoeven
2014-02-12 19:55 ` Sergei Shtylyov
2014-02-13 18:17 ` Ben Dooks
2014-02-13 18:18 ` Ben Dooks

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=52B24513.8090909@cogentembedded.com \
    --to=valentine.barshak@cogentembedded.com \
    --cc=linux-sh@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).