diff mbox

[v2,1/2] Documentation: Document Hisilicon hix5hd2 sata PHY

Message ID 1403687648-29082-2-git-send-email-zhangfei.gao@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Zhangfei Gao June 25, 2014, 9:14 a.m. UTC
From: Jiancheng Xue <xuejiancheng@huawei.com>

Add necessary binding documentation SATA PHY on Hisilicon hix5hd2 soc.

Signed-off-by: Jiancheng Xue <xuejiancheng@huawei.com>
Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
---
 .../devicetree/bindings/phy/hix5hd2-sata-phy.txt   |   22 ++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/phy/hix5hd2-sata-phy.txt

Comments

Arnd Bergmann June 25, 2014, 12:16 p.m. UTC | #1
On Wednesday 25 June 2014, Zhangfei Gao wrote:
> From: Jiancheng Xue <xuejiancheng@huawei.com>
> 
> Add necessary binding documentation SATA PHY on Hisilicon hix5hd2 soc.
> 
> Signed-off-by: Jiancheng Xue <xuejiancheng@huawei.com>
> Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>

We have had a couple of PHY drivers that were initially meant to be
single-purpose but then turned out to be for hardware that could
be put into multiple modes (SATA, gbit ethernet, PCIe, ...). Are
you sure that this particular device is SATA-only?

	Arnd
Zhangfei Gao June 25, 2014, 12:41 p.m. UTC | #2
On 06/25/2014 08:16 PM, Arnd Bergmann wrote:
> On Wednesday 25 June 2014, Zhangfei Gao wrote:
>> From: Jiancheng Xue <xuejiancheng@huawei.com>
>>
>> Add necessary binding documentation SATA PHY on Hisilicon hix5hd2 soc.
>>
>> Signed-off-by: Jiancheng Xue <xuejiancheng@huawei.com>
>> Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
>
> We have had a couple of PHY drivers that were initially meant to be
> single-purpose but then turned out to be for hardware that could
> be put into multiple modes (SATA, gbit ethernet, PCIe, ...). Are
> you sure that this particular device is SATA-only?
>

Yes, double confimed.
Hix5hd2 phy diver only support sata phy, in fact, current soc only 
support synposis phy, since some internal physical link.
And hix5hd2 ethernet phy is already in hix5hd2_gmac.c.
No pcie support on hix5hd2 platfrom.

Thanks
Arnd Bergmann June 25, 2014, 1:32 p.m. UTC | #3
On Wednesday 25 June 2014 20:41:26 zhangfei wrote:
> On 06/25/2014 08:16 PM, Arnd Bergmann wrote:
> > On Wednesday 25 June 2014, Zhangfei Gao wrote:
> >> From: Jiancheng Xue <xuejiancheng@huawei.com>
> >>
> >> Add necessary binding documentation SATA PHY on Hisilicon hix5hd2 soc.
> >>
> >> Signed-off-by: Jiancheng Xue <xuejiancheng@huawei.com>
> >> Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
> >
> > We have had a couple of PHY drivers that were initially meant to be
> > single-purpose but then turned out to be for hardware that could
> > be put into multiple modes (SATA, gbit ethernet, PCIe, ...). Are
> > you sure that this particular device is SATA-only?
> >
> 
> Yes, double confimed.
> Hix5hd2 phy diver only support sata phy, in fact, current soc only 
> support synposis phy, since some internal physical link.
> And hix5hd2 ethernet phy is already in hix5hd2_gmac.c.
> No pcie support on hix5hd2 platfrom.

Sorry if I my question was unclear, I did not mean the implementation
of this phy in hix5hd2, but the Synopsys phy itself. I was mainly
asking because of the "compatible" string, which should otherwise
not include "sata" but be more generic.

Since you mention that this is a synopsys part, it may however be
good to also define a compatible string for the generic device,
to allow other SoCs to share this driver, and to make it easier
for people to find out that we already have one so they don't have
to write another driver for the same hardware.

Can you find out what the Synopsys/Designware product designation for
this PHY is? It would be good to rename the driver and binding
if possible. I would still recommend leaving the
"hisilicon,hix5hd2-sata-phy" string and the "hisilicon,peripheral-syscon"
property in place, since that indicates a minor variation of the
generic part.

	Arnd
Zhangfei Gao June 26, 2014, 1:48 p.m. UTC | #4
On 06/25/2014 09:32 PM, Arnd Bergmann wrote:
> On Wednesday 25 June 2014 20:41:26 zhangfei wrote:
>> On 06/25/2014 08:16 PM, Arnd Bergmann wrote:
>>> On Wednesday 25 June 2014, Zhangfei Gao wrote:
>>>> From: Jiancheng Xue <xuejiancheng@huawei.com>
>>>>
>>>> Add necessary binding documentation SATA PHY on Hisilicon hix5hd2 soc.
>>>>
>>>> Signed-off-by: Jiancheng Xue <xuejiancheng@huawei.com>
>>>> Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
>>>
>>> We have had a couple of PHY drivers that were initially meant to be
>>> single-purpose but then turned out to be for hardware that could
>>> be put into multiple modes (SATA, gbit ethernet, PCIe, ...). Are
>>> you sure that this particular device is SATA-only?
>>>
>>
>> Yes, double confimed.
>> Hix5hd2 phy diver only support sata phy, in fact, current soc only
>> support synposis phy, since some internal physical link.
>> And hix5hd2 ethernet phy is already in hix5hd2_gmac.c.
>> No pcie support on hix5hd2 platfrom.
>
> Sorry if I my question was unclear, I did not mean the implementation
> of this phy in hix5hd2, but the Synopsys phy itself. I was mainly
> asking because of the "compatible" string, which should otherwise
> not include "sata" but be more generic.

This phy is specifically for sata.

>
> Since you mention that this is a synopsys part, it may however be
> good to also define a compatible string for the generic device,
> to allow other SoCs to share this driver, and to make it easier
> for people to find out that we already have one so they don't have
> to write another driver for the same hardware.

http://www.synopsys.com/dw/ipdir.php?ds=dwc_sata_phy
name can be: dwc_sata_phy
However, not find register from the website, not sure whether the 
register are totally same, or there is some change.
Other soc from hisilicon using the same ip can share this driver.

>
> Can you find out what the Synopsys/Designware product designation for
> this PHY is? It would be good to rename the driver and binding
> if possible. I would still recommend leaving the
> "hisilicon,hix5hd2-sata-phy" string and the "hisilicon,peripheral-syscon"
> property in place, since that indicates a minor variation of the
> generic part.

"hisilicon,peripheral-syscon" is privide power supply, etc.

Do you mean change the compatible to "hisilicon,dwc-sata-phy" or 
multiple compatible?

Thanks
Arnd Bergmann June 26, 2014, 8:53 p.m. UTC | #5
On Thursday 26 June 2014 21:48:54 zhangfei wrote:
> 
> On 06/25/2014 09:32 PM, Arnd Bergmann wrote:
> > On Wednesday 25 June 2014 20:41:26 zhangfei wrote:
> >> On 06/25/2014 08:16 PM, Arnd Bergmann wrote:
> >>> On Wednesday 25 June 2014, Zhangfei Gao wrote:
> >>>> From: Jiancheng Xue <xuejiancheng@huawei.com>
> >>>>
> >>>> Add necessary binding documentation SATA PHY on Hisilicon hix5hd2 soc.
> >>>>
> >>>> Signed-off-by: Jiancheng Xue <xuejiancheng@huawei.com>
> >>>> Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
> >>>
> >>> We have had a couple of PHY drivers that were initially meant to be
> >>> single-purpose but then turned out to be for hardware that could
> >>> be put into multiple modes (SATA, gbit ethernet, PCIe, ...). Are
> >>> you sure that this particular device is SATA-only?
> >>>
> >>
> >> Yes, double confimed.
> >> Hix5hd2 phy diver only support sata phy, in fact, current soc only
> >> support synposis phy, since some internal physical link.
> >> And hix5hd2 ethernet phy is already in hix5hd2_gmac.c.
> >> No pcie support on hix5hd2 platfrom.
> >
> > Sorry if I my question was unclear, I did not mean the implementation
> > of this phy in hix5hd2, but the Synopsys phy itself. I was mainly
> > asking because of the "compatible" string, which should otherwise
> > not include "sata" but be more generic.
> 
> This phy is specifically for sata.

Ok.

> > Since you mention that this is a synopsys part, it may however be
> > good to also define a compatible string for the generic device,
> > to allow other SoCs to share this driver, and to make it easier
> > for people to find out that we already have one so they don't have
> > to write another driver for the same hardware.
> 
> http://www.synopsys.com/dw/ipdir.php?ds=dwc_sata_phy
> name can be: dwc_sata_phy
> However, not find register from the website, not sure whether the 
> register are totally same, or there is some change.
> Other soc from hisilicon using the same ip can share this driver.

I found a list of versions under "Downloads and Documentation", but
unfortunately the actual downloads are not accessible without a
customer account.

> > Can you find out what the Synopsys/Designware product designation for
> > this PHY is? It would be good to rename the driver and binding
> > if possible. I would still recommend leaving the
> > "hisilicon,hix5hd2-sata-phy" string and the "hisilicon,peripheral-syscon"
> > property in place, since that indicates a minor variation of the
> > generic part.
> 
> "hisilicon,peripheral-syscon" is privide power supply, etc.
> 
> Do you mean change the compatible to "hisilicon,dwc-sata-phy" or 
> multiple compatible?

Multiple compatible strings.

"hisilicon,dwc-sata-phy" would be too generic anyway, it should include the
name of the chip that first implements this, or the exact version of the
IP block, preferably both.

Ideally if you can find out the version that hisilicon uses, it could
look something like

compatible = "hisilicon,hi15hd2-sata-phy", "snps,dwc-sata-phy-2.3a", ""snps,dwc-sata-phy";

Note also the specific version of the hisilicon chip: you must not use
wildcards in compatible strings but should always use a real product number.
("1" instead of "x"). If multiple chips are mutually compatible, they
can all use the number of the first one here.

	Arnd
Zhangfei Gao June 27, 2014, 3:37 a.m. UTC | #6
On 06/27/2014 04:53 AM, Arnd Bergmann wrote:
> On Thursday 26 June 2014 21:48:54 zhangfei wrote:

>>> Since you mention that this is a synopsys part, it may however be
>>> good to also define a compatible string for the generic device,
>>> to allow other SoCs to share this driver, and to make it easier
>>> for people to find out that we already have one so they don't have
>>> to write another driver for the same hardware.
>>
>> http://www.synopsys.com/dw/ipdir.php?ds=dwc_sata_phy
>> name can be: dwc_sata_phy
>> However, not find register from the website, not sure whether the
>> register are totally same, or there is some change.
>> Other soc from hisilicon using the same ip can share this driver.
>
> I found a list of versions under "Downloads and Documentation", but
> unfortunately the actual downloads are not accessible without a
> customer account.
>
>>> Can you find out what the Synopsys/Designware product designation for
>>> this PHY is? It would be good to rename the driver and binding
>>> if possible. I would still recommend leaving the
>>> "hisilicon,hix5hd2-sata-phy" string and the "hisilicon,peripheral-syscon"
>>> property in place, since that indicates a minor variation of the
>>> generic part.
>>
>> "hisilicon,peripheral-syscon" is privide power supply, etc.
>>
>> Do you mean change the compatible to "hisilicon,dwc-sata-phy" or
>> multiple compatible?
>
> Multiple compatible strings.
>
> "hisilicon,dwc-sata-phy" would be too generic anyway, it should include the
> name of the chip that first implements this, or the exact version of the
> IP block, preferably both.
>
> Ideally if you can find out the version that hisilicon uses, it could
> look something like
>
> compatible = "hisilicon,hi15hd2-sata-phy", "snps,dwc-sata-phy-2.3a", ""snps,dwc-sata-phy";
>
> Note also the specific version of the hisilicon chip: you must not use
> wildcards in compatible strings but should always use a real product number.
> ("1" instead of "x"). If multiple chips are mutually compatible, they
> can all use the number of the first one here.
>

Sorry for the confusion.

The phy is rather an analog controller, without standard register.
Instead, the phy interface is just some pin / analog interface.
The register is in fact hix5hd2 register, controls all the analog 
output, including reset, power, speed, para tunning.

Even the same phy is used in other soc, they can not share this driver, 
since the connection must be different, as well as internal soc register 
layout.
Only if the same controller & phy are reused in other hisilicon soc, 
this driver can be shared.

Since what we control is hix5hd2 controller itself, so it may not 
suitable to put snps here.


And about hix5hd2 name: x is not wildcard.

Currently hix5hd2 is series of hi3716c v200, hi3719c v100, hi3718c v100.
They are same soc, except minus pin assembles different.

However, not all hi37x is in this series, for example hi3716c v100 is a 
different soc.

In the future hi3719m, hi3718m may also plan to add to hix5hd2 series.
The difference will be different cpu core number, different gpu core 
number. Also use different ethernet controller.


So we may still keep "hisilicon,hix5hd2-sata-phy" unchanged.
What do you think?

Thanks
Arnd Bergmann June 27, 2014, 7:50 a.m. UTC | #7
On Friday 27 June 2014 11:37:18 zhangfei wrote:
> >
> 
> Sorry for the confusion.
> 
> The phy is rather an analog controller, without standard register.
> Instead, the phy interface is just some pin / analog interface.
> The register is in fact hix5hd2 register, controls all the analog 
> output, including reset, power, speed, para tunning.

Ok, thanks for the explanation.

> Even the same phy is used in other soc, they can not share this driver, 
> since the connection must be different, as well as internal soc register 
> layout.
> Only if the same controller & phy are reused in other hisilicon soc, 
> this driver can be shared.
> 
> Since what we control is hix5hd2 controller itself, so it may not 
> suitable to put snps here.

Makes sense.

> And about hix5hd2 name: x is not wildcard.
> 
> Currently hix5hd2 is series of hi3716c v200, hi3719c v100, hi3718c v100.
> They are same soc, except minus pin assembles different.
> 
> However, not all hi37x is in this series, for example hi3716c v100 is a 
> different soc.
> 
> In the future hi3719m, hi3718m may also plan to add to hix5hd2 series.
> The difference will be different cpu core number, different gpu core 
> number. Also use different ethernet controller.

Ah, I think you explained this before, sorry for misremembering it.
 
> So we may still keep "hisilicon,hix5hd2-sata-phy" unchanged.
> What do you think?

Yes, please keep this string, it's good.

Thanks for your patience,

	Arnd
Kishon Vijay Abraham I July 2, 2014, 11:20 a.m. UTC | #8
Hi,

On Wednesday 25 June 2014 02:44 PM, Zhangfei Gao wrote:
> From: Jiancheng Xue <xuejiancheng@huawei.com>
> 
> Add necessary binding documentation SATA PHY on Hisilicon hix5hd2 soc.
> 
> Signed-off-by: Jiancheng Xue <xuejiancheng@huawei.com>
> Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
> ---
>  .../devicetree/bindings/phy/hix5hd2-sata-phy.txt   |   22 ++++++++++++++++++++
>  1 file changed, 22 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/phy/hix5hd2-sata-phy.txt
> 
> diff --git a/Documentation/devicetree/bindings/phy/hix5hd2-sata-phy.txt b/Documentation/devicetree/bindings/phy/hix5hd2-sata-phy.txt
> new file mode 100644
> index 0000000..296168b
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/phy/hix5hd2-sata-phy.txt

Generally we have a single file for a SoC while adding phy binding
documentation. So just make it hix5hd2-phy.txt.

Thanks
Kishon
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/phy/hix5hd2-sata-phy.txt b/Documentation/devicetree/bindings/phy/hix5hd2-sata-phy.txt
new file mode 100644
index 0000000..296168b
--- /dev/null
+++ b/Documentation/devicetree/bindings/phy/hix5hd2-sata-phy.txt
@@ -0,0 +1,22 @@ 
+Hisilicon hix5hd2 SATA PHY
+-----------------------
+
+Required properties:
+- compatible: should be "hisilicon,hix5hd2-sata-phy"
+- reg: offset and length of the PHY registers
+- #phy-cells: must be 0
+Refer to phy/phy-bindings.txt for the generic PHY binding properties
+
+Optional Properties:
+- hisilicon,peripheral-syscon: phandle of syscon used to control peripheral.
+- hisilicon,power-reg: offset and bit number within peripheral-syscon,
+	register of controlling sata power supply.
+
+Example:
+	sata_phy: phy@f9900000 {
+		compatible = "hisilicon,hix5hd2-sata-phy";
+		reg = <0xf9900000 0x10000>;
+		#phy-cells = <0>;
+		hisilicon,peripheral-syscon = <&peripheral_ctrl>;
+		hisilicon,power-reg = <0x8 10>;
+	};