]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
pci: mx6: Implement power callback
authorMarek Vasut <marex@denx.de>
Sun, 23 Mar 2014 21:45:40 +0000 (22:45 +0100)
committerStefano Babic <sbabic@denx.de>
Mon, 31 Mar 2014 16:28:50 +0000 (18:28 +0200)
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>
drivers/pci/pcie_imx.c

index 34377e90bdb088083d7481bf787ba3ca73d20c62..8951a93bb6127c4ab38b5398917db8cad00258e9 100644 (file)
@@ -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);