devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: "Antoine Ténart" <antoine.tenart@free-electrons.com>,
	"Sebastian Hesselbarth" <sebastian.hesselbarth@gmail.com>
Cc: tj@kernel.org, kishon@ti.com,
	thomas.petazzoni@free-electrons.com, zmxu@marvell.com,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-ide@vger.kernel.org, alexandre.belloni@free-electrons.com,
	jszhang@marvell.com, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v7 1/7] phy: add a driver for the Berlin SATA PHY
Date: Mon, 30 Jun 2014 20:55:35 +0400	[thread overview]
Message-ID: <53B19687.5050400@cogentembedded.com> (raw)
In-Reply-To: <20140630154409.GB29613@kwain>

Hello.

On 06/30/2014 07:44 PM, Antoine Ténart wrote:

>>>>> +	/* set the controller speed */
>>>>> +	writel(0x31, ctrl_reg + PORT_SCR_CTL);

>>>>     Value undocumented? Or is this the SATA SControl register by chance?

>>> Some magic is still there...

>> I guess Sergei was referring to AHCI spec here.

    Actually, even to the SATA specs. :-)

>> PORT_SCR bits are documented in AHCI spec as:

>> 7:4 = 0x3 Limit speed negotiation to a rate not greater than Gen3
>>            communication rate.

>> 3:0 = 0x1 Perform interface communication sequence [...]. This is
>>            functionally equivalent to a hard reset [...].

>> So, the question is: Should we really need to reset controller in the
>> PHY driver or is it already done in AHCI common code? At least we
>> should change the comment to something like
>> /* set Gen3 controller speed and perform hard reset */

> I just checked, the AHCI common code has a function to do the reset:
> ahci_reset_controller(). As of the max speed negociation rate, I did not
> see it in the common AHCI functions.

    You've looked in a wrong place -- since SControl is a standard *SATA* 
register, it gets read/written by the libata core. The low-level driver only 
provides scr_{read|write}() methods.

> The eSATA port on the Berlin2Q works without this line, but it may be a
> good idea to keep the max speed negociation rate.

    It's usually libata's task to negotiate the SATA speed.

> Anyway, we can remove the reset part. Nice catch!

    Thanks.

> Antoine

WBR, Sergei


  reply	other threads:[~2014-06-30 16:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-23 13:39 [PATCH v7 0/7] ARM: berlin: add AHCI support Antoine Ténart
2014-06-23 13:39 ` [PATCH v7 1/7] phy: add a driver for the Berlin SATA PHY Antoine Ténart
2014-06-25 19:03   ` Sergei Shtylyov
2014-06-30  9:59     ` Antoine Ténart
2014-06-30 14:40       ` Sebastian Hesselbarth
2014-06-30 15:44         ` Antoine Ténart
2014-06-30 16:55           ` Sergei Shtylyov [this message]
     [not found] ` <1403530783-17180-1-git-send-email-antoine.tenart-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-06-23 13:39   ` [PATCH v7 2/7] Documentation: bindings: add " Antoine Ténart
2014-06-23 13:39 ` [PATCH v7 3/7] ata: libahci: allow to use multiple PHYs Antoine Ténart
2014-06-23 13:39 ` [PATCH v7 4/7] ata: ahci_platform: add a generic AHCI compatible Antoine Ténart
2014-06-23 13:39 ` [PATCH v7 5/7] Documentation: bindings: document the sub-nodes AHCI bindings Antoine Ténart
2014-06-23 13:39 ` [PATCH v7 6/7] ARM: berlin: add the AHCI node for the BG2Q Antoine Ténart
2014-06-23 13:39 ` [PATCH v7 7/7] ARM: berlin: enable the eSATA interface on the BG2Q DMP Antoine Ténart

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=53B19687.5050400@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=antoine.tenart@free-electrons.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jszhang@marvell.com \
    --cc=kishon@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sebastian.hesselbarth@gmail.com \
    --cc=thomas.petazzoni@free-electrons.com \
    --cc=tj@kernel.org \
    --cc=zmxu@marvell.com \
    /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).