From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fabio Estevam Date: Wed, 10 May 2017 15:10:37 -0300 Subject: [U-Boot] [RFC] drivers: pci: imx: add imx_pcie_remove function In-Reply-To: <1494434600-24661-1-git-send-email-tharvey@gateworks.com> References: <1494434600-24661-1-git-send-email-tharvey@gateworks.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Tim, Thanks for working on this! [Adding Peter and Jagan on Cc] On Wed, May 10, 2017 at 1:43 PM, Tim Harvey wrote: > There is no dedicated reset signal wired up for the MX6QDL thus if the > bootloader enables the link we need some special handling to get the core > back into a state where it is safe to touch it for configuration. > > While there has been some special handling in the Linux kernel to do this, > it was removed in 4.11 thus we need to do it properly in the bootloader > and therefore without this if you enable PCI in the bootloader you will hang > while booting the 4.11 kernel. > > This was tested on a Gateworks Ventana board. > > TODO: what is the right arch specific place to hook the remove function? Ideally the pcie_imx.c driver should be converted to driver model and then the .remove can be simply added, just like in Barebox. Take a look at the following PCI drivers that have already been converted to the driver model to use as reference: $ git grep U_BOOT_DRIVER drivers/pci/ drivers/pci/pci-uclass.c:U_BOOT_DRIVER(pci_bridge_drv) = { drivers/pci/pci-uclass.c:U_BOOT_DRIVER(pci_generic_drv) = { drivers/pci/pci_sandbox.c:U_BOOT_DRIVER(pci_sandbox) = { drivers/pci/pci_tegra.c:U_BOOT_DRIVER(pci_tegra) = { drivers/pci/pci_x86.c:U_BOOT_DRIVER(pci_x86) = { drivers/pci/pcie_dw_mvebu.c:U_BOOT_DRIVER(pcie_dw_mvebu) = { drivers/pci/pcie_layerscape.c:U_BOOT_DRIVER(pci_layerscape) = { drivers/pci/pcie_xilinx.c:U_BOOT_DRIVER(pcie_xilinx) = {