From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752204AbcGRKHs (ORCPT ); Mon, 18 Jul 2016 06:07:48 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:58085 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751942AbcGRKHL (ORCPT ); Mon, 18 Jul 2016 06:07:11 -0400 From: Arnd Bergmann To: Thomas Petazzoni Cc: Jamie Lentin , Andrew Lunn , Florian Fainelli , Jason Cooper , devicetree@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Gregory Clement , Imre Kaloz , linux-arm-kernel@lists.infradead.org, Sebastian Hesselbarth Subject: Re: [PATCH v0 06/10] arm: orion5x: Add DT-based support for Netgear WNR854T Date: Mon, 18 Jul 2016 12:06:26 +0200 Message-ID: <1792384.6N9lHjmBFc@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-28-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <20160718114424.14a28889@free-electrons.com> References: <1468679348-10522-1-git-send-email-jm@lentin.co.uk> <6404488.GyOP57DJrV@wuerfel> <20160718114424.14a28889@free-electrons.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:kV/1/VP58fjIII5iN8LtXHVyfTyb5927QRg+IzpTTPz3XKiWpyz c/oHygIX3Ti1TNVcyoYxq4XJj8pqeb6UHxI8WrqeCDGzDa9PQT2a9fPCSt261qXlw8pooQt FcjyfL7MGCNWDOVCvB3Jum505zoyOg4huYS+hUUR/hbi/yr3biiFPbg952zsHOiyRxwZQmX A6Vd0F6k9EgjP2vsAaiew== X-UI-Out-Filterresults: notjunk:1;V01:K0:oHxBVl1c17I=:8qYlrMKphAjQJxRvx2hXww 9g+eoFh+lNLNaz0CCbpRrsqQs8hpKiwW4rzqUp17ms6wIr+gNG4RoAhcRVNFiaQHpok357fFA x2L3mJ2lZ8D3jLRQTGM+0o0e4F03JC3pfRU5hkXB+qw1YhERF1kTFtXFHw1uDKX6MKquajzOD YoCp3nSw1QUQxTsN4UUsZavMbOOBuK0I1zNCB5wJVn4HpNTap6CutjRPW1n/NHKXEDGcZvG2v 6Gq+6wD4Blui+hi/Pfv0tgLXUYwcgo+ku3DKWWBcImJkMD8CD3I5oejoGn5UTn1QICj35AakB pEkg+v5Sz3/GnEGkRC/uBR+8FLddGCjSJ2TtNrorAAXdPATXD9OkknFpnCBkYXPR7myoFhYzn 631pj31OZLAR4s+s1KccbxKLGXziTLIwn5fYhfGC+Kr0VPnrI/KqMwuXLVnvrf3vkz2A6t5E0 o9PbkTmN1SXanhNV96qNASimCPtZr6BBFJjcoNS6zdf9bRSD8YklpNPUOsbskg+idjKYvEVBH 6bxAnjrfisRSsAgE+W7uMfvLJxcr6F766G0INnasfdhblACXmaa4KhNnu8b/8CcyYkASiUMib 0QcUxjTwySTvMy06lkzZtoHQ+oDr+2L5mZrAOUZ9r/z38FV2KeDCvN46P3VkKU14roWSO5Hba Thw0r1P5uYg0YjSjVBJ0rRkvLzTrDNFG3TjEF4AQqcAg8N+ah6h7mcYkk9ydt7aRW2Jv10d23 myV/lP626pRB1xKB Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday, July 18, 2016 11:44:24 AM CEST Thomas Petazzoni wrote: > > On Sun, 17 Jul 2016 22:41:35 +0200, Arnd Bergmann wrote: > > > I would assume that the PCIe port should work out of the box with the driver > > Unfortunately, no. The PCIe on Orion5x requires a workaround for > reading/writing the PCI configuration space. Instead of doing MMIO > accesses to PCIE_CONF_ADDR_OFF / PCIE_CONF_DATA_OFF, you must map a > MBus window, which provides a memory-mapped view of the PCI > configuration space. > > Definitely not impossible to implement, but the driver doesn't work > as-is. Ok. > > We also don't seem to need any MBUS window setup for the I/O and > > memory spaces, which greatly simplifies the driver compared to the > > pci-mvebu one, it would be a fairly straightforward implementation > > based on pci-host-generic.c (which unfortunately just got way > > more complicated and might need to go on a diet). > > MBus windows are needed. See: > > mvebu_mbus_add_window_remap_by_id(ORION_MBUS_PCI_IO_TARGET, > ORION_MBUS_PCI_IO_ATTR, > ORION5X_PCI_IO_PHYS_BASE, > ORION5X_PCI_IO_SIZE, > ORION5X_PCI_IO_BUS_BASE); > mvebu_mbus_add_window_by_id(ORION_MBUS_PCI_MEM_TARGET, > ORION_MBUS_PCI_MEM_ATTR, > ORION5X_PCI_MEM_PHYS_BASE, > ORION5X_PCI_MEM_SIZE); > > in orion5x_setup_wins(). Ok, I was just looking at the wrong file, as they are set up from common.c, not pci.c. > Note that we already have some Orion5x converted to DT, and that use > PCI: board-rd88f5182.c is an example. So we could very well take Jamie > patches as-is, and move later to a DT-representation for PCI/PCIe. Ah, I thought all the DT users were moved to mach-mvebu. I agree this new patch isn't introducing anything we don't already have then, so we can just take it, but the conversion will not be nice when we do that. I was also hoping that we could get to the point where pci_common_init() is only used for legacy machines without DT and without multiplatform, it seems I missed a couple of users here. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH v0 06/10] arm: orion5x: Add DT-based support for Netgear WNR854T Date: Mon, 18 Jul 2016 12:06:26 +0200 Message-ID: <1792384.6N9lHjmBFc@wuerfel> References: <1468679348-10522-1-git-send-email-jm@lentin.co.uk> <6404488.GyOP57DJrV@wuerfel> <20160718114424.14a28889@free-electrons.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Andrew Lunn , Florian Fainelli , Jason Cooper , devicetree@vger.kernel.org, netdev@vger.kernel.org, Jamie Lentin , linux-kernel@vger.kernel.org, Gregory Clement , Imre Kaloz , linux-arm-kernel@lists.infradead.org, Sebastian Hesselbarth To: Thomas Petazzoni Return-path: In-Reply-To: <20160718114424.14a28889@free-electrons.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org List-Id: netdev.vger.kernel.org On Monday, July 18, 2016 11:44:24 AM CEST Thomas Petazzoni wrote: > > On Sun, 17 Jul 2016 22:41:35 +0200, Arnd Bergmann wrote: > > > I would assume that the PCIe port should work out of the box with the driver > > Unfortunately, no. The PCIe on Orion5x requires a workaround for > reading/writing the PCI configuration space. Instead of doing MMIO > accesses to PCIE_CONF_ADDR_OFF / PCIE_CONF_DATA_OFF, you must map a > MBus window, which provides a memory-mapped view of the PCI > configuration space. > > Definitely not impossible to implement, but the driver doesn't work > as-is. Ok. > > We also don't seem to need any MBUS window setup for the I/O and > > memory spaces, which greatly simplifies the driver compared to the > > pci-mvebu one, it would be a fairly straightforward implementation > > based on pci-host-generic.c (which unfortunately just got way > > more complicated and might need to go on a diet). > > MBus windows are needed. See: > > mvebu_mbus_add_window_remap_by_id(ORION_MBUS_PCI_IO_TARGET, > ORION_MBUS_PCI_IO_ATTR, > ORION5X_PCI_IO_PHYS_BASE, > ORION5X_PCI_IO_SIZE, > ORION5X_PCI_IO_BUS_BASE); > mvebu_mbus_add_window_by_id(ORION_MBUS_PCI_MEM_TARGET, > ORION_MBUS_PCI_MEM_ATTR, > ORION5X_PCI_MEM_PHYS_BASE, > ORION5X_PCI_MEM_SIZE); > > in orion5x_setup_wins(). Ok, I was just looking at the wrong file, as they are set up from common.c, not pci.c. > Note that we already have some Orion5x converted to DT, and that use > PCI: board-rd88f5182.c is an example. So we could very well take Jamie > patches as-is, and move later to a DT-representation for PCI/PCIe. Ah, I thought all the DT users were moved to mach-mvebu. I agree this new patch isn't introducing anything we don't already have then, so we can just take it, but the conversion will not be nice when we do that. I was also hoping that we could get to the point where pci_common_init() is only used for legacy machines without DT and without multiplatform, it seems I missed a couple of users here. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 From: arnd@arndb.de (Arnd Bergmann) Date: Mon, 18 Jul 2016 12:06:26 +0200 Subject: [PATCH v0 06/10] arm: orion5x: Add DT-based support for Netgear WNR854T In-Reply-To: <20160718114424.14a28889@free-electrons.com> References: <1468679348-10522-1-git-send-email-jm@lentin.co.uk> <6404488.GyOP57DJrV@wuerfel> <20160718114424.14a28889@free-electrons.com> Message-ID: <1792384.6N9lHjmBFc@wuerfel> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Monday, July 18, 2016 11:44:24 AM CEST Thomas Petazzoni wrote: > > On Sun, 17 Jul 2016 22:41:35 +0200, Arnd Bergmann wrote: > > > I would assume that the PCIe port should work out of the box with the driver > > Unfortunately, no. The PCIe on Orion5x requires a workaround for > reading/writing the PCI configuration space. Instead of doing MMIO > accesses to PCIE_CONF_ADDR_OFF / PCIE_CONF_DATA_OFF, you must map a > MBus window, which provides a memory-mapped view of the PCI > configuration space. > > Definitely not impossible to implement, but the driver doesn't work > as-is. Ok. > > We also don't seem to need any MBUS window setup for the I/O and > > memory spaces, which greatly simplifies the driver compared to the > > pci-mvebu one, it would be a fairly straightforward implementation > > based on pci-host-generic.c (which unfortunately just got way > > more complicated and might need to go on a diet). > > MBus windows are needed. See: > > mvebu_mbus_add_window_remap_by_id(ORION_MBUS_PCI_IO_TARGET, > ORION_MBUS_PCI_IO_ATTR, > ORION5X_PCI_IO_PHYS_BASE, > ORION5X_PCI_IO_SIZE, > ORION5X_PCI_IO_BUS_BASE); > mvebu_mbus_add_window_by_id(ORION_MBUS_PCI_MEM_TARGET, > ORION_MBUS_PCI_MEM_ATTR, > ORION5X_PCI_MEM_PHYS_BASE, > ORION5X_PCI_MEM_SIZE); > > in orion5x_setup_wins(). Ok, I was just looking at the wrong file, as they are set up from common.c, not pci.c. > Note that we already have some Orion5x converted to DT, and that use > PCI: board-rd88f5182.c is an example. So we could very well take Jamie > patches as-is, and move later to a DT-representation for PCI/PCIe. Ah, I thought all the DT users were moved to mach-mvebu. I agree this new patch isn't introducing anything we don't already have then, so we can just take it, but the conversion will not be nice when we do that. I was also hoping that we could get to the point where pci_common_init() is only used for legacy machines without DT and without multiplatform, it seems I missed a couple of users here. Arnd