diff mbox

[v5,1/1] arm64: dts: Add the arasan sdhc nodes in apm-storm.dtsi.

Message ID 1430817426-5241-2-git-send-email-stripathi@apm.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Suman Tripathi May 5, 2015, 9:17 a.m. UTC
This patch adds the arasan sdhc nodes to reuse the of-arasan
driver for APM X-Gene SoC.

Signed-off-by: Suman Tripathi <stripathi@apm.com>
---
 arch/arm64/boot/dts/apm/apm-mustang.dts |  4 +++
 arch/arm64/boot/dts/apm/apm-storm.dtsi  | 44 +++++++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+)

--
1.8.2.1

Comments

Ulf Hansson May 5, 2015, 10:34 a.m. UTC | #1
On 5 May 2015 at 11:17, Suman Tripathi <stripathi@apm.com> wrote:
> This patch adds the arasan sdhc nodes to reuse the of-arasan
> driver for APM X-Gene SoC.
>
> Signed-off-by: Suman Tripathi <stripathi@apm.com>

I consider this one acked by Arnd, due to:
http://www.spinics.net/lists/arm-kernel/msg415634.html

Thus applied to my mmc tree.

Thanks!

Kind regards
Uffe

> ---
>  arch/arm64/boot/dts/apm/apm-mustang.dts |  4 +++
>  arch/arm64/boot/dts/apm/apm-storm.dtsi  | 44 +++++++++++++++++++++++++++++++++
>  2 files changed, 48 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/apm/apm-mustang.dts b/arch/arm64/boot/dts/apm/apm-mustang.dts
> index 83578e7..4cc5d07 100644
> --- a/arch/arm64/boot/dts/apm/apm-mustang.dts
> +++ b/arch/arm64/boot/dts/apm/apm-mustang.dts
> @@ -52,3 +52,7 @@
>  &xgenet {
>         status = "ok";
>  };
> +
> +&sdhc0 {
> +       status = "ok";
> +};
> diff --git a/arch/arm64/boot/dts/apm/apm-storm.dtsi b/arch/arm64/boot/dts/apm/apm-storm.dtsi
> index c8d3e0e..240c793 100644
> --- a/arch/arm64/boot/dts/apm/apm-storm.dtsi
> +++ b/arch/arm64/boot/dts/apm/apm-storm.dtsi
> @@ -145,6 +145,40 @@
>                                 clock-output-names = "socplldiv2";
>                         };
>
> +                       ahbclk: ahbclk@1f2ac000 {
> +                               compatible = "apm,xgene-device-clock";
> +                               #clock-cells = <1>;
> +                               clocks = <&socplldiv2 0>;
> +                               reg = <0x0 0x1f2ac000 0x0 0x1000
> +                                       0x0 0x17000000 0x0 0x2000>;
> +                               reg-names = "csr-reg", "div-reg";
> +                               csr-offset = <0x0>;
> +                               csr-mask = <0x1>;
> +                               enable-offset = <0x8>;
> +                               enable-mask = <0x1>;
> +                               divider-offset = <0x164>;
> +                               divider-width = <0x5>;
> +                               divider-shift = <0x0>;
> +                               clock-output-names = "ahbclk";
> +                       };
> +
> +                       sdioclk: sdioclk@1f2ac000 {
> +                               compatible = "apm,xgene-device-clock";
> +                               #clock-cells = <1>;
> +                               clocks = <&socplldiv2 0>;
> +                               reg = <0x0 0x1f2ac000 0x0 0x1000
> +                                       0x0 0x17000000 0x0 0x2000>;
> +                               reg-names = "csr-reg", "div-reg";
> +                               csr-offset = <0x0>;
> +                               csr-mask = <0x2>;
> +                               enable-offset = <0x8>;
> +                               enable-mask = <0x2>;
> +                               divider-offset = <0x178>;
> +                               divider-width = <0x8>;
> +                               divider-shift = <0x0>;
> +                               clock-output-names = "sdioclk";
> +                       };
> +
>                         qmlclk: qmlclk {
>                                 compatible = "apm,xgene-device-clock";
>                                 #clock-cells = <1>;
> @@ -533,6 +567,16 @@
>                         interrupts = <0x0 0x4f 0x4>;
>                 };
>
> +               sdhc0: sdhc@1c000000 {
> +                       device_type = "sdhc";
> +                       compatible = "arasan,sdhci-4.9a";
> +                       reg = <0x0 0x1c000000 0x0 0x100>;
> +                       interrupts = <0x0 0x49 0x4>;
> +                       dma-coherent;
> +                       clock-names = "clk_xin", "clk_ahb";
> +                       clocks = <&sdioclk 0>, <&ahbclk 0>;
> +               };
> +
>                 phy1: phy@1f21a000 {
>                         compatible = "apm,xgene-phy";
>                         reg = <0x0 0x1f21a000 0x0 0x100>;
> --
> 1.8.2.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rob Herring May 5, 2015, 7:41 p.m. UTC | #2
On Tue, May 5, 2015 at 4:17 AM, Suman Tripathi <stripathi@apm.com> wrote:
> This patch adds the arasan sdhc nodes to reuse the of-arasan
> driver for APM X-Gene SoC.
>
> Signed-off-by: Suman Tripathi <stripathi@apm.com>
> ---
>  arch/arm64/boot/dts/apm/apm-mustang.dts |  4 +++
>  arch/arm64/boot/dts/apm/apm-storm.dtsi  | 44 +++++++++++++++++++++++++++++++++
>  2 files changed, 48 insertions(+)

[...]

> @@ -533,6 +567,16 @@
>                         interrupts = <0x0 0x4f 0x4>;
>                 };
>
> +               sdhc0: sdhc@1c000000 {
> +                       device_type = "sdhc";

device_type generally should not be used (there are a few exceptions).

> +                       compatible = "arasan,sdhci-4.9a";

If you ever have an integration or xgene specific problem, you need a
chip specific compatible.

Rob
Suman Tripathi May 6, 2015, 5:11 a.m. UTC | #3
On Wed, May 6, 2015 at 1:11 AM, Rob Herring <robherring2@gmail.com> wrote:
> On Tue, May 5, 2015 at 4:17 AM, Suman Tripathi <stripathi@apm.com> wrote:
>> This patch adds the arasan sdhc nodes to reuse the of-arasan
>> driver for APM X-Gene SoC.
>>
>> Signed-off-by: Suman Tripathi <stripathi@apm.com>
>> ---
>>  arch/arm64/boot/dts/apm/apm-mustang.dts |  4 +++
>>  arch/arm64/boot/dts/apm/apm-storm.dtsi  | 44 +++++++++++++++++++++++++++++++++
>>  2 files changed, 48 insertions(+)
>
> [...]
>
>> @@ -533,6 +567,16 @@
>>                         interrupts = <0x0 0x4f 0x4>;
>>                 };
>>
>> +               sdhc0: sdhc@1c000000 {
>> +                       device_type = "sdhc";
>
> device_type generally should not be used (there are a few exceptions).

Okay !!

>
>> +                       compatible = "arasan,sdhci-4.9a";
>
> If you ever have an integration or xgene specific problem, you need a
> chip specific compatible.

No it;s a IP level problem. If it's a SoC level then probably we
cann't reuse the existing  arasan version. If anything happens
in future we might need our own version.

>
> Rob
Arnd Bergmann May 6, 2015, 7:31 a.m. UTC | #4
On Wednesday 06 May 2015 10:41:07 Suman Tripathi wrote:
> >> @@ -533,6 +567,16 @@
> >>                         interrupts = <0x0 0x4f 0x4>;
> >>                 };
> >>
> >> +               sdhc0: sdhc@1c000000 {
> >> +                       device_type = "sdhc";
> >
> > device_type generally should not be used (there are a few exceptions).
> 
> Okay !!
> 

While we're at it, please change sdhc@1c000000 to mmc@1c000000.
Even though Linux does not care, we try to use the standard device
names for consistency.

	Arnd
Michal Simek May 6, 2015, 7:45 a.m. UTC | #5
On 05/06/2015 09:31 AM, Arnd Bergmann wrote:
> On Wednesday 06 May 2015 10:41:07 Suman Tripathi wrote:
>>>> @@ -533,6 +567,16 @@
>>>>                         interrupts = <0x0 0x4f 0x4>;
>>>>                 };
>>>>
>>>> +               sdhc0: sdhc@1c000000 {
>>>> +                       device_type = "sdhc";
>>>
>>> device_type generally should not be used (there are a few exceptions).
>>
>> Okay !!
>>
> 
> While we're at it, please change sdhc@1c000000 to mmc@1c000000.
> Even though Linux does not care, we try to use the standard device
> names for consistency.

Do we have a list of these names somewhere?
Normally I do use ePARP - generic names recommendation but mmc or sdhci
are not listed there.
Both combination mmc@ or sdhci@ are used in the kernel.

On zynq and zynqmp we do use shdci@.

Thanks,
Michal
Arnd Bergmann May 6, 2015, 8:40 a.m. UTC | #6
On Wednesday 06 May 2015 09:45:15 Michal Simek wrote:
> On 05/06/2015 09:31 AM, Arnd Bergmann wrote:
> > On Wednesday 06 May 2015 10:41:07 Suman Tripathi wrote:
> >>>> @@ -533,6 +567,16 @@
> >>>>                         interrupts = <0x0 0x4f 0x4>;
> >>>>                 };
> >>>>
> >>>> +               sdhc0: sdhc@1c000000 {
> >>>> +                       device_type = "sdhc";
> >>>
> >>> device_type generally should not be used (there are a few exceptions).
> >>
> >> Okay !!
> >>
> > 
> > While we're at it, please change sdhc@1c000000 to mmc@1c000000.
> > Even though Linux does not care, we try to use the standard device
> > names for consistency.
> 
> Do we have a list of these names somewhere?
> Normally I do use ePARP - generic names recommendation but mmc or sdhci
> are not listed there.
> Both combination mmc@ or sdhci@ are used in the kernel.
> 
> On zynq and zynqmp we do use shdci@.
> 

Ah, I thought ePAPR listed mmc already. Using "sdhci" is a little too
specific here, since a lot of mmc hosts are not sdhci compliant, and
"sdhc" is completely wrong, because that identifies a specific card
type, but a host that supports SDHC cards will generally also work
with SD (less than 4GB) or SDXC (more than 48GB) cards.

	Arnd
Ulf Hansson May 6, 2015, 9:49 a.m. UTC | #7
On 5 May 2015 at 12:34, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> On 5 May 2015 at 11:17, Suman Tripathi <stripathi@apm.com> wrote:
>> This patch adds the arasan sdhc nodes to reuse the of-arasan
>> driver for APM X-Gene SoC.
>>
>> Signed-off-by: Suman Tripathi <stripathi@apm.com>
>
> I consider this one acked by Arnd, due to:
> http://www.spinics.net/lists/arm-kernel/msg415634.html
>
> Thus applied to my mmc tree.

According to follow up comments, I have dropped this patch from my tree for now.

Kind regards
Uffe
Suman Tripathi May 6, 2015, 11:57 a.m. UTC | #8
On Wed, May 6, 2015 at 2:10 PM, Arnd Bergmann <arnd@arndb.de> wrote:

> On Wednesday 06 May 2015 09:45:15 Michal Simek wrote:
> > On 05/06/2015 09:31 AM, Arnd Bergmann wrote:
> > > On Wednesday 06 May 2015 10:41:07 Suman Tripathi wrote:
> > >>>> @@ -533,6 +567,16 @@
> > >>>>                         interrupts = <0x0 0x4f 0x4>;
> > >>>>                 };
> > >>>>
> > >>>> +               sdhc0: sdhc@1c000000 {
> > >>>> +                       device_type = "sdhc";
> > >>>
> > >>> device_type generally should not be used (there are a few
> exceptions).
> > >>
> > >> Okay !!
> > >>
> > >
> > > While we're at it, please change sdhc@1c000000 to mmc@1c000000.
> > > Even though Linux does not care, we try to use the standard device
> > > names for consistency.
> >
> > Do we have a list of these names somewhere?
> > Normally I do use ePARP - generic names recommendation but mmc or sdhci
> > are not listed there.
> > Both combination mmc@ or sdhci@ are used in the kernel.
> >
> > On zynq and zynqmp we do use shdci@.
> >
>
> Ah, I thought ePAPR listed mmc already. Using "sdhci" is a little too
> specific here, since a lot of mmc hosts are not sdhci compliant, and
> "sdhc" is completely wrong, because that identifies a specific card
> type, but a host that supports SDHC cards will generally also work
> with SD (less than 4GB) or SDXC (more than 48GB) cards.
>

Agree on this . Will change it.

>
>         Arnd
>
Suman Tripathi May 6, 2015, 12:01 p.m. UTC | #9
Hi Arnd,

On Wed, May 6, 2015 at 5:27 PM, Suman Tripathi <stripathi@apm.com> wrote:

>
>
> On Wed, May 6, 2015 at 2:10 PM, Arnd Bergmann <arnd@arndb.de> wrote:
>
>> On Wednesday 06 May 2015 09:45:15 Michal Simek wrote:
>> > On 05/06/2015 09:31 AM, Arnd Bergmann wrote:
>> > > On Wednesday 06 May 2015 10:41:07 Suman Tripathi wrote:
>> > >>>> @@ -533,6 +567,16 @@
>> > >>>>                         interrupts = <0x0 0x4f 0x4>;
>> > >>>>                 };
>> > >>>>
>> > >>>> +               sdhc0: sdhc@1c000000 {
>> > >>>> +                       device_type = "sdhc";
>> > >>>
>> > >>> device_type generally should not be used (there are a few
>> exceptions).
>> > >>
>> > >> Okay !!
>> > >>
>> > >
>> > > While we're at it, please change sdhc@1c000000 to mmc@1c000000.
>> > > Even though Linux does not care, we try to use the standard device
>> > > names for consistency.
>> >
>> > Do we have a list of these names somewhere?
>> > Normally I do use ePARP - generic names recommendation but mmc or sdhci
>> > are not listed there.
>> > Both combination mmc@ or sdhci@ are used in the kernel.
>> >
>> > On zynq and zynqmp we do use shdci@.
>> >
>>
>> Ah, I thought ePAPR listed mmc already. Using "sdhci" is a little too
>> specific here, since a lot of mmc hosts are not sdhci compliant, and
>> "sdhc" is completely wrong, because that identifies a specific card
>> type, but a host that supports SDHC cards will generally also work
>> with SD (less than 4GB) or SDXC (more than 48GB) cards.
>>
>
> Agree on this . Will change it.
>

One more point as we are resuing the arasan driver,  is it compulsory to
use the name used in binding info
for arasan ?? It is sdhci for arasan.


>
>>         Arnd
>>
>
>
>
> --
> Thanks,
> with regards,
> Suman Tripathi
>
Michal Simek May 6, 2015, 12:41 p.m. UTC | #10
On 05/06/2015 10:40 AM, Arnd Bergmann wrote:
> On Wednesday 06 May 2015 09:45:15 Michal Simek wrote:
>> On 05/06/2015 09:31 AM, Arnd Bergmann wrote:
>>> On Wednesday 06 May 2015 10:41:07 Suman Tripathi wrote:
>>>>>> @@ -533,6 +567,16 @@
>>>>>>                         interrupts = <0x0 0x4f 0x4>;
>>>>>>                 };
>>>>>>
>>>>>> +               sdhc0: sdhc@1c000000 {
>>>>>> +                       device_type = "sdhc";
>>>>>
>>>>> device_type generally should not be used (there are a few exceptions).
>>>>
>>>> Okay !!
>>>>
>>>
>>> While we're at it, please change sdhc@1c000000 to mmc@1c000000.
>>> Even though Linux does not care, we try to use the standard device
>>> names for consistency.
>>
>> Do we have a list of these names somewhere?
>> Normally I do use ePARP - generic names recommendation but mmc or sdhci
>> are not listed there.
>> Both combination mmc@ or sdhci@ are used in the kernel.
>>
>> On zynq and zynqmp we do use shdci@.
>>
> 
> Ah, I thought ePAPR listed mmc already. Using "sdhci" is a little too
> specific here, since a lot of mmc hosts are not sdhci compliant, and
> "sdhc" is completely wrong, because that identifies a specific card
> type, but a host that supports SDHC cards will generally also work
> with SD (less than 4GB) or SDXC (more than 48GB) cards.

Yes "sdhc" is completely wrong.

Based on our datasheet(also version used on Zynq and ZynqMP) this IP is
compliant with SD HC 3.00, SDIO 3.0, SD MC 3.01 SD MCS 1.01, MMC 4.51.
Not sure about the version which they use.
Also not sure which spec the IP should have to be able to say that we
can use sdhci name. Do you have exact SPEC name?

Thanks,
Michal
Suman Tripathi May 6, 2015, 12:47 p.m. UTC | #11
On Wed, May 6, 2015 at 6:11 PM, Michal Simek <michal.simek@xilinx.com>
wrote:

> On 05/06/2015 10:40 AM, Arnd Bergmann wrote:
> > On Wednesday 06 May 2015 09:45:15 Michal Simek wrote:
> >> On 05/06/2015 09:31 AM, Arnd Bergmann wrote:
> >>> On Wednesday 06 May 2015 10:41:07 Suman Tripathi wrote:
> >>>>>> @@ -533,6 +567,16 @@
> >>>>>>                         interrupts = <0x0 0x4f 0x4>;
> >>>>>>                 };
> >>>>>>
> >>>>>> +               sdhc0: sdhc@1c000000 {
> >>>>>> +                       device_type = "sdhc";
> >>>>>
> >>>>> device_type generally should not be used (there are a few
> exceptions).
> >>>>
> >>>> Okay !!
> >>>>
> >>>
> >>> While we're at it, please change sdhc@1c000000 to mmc@1c000000.
> >>> Even though Linux does not care, we try to use the standard device
> >>> names for consistency.
> >>
> >> Do we have a list of these names somewhere?
> >> Normally I do use ePARP - generic names recommendation but mmc or sdhci
> >> are not listed there.
> >> Both combination mmc@ or sdhci@ are used in the kernel.
> >>
> >> On zynq and zynqmp we do use shdci@.
> >>
> >
> > Ah, I thought ePAPR listed mmc already. Using "sdhci" is a little too
> > specific here, since a lot of mmc hosts are not sdhci compliant, and
> > "sdhc" is completely wrong, because that identifies a specific card
> > type, but a host that supports SDHC cards will generally also work
> > with SD (less than 4GB) or SDXC (more than 48GB) cards.
>
> Yes "sdhc" is completely wrong.
>

But spec name in search engine's gives  SDHC 3.0 as general.

>
> Based on our datasheet(also version used on Zynq and ZynqMP) this IP is
> compliant with SD HC 3.00, SDIO 3.0, SD MC 3.01 SD MCS 1.01, MMC 4.51.
> Not sure about the version which they use.
> Also not sure which spec the IP should have to be able to say that we
> can use sdhci name. Do you have exact SPEC name?
>

I also think sdhci because the binding is sdhci written by Arasan. Anyway I
will change to sdhci.

>
> Thanks,
> Michal
>
>
diff mbox

Patch

diff --git a/arch/arm64/boot/dts/apm/apm-mustang.dts b/arch/arm64/boot/dts/apm/apm-mustang.dts
index 83578e7..4cc5d07 100644
--- a/arch/arm64/boot/dts/apm/apm-mustang.dts
+++ b/arch/arm64/boot/dts/apm/apm-mustang.dts
@@ -52,3 +52,7 @@ 
 &xgenet {
 	status = "ok";
 };
+
+&sdhc0 {
+	status = "ok";
+};
diff --git a/arch/arm64/boot/dts/apm/apm-storm.dtsi b/arch/arm64/boot/dts/apm/apm-storm.dtsi
index c8d3e0e..240c793 100644
--- a/arch/arm64/boot/dts/apm/apm-storm.dtsi
+++ b/arch/arm64/boot/dts/apm/apm-storm.dtsi
@@ -145,6 +145,40 @@ 
 				clock-output-names = "socplldiv2";
 			};

+			ahbclk: ahbclk@1f2ac000 {
+				compatible = "apm,xgene-device-clock";
+				#clock-cells = <1>;
+				clocks = <&socplldiv2 0>;
+				reg = <0x0 0x1f2ac000 0x0 0x1000
+					0x0 0x17000000 0x0 0x2000>;
+				reg-names = "csr-reg", "div-reg";
+				csr-offset = <0x0>;
+				csr-mask = <0x1>;
+				enable-offset = <0x8>;
+				enable-mask = <0x1>;
+				divider-offset = <0x164>;
+				divider-width = <0x5>;
+				divider-shift = <0x0>;
+				clock-output-names = "ahbclk";
+			};
+
+			sdioclk: sdioclk@1f2ac000 {
+				compatible = "apm,xgene-device-clock";
+				#clock-cells = <1>;
+				clocks = <&socplldiv2 0>;
+				reg = <0x0 0x1f2ac000 0x0 0x1000
+					0x0 0x17000000 0x0 0x2000>;
+				reg-names = "csr-reg", "div-reg";
+				csr-offset = <0x0>;
+				csr-mask = <0x2>;
+				enable-offset = <0x8>;
+				enable-mask = <0x2>;
+				divider-offset = <0x178>;
+				divider-width = <0x8>;
+				divider-shift = <0x0>;
+				clock-output-names = "sdioclk";
+			};
+
 			qmlclk: qmlclk {
 				compatible = "apm,xgene-device-clock";
 				#clock-cells = <1>;
@@ -533,6 +567,16 @@ 
 			interrupts = <0x0 0x4f 0x4>;
 		};

+		sdhc0: sdhc@1c000000 {
+			device_type = "sdhc";
+			compatible = "arasan,sdhci-4.9a";
+			reg = <0x0 0x1c000000 0x0 0x100>;
+			interrupts = <0x0 0x49 0x4>;
+			dma-coherent;
+			clock-names = "clk_xin", "clk_ahb";
+			clocks = <&sdioclk 0>, <&ahbclk 0>;
+		};
+
 		phy1: phy@1f21a000 {
 			compatible = "apm,xgene-phy";
 			reg = <0x0 0x1f21a000 0x0 0x100>;