devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roger Quadros <rogerq@ti.com>
To: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>, kishon@ti.com
Cc: balbi@ti.com, bcousson@baylibre.com, tony@atomide.com,
	balajitk@ti.com, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-ide@vger.kernel.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [RFC PATCH 15/15] arm: dts: dra7: add sata node
Date: Mon, 23 Sep 2013 11:24:12 +0300	[thread overview]
Message-ID: <523FFAAC.3050907@ti.com> (raw)
In-Reply-To: <523F3AE4.5050709@cogentembedded.com>

On 09/22/2013 09:45 PM, Sergei Shtylyov wrote:
> On 09/20/2013 02:19 PM, Roger Quadros wrote:
> 
>>>> From: Balaji T K <balajitk@ti.com>
> 
>>>> Add support for sata controller.
> 
>>>> [Roger Q] Clean up.
> 
>>>> CC: Benoit Cousson <bcousson@baylibre.com>
>>>> Signed-off-by: Balaji T K <balajitk@ti.com>
>>>> Signed-off-by: Roger Quadros <rogerq@ti.com>
>>>> ---
>>>>    arch/arm/boot/dts/dra7.dtsi |   49 +++++++++++++++++++++++++++++++++++++++++++
>>>>    1 files changed, 49 insertions(+), 0 deletions(-)
> 
>>>> diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
>>>> index ce9a0f0..545545d 100644
>>>> --- a/arch/arm/boot/dts/dra7.dtsi
>>>> +++ b/arch/arm/boot/dts/dra7.dtsi
>>>> @@ -426,6 +426,55 @@
> [...]
> 
>>>> +        sata: sata@4a141100 {
>>>> +            compatible = "ti,sata";
>>>> +            ti,hwmods = "sata";
>>>> +            reg = <0x4a141100 0x7>;
> 
>    Not 0x8 BTW?

You are right. Two 32 bit registers are used.
However, in the instance summary, the reference manual says 256 bytes.
So I think we should use 0x100.

> 
>>>> +            #address-cells = <1>;
>>>> +            #size-cells = <1>;
>>>> +            ranges;
>>>> +            dwc-ahci@4a140000 {
> 
>>>     Hm, ePAPR spec. [1] says that "the name of a node should be somewhat generic, reflecting the function of the device and not its precise programming model", so it looks like the name should be "sata" as well. I'm a bit at a loss here, not sure why you had to use the nested device nodes.
> 
>> ok. will fix it to sata.
>> I've nested it because the wrapper registers are not part of the AHCI sata controller.
>> They are TI specific registers for power management.
>> Similar setup is on the USB controller. Please see omap_dwc3 node.
> 
>> But if you have better idea, please let me know.
> 
>     Don't know, it seems to me that you're over-complicating it by using the nested nodes. You could just have AHCI regs as a first tuple of the "regs" prop, and PM regs as a second tuple.
> 

Yes that is possible, and in fact it was that way in Balaji's original code.
However in that case, won't TI specific handling be need to be done in the ahci_platform driver?

As of now, that is limited to using pm_runtime to enable/disable the hardware module so it is generic enough.
However in the future it would mean reading/writing to the TI wrapper register. If this can be done in ahci_platform
driver then I don't see any issue and can combine the 2 nodes.

>>>> +                  compatible = "snps,dwc-ahci";
>>>> +                  reg = <0x4a140000 0x1100>;
>>>> +                  interrupts = <0 54 0x4>;
>>>> +                  phys = <&sata_phy>;
> 
>>>     Hm, it's the third PHY related generic property I'm encountering. First, there was "phy-handle", then "phy", now "phys"... Seems like a bit too much. :-)
> 
>> I'm afraid but this is how the designers have made it.
> 
>> 1) control-phy-pipe3 is that part of the PHY which sits in control module space and is different
>> from the sata-phy space and hence needs a different node. If it were to me, I would just put this
>> resource in sata-phy node, but there was a discussion about this earlier to do it otherwise [1].
> 
>> 2) sata-phy (sataphy) is the actual SATA PHY device.
> 
>> 3) phys is just a reference to the sata_phy and is used via the generic PHY framework.
>> It is upto the sata driver to power up/down the phy.
> 
>    I understand that it's a reference but why have 3 variants of such phandle containing prop? Is it really possible for a device to have multiple PHYs? Well, remembering our customer's USB, it's indeed possible, however, there 2 PHYs out of 3 are not software controllable...
> 

If I understand right, are you asking that we don't need "phy-names" property if there can be only one PHY?
I too think it is redundant. Maybe the PHY framework should be modified to allow users to use phy_get() whithout
any phy name string. In such case it should return the first PHY. 
Kishon, any thoughts?

>>>> +                  phy-names = "sata-phy";
>>>> +                  clocks = <&sata_ref_clk>;
>>>> +                  clock-names = "optclk";
>>>> +            };
>>>> +        };
> 
>>> [1] http://www.power.org/resources/downloads/Power_ePAPR_APPROVED_v1.0.pdf
> 

cheers,
-roger

      reply	other threads:[~2013-09-23  8:24 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-19 13:05 [RFC PATCH 00/15] Add SATA support for TI OMAP5 and DRA7 SoCs Roger Quadros
2013-09-19 13:05 ` [RFC PATCH 01/15] phy: rename struct omap_control_usb to struct omap_control_phy Roger Quadros
     [not found]   ` <1379595943-14622-2-git-send-email-rogerq-l0cyMroinI0@public.gmane.org>
2013-09-19 14:25     ` Daniel Mack
2013-09-19 13:05 ` [RFC PATCH 02/15] phy: omap-control: Update DT binding information Roger Quadros
2013-09-19 13:05 ` [RFC PATCH 03/15] ARM: dts: omap5: Add clocks to usb3_phy node Roger Quadros
     [not found] ` <1379595943-14622-1-git-send-email-rogerq-l0cyMroinI0@public.gmane.org>
2013-09-19 13:05   ` [RFC PATCH 04/15] phy: omap-pipe3: use generic clock names Roger Quadros
2013-09-19 13:05   ` [RFC PATCH 08/15] ata: ahci_platform: Manage SATA PHY Roger Quadros
     [not found]     ` <1379595943-14622-9-git-send-email-rogerq-l0cyMroinI0@public.gmane.org>
2013-09-22 16:58       ` Tejun Heo
2013-09-22 18:24         ` Sergei Shtylyov
2013-09-22 21:51           ` Tejun Heo
2013-09-23  7:37             ` Roger Quadros
     [not found]               ` <523FEFC2.801-l0cyMroinI0@public.gmane.org>
2013-09-23 12:59                 ` Sergei Shtylyov
2013-09-23 13:59                   ` Roger Quadros
2014-02-07 10:33                     ` Roger Quadros
2014-02-07 10:39                       ` Arnd Bergmann
2014-02-07 10:44                         ` Roger Quadros
     [not found]             ` <20130922215107.GD27616-9pTldWuhBndy/B6EtB590w@public.gmane.org>
2013-09-23 12:53               ` Sergei Shtylyov
     [not found]                 ` <524039E0.2060205-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2013-09-25 12:16                   ` Bartlomiej Zolnierkiewicz
2013-09-22 18:22     ` Sergei Shtylyov
     [not found]       ` <523F3567.80303-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2013-09-22 21:48         ` Tejun Heo
2013-09-23 14:10           ` Sergei Shtylyov
2013-09-23 14:12             ` Tejun Heo
2013-09-23  7:42       ` Roger Quadros
2013-09-19 13:05 ` [RFC PATCH 05/15] phy: omap-pipe3: Add SATA DPLL support Roger Quadros
2013-09-19 13:05 ` [RFC PATCH 06/15] phy: omap-pipe3: update compatibility string and DT binding Roger Quadros
2013-09-19 13:05 ` [RFC PATCH 07/15] ARM: dts: omap5: Update usb3phy node Roger Quadros
2013-09-19 13:05 ` [RFC PATCH 09/15] ata: ti_sata: Add Texas Instruments SATA Wrapper driver Roger Quadros
2013-09-25 12:37   ` Bartlomiej Zolnierkiewicz
2013-09-25 12:49     ` Bartlomiej Zolnierkiewicz
2013-09-25 13:29       ` Roger Quadros
2013-09-19 13:22 ` [RFC PATCH 10/15] ARM: omap5: hwmod: Add ocp2scp3 and sata hwmods Roger Quadros
2013-09-19 13:23 ` [RFC PATCH 11/15] arm: omap5: hwmod: add missing ocp2scp hwmod data Roger Quadros
2013-09-19 13:23 ` [RFC PATCH 12/15] ARM: dts: omap5: add ocp2scp1 address resource Roger Quadros
     [not found]   ` <1379597019-15294-1-git-send-email-rogerq-l0cyMroinI0@public.gmane.org>
2013-09-19 14:17     ` Sergei Shtylyov
     [not found]       ` <523B0782.7050501-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2013-09-20  9:22         ` Roger Quadros
2013-09-19 13:23 ` [RFC PATCH 13/15] arm: dts: omap5: add sata node Roger Quadros
2013-09-19 13:24 ` [RFC PATCH 14/15] ARM: DRA7: hwmod: Add ocp2scp3 and sata hwmods Roger Quadros
2013-09-19 13:24 ` [RFC PATCH 15/15] arm: dts: dra7: add sata node Roger Quadros
     [not found]   ` <1379597059-15405-1-git-send-email-rogerq-l0cyMroinI0@public.gmane.org>
2013-09-19 14:11     ` Sergei Shtylyov
     [not found]       ` <523B05FD.7020200-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2013-09-20 10:19         ` Roger Quadros
2013-09-22 18:45           ` Sergei Shtylyov
2013-09-23  8:24             ` Roger Quadros [this message]

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=523FFAAC.3050907@ti.com \
    --to=rogerq@ti.com \
    --cc=balajitk@ti.com \
    --cc=balbi@ti.com \
    --cc=bcousson@baylibre.com \
    --cc=devicetree@vger.kernel.org \
    --cc=kishon@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=sergei.shtylyov@cogentembedded.com \
    --cc=tony@atomide.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).