summaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci-imx6.c
Commit message (Collapse)AuthorAgeFilesLines
* driver: replace dev_request_mem_region with dev_request_mem_resourceSascha Hauer2016-03-071-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dev_request_mem_region doesn't work properly one some SoCs on which PTR_ERR() values clash with valid return values from dev_request_mem_region. Replace them with dev_request_mem_resource where possible. This patch has been generated with the following semantic patch: // <smpl> @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) { ... - return PTR_ERR(io); -} + return PTR_ERR(iores); +} +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) - return PTR_ERR(io); -} + return PTR_ERR(iores); +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { - ret = PTR_ERR(io); +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) { + ret = PTR_ERR(iores); ... } +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) + return PTR_ERR(iores); +io = IOMEM(iores->start); ...+> } @@ identifier func; @@ func(...) { <+... struct resource *iores; -struct resource *iores; ...+> } // </smpl> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* PCI: imx6: properly shut down core when leaving bareboxLucas Stach2016-01-081-0/+27
| | | | | | | | | | | | As the i.MX6 PCIe core doesn't have a software reachable reset wired up, it's hard for any driver to get the core into a known good state. To make it easier for whatever software follows barebox, bring back the core into a safe state before leaving barebox. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i.MX6: pci: Avoid aborts when asserting PCIe resetAndrey Smirnov2016-01-081-0/+4
| | | | | | | | | | | | | | | | | | | | When booting Barebox in the HW environment where PCIe core has been used but not properly shut down, writing to PCIE_PL_PFLR in imx6_pcie_assert_core_reset would cause data abort exception. The problem can be easily reproduced on a i.MX6 based board with PCIe slot populated with some device by doing: > bootm -f -e 0x1050 <your board's>.img Ignoring this exception seem to allow PCIe core to successfully initialize and enumerate devices properly. This is also how Linux Kernel version of the driver handles this situation -- it installs dummy no-op abort handler at the beginning of device's probing. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Reviewed-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i.MX6: pci: Reconcile imx6_pcie_start_link with the kernel codeAndrey Smirnov2016-01-081-16/+26
| | | | | | | | | | | Reconcile imx6_pcie_start_link with almost identical imx6_pcie_establish_link from analogous Linux kernel driver. This change is purely cosmetical, but refactoring the code this way simplifies implementation comparison. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Reviewed-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i.MX6: pci: Replace magic number with a named constantAndrey Smirnov2016-01-081-1/+3
| | | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Reviewed-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pci: Add i.MX6 pcie supportSascha Hauer2015-03-171-0/+612
Based on the corresponding kernel driver with changes to make it work on barebox. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>