Patchwork arm: kirkwood: convert NETGEAR ReadyNAS Duo v2 to use DT for the PCIe interface

login
register
mail settings
Submitter Jason
Date May 29, 2013, 11:48 a.m.
Message ID <20130529114846.GQ31290@titan.lakedaemon.net>
Download mbox | patch
Permalink /patch/247252/
State New
Headers show

Comments

Jason - May 29, 2013, 11:48 a.m.
On Wed, May 29, 2013 at 12:15:09AM +0200, Arnaud Ebalard wrote:
> Hi Jason and Thomas,
> 
> Thomas, I am following your work on PCIe support for a .dts file I am
> working on for (Armada 370-based) Netgear ReadyNAS 102 and noticed your
> set of patches to convert kirkwood-based boards to use it in order to
> simplify/remove board specific code.
> 
> Jason, I gave your associated branch (jcooper/mvebu-next/pcie) a try
> with following patch applied and can confirm USB 3.0 host controller
> (connected to PCIe bus) is usable on Netgear ReadyNAS *Duo v2*
> (88f6282-based brother of the 102).
> 
> Note that I had to s/of_pci_range_parser()/of_pci_range_parser_init()/
> in drivers/pci/host/pci-mvebu.c to compile the kernel (this may already
> have been fixed already):
> 
> CHK     kernel/config_data.h
> drivers/pci/host/pci-mvebu.c: In function ‘mvebu_pcie_probe’:
> drivers/pci/host/pci-mvebu.c:742:2: error: implicit declaration of function ‘of_pci_range_parser’ [-Werror=implicit-function-declaration]
> cc1: some warnings being treated as errors
> make[3]: *** [drivers/pci/host/pci-mvebu.o] Error 1
> make[2]: *** [drivers/pci/host] Error 2
> make[1]: *** [drivers/pci] Error 2
> make[1]: *** Waiting for unfinished jobs....
> 
> Can one of you take the patch below into account? Or 
> 
> Cheers,
> 
> a+
> 
> Signed-off-by: Arnaud Ebalard <arno@natisbad.org>
> ---
>  arch/arm/boot/dts/kirkwood-netgear_readynas_duo_v2.dts |    8 ++++++++
>  arch/arm/mach-kirkwood/board-readynas.c                |    1 -
>  2 files changed, 8 insertions(+), 1 deletion(-)

Hey, I had a little time to kill, so I went ahead and fixed this up.
Let me know if this looks ok.  I've applied it to mvebu/pcie_kirkwood,
so you should just be able to pull that and test it.  I'll push it up to
arm-soc in a week or so.

thx,

Jason.

---->8-----
commit 6bd98481ab346964344e05a041f35ff83cb3d00c
Author: Arnaud Ebalard <arno@natisbad.org>
Date:   Wed May 29 11:37:52 2013 +0000

    arm: kirkwood: NETGEAR ReadyNAS Duo v2 init PCIe via DT
    
    Now that the mvebu-pcie driver is in place and enabled for kirkwood,
    convert to initializing PCIe via devicetree.
    
    Signed-off-by: Arnaud Ebalard <arno@natisbad.org>
    Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Arnaud Ebalard - May 29, 2013, 10 p.m.
Hi Jason,

Jason Cooper <jason@lakedaemon.net> writes:

>>  arch/arm/boot/dts/kirkwood-netgear_readynas_duo_v2.dts |    8 ++++++++
>>  arch/arm/mach-kirkwood/board-readynas.c                |    1 -
>>  2 files changed, 8 insertions(+), 1 deletion(-)
>
> Hey, I had a little time to kill, so I went ahead and fixed this up.
> Let me know if this looks ok.  I've applied it to mvebu/pcie_kirkwood,
> so you should just be able to pull that and test it.  I'll push it up to
> arm-soc in a week or so.

Pulled the branch, compiled and tested it: USB 3.0 host controller
connected to PCIe bus works as expected.

Thanks for your work,

Cheers,

a+

Patch

diff --git a/arch/arm/boot/dts/kirkwood-netgear_readynas_duo_v2.dts b/arch/arm/boot/dts/kirkwood-netgear_readynas_duo_v2.dts
index 1ca66ab..0f852b4 100644
--- a/arch/arm/boot/dts/kirkwood-netgear_readynas_duo_v2.dts
+++ b/arch/arm/boot/dts/kirkwood-netgear_readynas_duo_v2.dts
@@ -111,6 +111,14 @@ 
 			status = "okay";
 			nr-ports = <2>;
 		};
+
+		pcie-controller {
+			status = "okay";
+
+			pcie@1,0 {
+				status = "okay";
+			};
+		};
 	};
 
 	gpio-leds {
diff --git a/arch/arm/mach-kirkwood/board-readynas.c b/arch/arm/mach-kirkwood/board-readynas.c
index fb42c20..341b82d 100644
--- a/arch/arm/mach-kirkwood/board-readynas.c
+++ b/arch/arm/mach-kirkwood/board-readynas.c
@@ -24,5 +24,4 @@  static struct mv643xx_eth_platform_data netgear_readynas_ge00_data = {
 void __init netgear_readynas_init(void)
 {
 	kirkwood_ge00_init(&netgear_readynas_ge00_data);
-	kirkwood_pcie_init(KW_PCIE0);
 }