From patchwork Mon Nov 4 18:00:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Ebalard X-Patchwork-Id: 3137001 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EB26D9F432 for ; Mon, 4 Nov 2013 18:01:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 03BDF20519 for ; Mon, 4 Nov 2013 18:01:12 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3D150204E2 for ; Mon, 4 Nov 2013 18:01:10 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VdOSY-0007Mv-Fh; Mon, 04 Nov 2013 18:01:06 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VdOSW-00020a-1Z; Mon, 04 Nov 2013 18:01:04 +0000 Received: from mic92-1-81-57-185-249.fbx.proxad.net ([81.57.185.249] helo=smtp.natisbad.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VdOST-0001z2-4p for linux-arm-kernel@lists.infradead.org; Mon, 04 Nov 2013 18:01:02 +0000 Received: by smtp.natisbad.org (Postfix, from userid 5001) id 39E2A2C073C; Mon, 4 Nov 2013 19:00:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=natisbad.org; s=mail; t=1383588034; bh=sQF9/i0C0PLWypj3jyPEhySp7Krnve66HlpzAII4kRM=; h=From:To:Cc:Subject:Date; b=zcPuoB9ClWZc19cH+rRW9QeDDU5Zz3QDliRnz/zwHgUPki4/5zXrNoDVAcf3grjkJ VHhMylgEVbhAfCgu3wgXNxjUccgOjkSRgZYfJDU0iekSQU7YQvDS0HJd/Zi+O/cyyc M1qN2N0OXOC+6A/dQgUtY2xJusT8L5RCW2YLlzbY= X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from small (localhost [127.0.0.1]) by smtp.natisbad.org (Postfix) with ESMTP id 6609C2C02FA; Mon, 4 Nov 2013 19:00:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=natisbad.org; s=mail; t=1383588012; bh=sQF9/i0C0PLWypj3jyPEhySp7Krnve66HlpzAII4kRM=; h=From:To:Cc:Subject:Date; b=xRi2F45brrQ5UzDNKgHxTsNRUU52hH6KPr5unoFYcQTWDNO4mBYaY05+aFXJdJqzL CHOingp6nir59lCplruQaag3CcdMMg5txpFot10K4/H+YP4Mvd6pmB44waTUiXDQvq DoQ+sp1fwu2iBjL9JOWzlSCj1RQiw+JXgEZ9Bjts= X-Hashcash: 1:20:131104:jason@lakedaemon.net::WL4Y5wcEwUJbel1H:00000000000000000000000000000000000000000A+bu X-Hashcash: 1:20:131104:andrew@lunn.ch::uKBV3Ki8kkmf4cAQ:00012G4 X-Hashcash: 1:20:131104:gregory.clement@free-electrons.com::qaP8inZHQed1Ev9k:0000000000000000000000000003pVt X-Hashcash: 1:20:131104:sebastian.hesselbarth@gmail.com::u/AIjQIt0UmldFpA:0000000000000000000000000000001sv/ X-Hashcash: 1:20:131104:thomas.petazzoni@free-electrons.com::rFfQnsSauX80vUiq:000000000000000000000000000Kn/ X-Hashcash: 1:20:131104:ezequiel.garcia@free-electrons.com::5qpU1xpbqo4yvycW:0000000000000000000000000000GGX X-Hashcash: 1:20:131104:linux@arm.linux.org.uk::PPfUFFYGB0FTAcMq:000000000000000000000000000000000000000AmXR X-Hashcash: 1:20:131104:linux-arm-kernel@lists.infradead.org::8xJ+OAYZz/ejxlWy:00000000000000000000000002i2y From: arno@natisbad.org (Arnaud Ebalard) To: Jason Cooper , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Thomas Petazzoni , Ezequiel Garcia Subject: [BUG?] ARM: mvebu: is second PCIe unit of Armada XP mv78230 x1 or x4? X-PGP-Key-URL: http://natisbad.org/arno@natisbad.org.asc X-Fingerprint: D3A5 B68A 839B 38A5 815A 781B B77C 0748 A7AE 341B Date: Mon, 04 Nov 2013 19:00:11 +0100 Message-ID: <87ppqgyrmc.fsf@natisbad.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131104_130101_487481_B6FD5557 X-CRM114-Status: GOOD ( 17.00 ) X-Spam-Score: -1.0 (-) Cc: Russell King , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, I am currently playing with a NETGEAR ReadyNAS 2120. It is powered by a 2-core Armada XP SoC, more precisely a 78230 (this is what NETGEAR advertises about the product; see the u-boot and /proc/cpuinfo info at the end of this message). I spent some time this week-end trying to figure out why I was unable to see the Fresco Logic FL1009 XHCI controller (PCIe Gen II x1) connected to the PCIe bus on a 3.12-rc7 with a custom .dts: Even after enabling all available ports referenced in armada-xp-mv78230.dtsi, I still only see the 2 Marvell SATA controllers (on Lane 0 and 1 of port 0) but not the FL1009. At some point, because I suspected a PCIe definition issue, I decided to modify my .dts and make it inherit from armada-xp-mv78460.dtsi with all PCIe ports enabled. At that point, here is what I got: root@thin:~# lspci 00:01.0 PCI bridge: Marvell Technology Group Ltd. Device 7846 00:02.0 PCI bridge: Marvell Technology Group Ltd. Device 7846 00:03.0 PCI bridge: Marvell Technology Group Ltd. Device 7846 00:04.0 PCI bridge: Marvell Technology Group Ltd. Device 7846 00:05.0 PCI bridge: Marvell Technology Group Ltd. Device 7846 00:06.0 PCI bridge: Marvell Technology Group Ltd. Device 7846 00:07.0 PCI bridge: Marvell Technology Group Ltd. Device 7846 00:08.0 PCI bridge: Marvell Technology Group Ltd. Device 7846 00:09.0 PCI bridge: Marvell Technology Group Ltd. Device 7846 00:0a.0 PCI bridge: Marvell Technology Group Ltd. Device 7846 01:00.0 SATA controller: Marvell Technology Group Ltd. Device 9170 (rev 12) 02:00.0 SATA controller: Marvell Technology Group Ltd. Device 9170 (rev 12) 03:00.0 Memory controller: Marvell Technology Group Ltd. Device 7846 (rev 02) 04:00.0 Memory controller: Marvell Technology Group Ltd. Device 7846 (rev 02) 05:00.0 USB controller: Fresco Logic FL1009 USB 3.0 Host Controller (rev 02) 06:00.0 Memory controller: Marvell Technology Group Ltd. Device 7846 (rev 02) 07:00.0 Memory controller: Marvell Technology Group Ltd. Device 7846 (rev 02) 08:00.0 Memory controller: Marvell Technology Group Ltd. Device 7846 (rev 02) 09:00.0 Memory controller: Marvell Technology Group Ltd. Device 7846 (rev 02) 0a:00.0 Memory controller: Marvell Technology Group Ltd. Device 7846 (rev 02) Then, I took a look at the [laconic] public documentation on the various flavours of the Armada XP (mv7823, mv78260 and mv78460) regarding PCIe aspects. I noticed that [1] reports a x1 second PCIe unit for mv78230 when [2] reports one x4 second unit for mv78230. FWIW, armada-xp-mv78230.dtsi currently states the second unit is x4/x1. [1]: http://www.marvell.com/embedded-processors/armada-xp/ [2]: http://www.marvell.com/embedded-processors/armada-xp/assets/Marvell-ArmadaXP-SoC-product%20brief.pdf I started modifying the 3.12-rc7 armada-xp-mv78230.dtsi considering [1] was right and [2] was wrong. With the attached patch, here is what I get with a .dts based on the modified armada-xp-mv78230.dtsi. Simply put, it works (can see FL1009 and use it): root@thin:~# lspci 00:01.0 PCI bridge: Marvell Technology Group Ltd. Device 7846 00:02.0 PCI bridge: Marvell Technology Group Ltd. Device 7846 00:05.0 PCI bridge: Marvell Technology Group Ltd. Device 7846 01:00.0 SATA controller: Marvell Technology Group Ltd. Device 9170 (rev 12) 02:00.0 SATA controller: Marvell Technology Group Ltd. Device 9170 (rev 12) 03:00.0 USB controller: Fresco Logic FL1009 USB 3.0 Host Controller (rev 02) At that point, my .dts contains the following: pcie-controller { status = "okay"; /* Connected to first Marvell 88SE9170 SATA controller */ pcie@1,0 { /* Port 0, Lane 0 */ status = "okay"; }; /* Connected to second Marvell 88SE9170 SATA controller */ pcie@2,0 { /* Port 0, Lane 1 */ status = "okay"; }; /* Connected to Fresco Logic FL1009 USB 3.0 controller */ pcie@5,0 { /* Port 1, Lane 0 */ status = "okay"; }; }; As I am way out of my league on the topic and do not have access to any proper documentation, can someone give me some hints (based on symptoms and working patch) on what may be happening? If I am correct on the root cause, can someone comment on the patch? Cheers, a+ For the records, here is what NETGEAR u-boot reports: U-Boot 2011.12 (Apr 09 2013 - 10:24:15) Marvell version: 2012_Q4.0 Netgear version: 04/09/2013 ReadyNAS-2120 V1.7.8 Board: DB-78460-BP rev 2.0 SoC: MV78230 B0 running 2 CPUs Custom configuration CPU: Marvell PJ4B (584) v7 (Rev 2) LE CPU 0 CPU @ 1200 [MHz] L2 @ 600 [MHz] TClock @ 250 [MHz] DDR @ 600 [MHz] DDR 32Bit Width, FastPath Memory Access DDR ECC Disabled DRAM: 2 GiB and what I get on current 3.12-rc7 kernel: / # cat /proc/cpuinfo Processor : Marvell PJ4Bv7 Processor rev 2 (v7l) processor : 0 BogoMIPS : 1196.85 processor : 1 BogoMIPS : 1196.85 Features : swp half thumb fastmult vfp edsp vfpv3 CPU implementer : 0x56 CPU architecture: 7 CPU variant : 0x2 CPU part : 0x584 CPU revision : 2 Hardware : Marvell Armada XP Development Board Revision : 0000 Serial : 0000000000000000 diff --git a/arch/arm/boot/dts/armada-xp-mv78230.dtsi b/arch/arm/boot/dts/armada-xp-mv78230.dtsi index 0358a33..9dc7381 100644 --- a/arch/arm/boot/dts/armada-xp-mv78230.dtsi +++ b/arch/arm/boot/dts/armada-xp-mv78230.dtsi @@ -47,7 +47,7 @@ /* * MV78230 has 2 PCIe units Gen2.0: One unit can be * configured as x4 or quad x1 lanes. One unit is - * x4/x1. + * x1 only. */ pcie-controller { compatible = "marvell,armada-xp-pcie"; @@ -61,10 +61,10 @@ ranges = <0x82000000 0 0x40000 MBUS_ID(0xf0, 0x01) 0x40000 0 0x00002000 /* Port 0.0 registers */ - 0x82000000 0 0x42000 MBUS_ID(0xf0, 0x01) 0x42000 0 0x00002000 /* Port 2.0 registers */ 0x82000000 0 0x44000 MBUS_ID(0xf0, 0x01) 0x44000 0 0x00002000 /* Port 0.1 registers */ 0x82000000 0 0x48000 MBUS_ID(0xf0, 0x01) 0x48000 0 0x00002000 /* Port 0.2 registers */ 0x82000000 0 0x4c000 MBUS_ID(0xf0, 0x01) 0x4c000 0 0x00002000 /* Port 0.3 registers */ + 0x82000000 0 0x80000 MBUS_ID(0xf0, 0x01) 0x80000 0 0x00002000 /* Port 1.0 registers */ 0x82000000 0x1 0 MBUS_ID(0x04, 0xe8) 0 1 0 /* Port 0.0 MEM */ 0x81000000 0x1 0 MBUS_ID(0x04, 0xe0) 0 1 0 /* Port 0.0 IO */ 0x82000000 0x2 0 MBUS_ID(0x04, 0xd8) 0 1 0 /* Port 0.1 MEM */ @@ -73,8 +73,8 @@ 0x81000000 0x3 0 MBUS_ID(0x04, 0xb0) 0 1 0 /* Port 0.2 IO */ 0x82000000 0x4 0 MBUS_ID(0x04, 0x78) 0 1 0 /* Port 0.3 MEM */ 0x81000000 0x4 0 MBUS_ID(0x04, 0x70) 0 1 0 /* Port 0.3 IO */ - 0x82000000 0x9 0 MBUS_ID(0x04, 0xf8) 0 1 0 /* Port 2.0 MEM */ - 0x81000000 0x9 0 MBUS_ID(0x04, 0xf0) 0 1 0 /* Port 2.0 IO */>; + 0x82000000 0x5 0 MBUS_ID(0x08, 0xe8) 0 1 0 /* Port 1.0 MEM */ + 0x81000000 0x5 0 MBUS_ID(0x08, 0xe0) 0 1 0 /* Port 1.0 IO */>; pcie@1,0 { device_type = "pci"; @@ -144,20 +144,20 @@ status = "disabled"; }; - pcie@9,0 { + pcie@5,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x42000 0 0x2000>; - reg = <0x4800 0 0 0 0>; + assigned-addresses = <0x82000800 0 0x80000 0 0x2000>; + reg = <0x2800 0 0 0 0>; #address-cells = <3>; #size-cells = <2>; #interrupt-cells = <1>; - ranges = <0x82000000 0 0 0x82000000 0x9 0 1 0 - 0x81000000 0 0 0x81000000 0x9 0 1 0>; + ranges = <0x82000000 0 0 0x82000000 0x5 0 1 0 + 0x81000000 0 0 0x81000000 0x5 0 1 0>; interrupt-map-mask = <0 0 0 0>; - interrupt-map = <0 0 0 0 &mpic 99>; - marvell,pcie-port = <2>; + interrupt-map = <0 0 0 0 &mpic 62>; + marvell,pcie-port = <1>; marvell,pcie-lane = <0>; - clocks = <&gateclk 26>; + clocks = <&gateclk 9>; status = "disabled"; }; };