]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00182786 mx6q sabresd: Add power/reset function for 3G modem
authorXinyu Chen <xinyu.chen@freescale.com>
Tue, 15 May 2012 09:16:33 +0000 (17:16 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:34:37 +0000 (08:34 +0200)
Add PCIE 3V3 power up/down routing if we do not have
pcie driver selected. And power up 3V3 in board init.
As the reset function of the hw board cannot reset the
modem power. So on kernel boot up, we must make sure
the 3g modem is reset correctly by gpio reset.

Signed-off-by: guoyin.chen <guoyin.chen@freescale.com>
Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
arch/arm/mach-mx6/board-mx6q_sabresd.c

index 47e9211bd185e1e2eac3cfad69666d3cfbc05c52..a52cc4247cbb13af9eda1b7bec2da2aa718067d8 100644 (file)
@@ -1364,6 +1364,31 @@ static int __init imx6q_init_audio(void)
        return 0;
 }
 
+#ifndef CONFIG_IMX_PCIE
+static void pcie_3v3_power(void)
+{
+       /* disable PCIE_3V3 first */
+       gpio_request(SABRESD_PCIE_PWR_EN, "pcie_3v3_en");
+       gpio_direction_output(SABRESD_PCIE_PWR_EN, 0);
+       mdelay(10);
+       /* enable PCIE_3V3 again */
+       gpio_set_value(SABRESD_PCIE_PWR_EN, 1);
+       gpio_free(SABRESD_PCIE_PWR_EN);
+}
+
+static void pcie_3v3_reset(void)
+{
+       /* reset miniPCIe */
+       gpio_request(SABRESD_PCIE_RST_B_REVB, "pcie_reset_rebB");
+       gpio_direction_output(SABRESD_PCIE_RST_B_REVB, 0);
+       /* The PCI Express Mini CEM specification states that PREST# is
+       deasserted minimum 1ms after 3.3vVaux has been applied and stable*/
+       mdelay(1);
+       gpio_set_value(SABRESD_PCIE_RST_B_REVB, 1);
+       gpio_free(SABRESD_PCIE_RST_B_REVB);
+}
+#endif
+
 static void gps_power_on(bool on)
 {
        /* Enable/disable aux_3v15 */
@@ -1727,6 +1752,13 @@ static void __init mx6_sabresd_board_init(void)
        gpio_direction_output(SABRESD_AUX_5V_EN, 1);
        gpio_set_value(SABRESD_AUX_5V_EN, 1);
 
+#ifndef CONFIG_IMX_PCIE
+       /* enable pcie 3v3 power without pcie driver */
+       pcie_3v3_power();
+       mdelay(10);
+       pcie_3v3_reset();
+#endif
+
        gps_power_on(true);
        /* Register charger chips */
        platform_device_register(&sabresd_max8903_charger_1);