summaryrefslogtreecommitdiff
path: root/drivers/pci
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2014-03-23 22:45:40 +0100
committerStefano Babic <sbabic@denx.de>2014-03-31 18:28:50 +0200
commita778aeae051c96319855584c87d1dc3ca7257744 (patch)
tree0e984333e3de3c6a65af65c67bfe8b48af5783cb /drivers/pci
parented2f0e1ffae693d7ff8a727a2efb106ba775cba6 (diff)
downloadu-boot-imx-a778aeae051c96319855584c87d1dc3ca7257744.zip
u-boot-imx-a778aeae051c96319855584c87d1dc3ca7257744.tar.gz
u-boot-imx-a778aeae051c96319855584c87d1dc3ca7257744.tar.bz2
pci: mx6: Implement power callback
Implement a callback to toggle the slot power supply. The callback can be overriden in case some more complex power supply for the slot was implemented in hardware, yet for the usual case, one can define a GPIO which toggles the power to the slot. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Stefano Babic <sbabic@denx.de> Cc: Fabio Estevam <fabio.estevam@freescale.com> Cc: Liu Ying <Ying.Liu@freescale.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/pcie_imx.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/pci/pcie_imx.c b/drivers/pci/pcie_imx.c
index 34377e9..8951a93 100644
--- a/drivers/pci/pcie_imx.c
+++ b/drivers/pci/pcie_imx.c
@@ -451,6 +451,17 @@ static int imx6_pcie_init_phy(void)
return 0;
}
+__weak int imx6_pcie_toggle_power(void)
+{
+#ifdef CONFIG_PCIE_IMX_POWER_GPIO
+ gpio_direction_output(CONFIG_PCIE_IMX_POWER_GPIO, 0);
+ mdelay(20);
+ gpio_set_value(CONFIG_PCIE_IMX_POWER_GPIO, 1);
+ mdelay(20);
+#endif
+ return 0;
+}
+
__weak int imx6_pcie_toggle_reset(void)
{
/*
@@ -496,7 +507,7 @@ static int imx6_pcie_deassert_core_reset(void)
{
struct iomuxc *iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR;
- /* FIXME: Power-up GPIO goes here. */
+ imx6_pcie_toggle_power();
/* Enable PCIe */
clrbits_le32(&iomuxc_regs->gpr[1], IOMUXC_GPR1_TEST_POWERDOWN);