From patchwork Thu Jun 18 10:18:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Krzysztof_Ha=C5=82asa?= X-Patchwork-Id: 6635001 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EE839C0020 for ; Thu, 18 Jun 2015 10:21:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1C26F20638 for ; Thu, 18 Jun 2015 10:21:17 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9287020621 for ; Thu, 18 Jun 2015 10:21:15 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z5Wuo-0001kq-2X; Thu, 18 Jun 2015 10:19:22 +0000 Received: from ni.piap.pl ([195.187.100.4]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z5Wuh-0001Nb-OX for linux-arm-kernel@lists.infradead.org; Thu, 18 Jun 2015 10:19:17 +0000 Received: from t19.piap.pl (OSB1819.piap.pl [10.0.9.19]) by ni.piap.pl (Postfix) with ESMTP id EA204440E6A; Thu, 18 Jun 2015 12:18:28 +0200 (CEST) From: khalasa@piap.pl (Krzysztof =?utf-8?Q?Ha=C5=82asa?=) To: linux-arm-kernel Subject: IMX6 - PCIe device tree assignments Date: Thu, 18 Jun 2015 12:18:28 +0200 Message-ID: MIME-Version: 1.0 X-KLMS-Rule-ID: 1 X-KLMS-Message-Action: clean X-KLMS-AntiSpam-Lua-Profiles: 79487 [Jun 18 2015] X-KLMS-AntiSpam-Version: 5.5.6 X-KLMS-AntiSpam-Envelope-From: khalasa@piap.pl X-KLMS-AntiSpam-Rate: 0 X-KLMS-AntiSpam-Status: not_detected X-KLMS-AntiSpam-Method: none X-KLMS-AntiSpam-Moebius-Timestamps: 3605510, 3605599, 3605590 X-KLMS-AntiSpam-Info: LuaCore: 228 2015-06-17_13-23-01 c412aec3ada573ff202dfe9359ab5b063f1079b5, Auth:dkim=none X-KLMS-AntiSpam-Interceptor-Info: scan successful X-KLMS-AntiPhishing: Clean, 2015/06/17 15:31:45 X-KLMS-AntiVirus: Kaspersky Security 8.0 for Linux Mail Server, version 8.0.1.721, bases: 2015/06/18 05:54:00 #8383108 X-KLMS-AntiVirus-Status: Clean, skipped X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150618_031916_171154_44BC3F79 X-CRM114-Status: GOOD ( 10.02 ) X-Spam-Score: -1.3 (-) Cc: Tim Harvey X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 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-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hello, The situation: Gateworks Ventana with IMX6q, 8-port PCIe bridge (PLX tech PEX 8609), two PCIe devices behind the bridge (one of those is an Ethernet controller). The Ethernet controller lacks EEPROM/etc. and it's MAC address has to be initialized using the device tree. IMX6 [1] PEX [2] -[0000:00]---00.0-[01-0a]--+-00.0-[02-0a]--+-01.0-[03]-- | +-04.0-[04]----00.0 | +-05.0-[05]-- | +-06.0-[06-07]----00.0-[07]-- | +-07.0-[08]----00.0 | +-08.0-[09]----00.0 Ethernet | \-09.0-[0a]-- \-00.1 (PEX special device) Gateworks have the following patch for this (and the MAC address assignment works): Unfortunately the patch has a side effect - it messes up the PCIe interrupts. Basically all PCI IRQs except for the special device handled internally by the PEX 8609 bridge are set to 155: good bad (with patch) 00:00.0 PCI bridge: (IMX6 host bridge) Interrupt: pin A routed to IRQ 155 01:00.0 PCI bridge: PEX-8609 Interrupt: pin A routed to IRQ 155 01:00.1 System peripheral: PEX-8609 Interrupt: pin B routed to IRQ 154 (not changed) 02:01.0 PCI bridge: PEX-8609 Interrupt: pin A routed to IRQ 154 -> 155 02:04.0 PCI bridge: PEX-8609 Interrupt: pin A routed to IRQ 155 02:05.0 PCI bridge: PEX-8609 Interrupt: pin A routed to IRQ 154 -> 155 02:06.0 PCI bridge: PEX-8609 Interrupt: pin A routed to IRQ 153 -> 155 02:07.0 PCI bridge: PEX-8609 Interrupt: pin A routed to IRQ 152 -> 155 02:08.0 PCI bridge: PEX-8609 Interrupt: pin A routed to IRQ 155 02:09.0 PCI bridge: PEX-8609 Interrupt: pin A routed to IRQ 154 -> 155 04:00.0 Techwell Device 6864 Interrupt: pin A routed to IRQ 155 06:00.0 PCI bridge 08:00.0 Techwell Device 6869 Interrupt: pin A routed to IRQ 152 -> 155 09:00.0 Ethernet controller Interrupt: pin A routed to IRQ 155 This is the case with v3.18 + the Ventana patchset from Gateworks, and with vanilla v4.0 with only the above DT patch applied. The question is: what's wrong in the patch, and how do I fix it? --- Krzysztof Halasa Industrial Research Institute for Automation and Measurements PIAP Al. Jerozolimskie 202, 02-486 Warsaw, Poland --- a/arch/arm/boot/dts/imx6qdl-gw54xx.dtsi +++ b/arch/arm/boot/dts/imx6qdl-gw54xx.dtsi @@ -369,8 +369,42 @@ reset-gpio = <&gpio1 29 GPIO_ACTIVE_LOW>; status = "okay"; - eth1: sky2@8 { /* MAC/PHY on bus 8 */ - compatible = "marvell,sky2"; + pcie@0,0 { + /* 00:00.0 0604: 16c3:abcd root host-bridge */ + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + reg = <0x0 0 0 0 0>; + + pcie@0,0 { + /* 01:00.0 0604: 10b5:8609 PEX switch bridge */ + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + reg = <0x0 0 0 0 0>; + + /* + * GigE PCI dev node needs to be defined so that enet + * driver can use it to obtain its boot-loader + * specified MAC + */ + pcie@8,0 { + /* 02:08.0 0604: 10b5:8609: PEX port bridge */ + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + reg = <0x4000 0 0 0 0>; + + eth1: pci@0,0 { + /* 08:00.0 0200: 11ab:4380: GigE */ + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + reg = <0x0 0 0 0 0>; + compatible = "marvell,sky2"; + }; + }; + }; }; };