MX53 Enable the AHCI SATA on MX53 SMD board
authorRichard Zhu <richard.zhu@linaro.org>
Wed, 28 Sep 2011 07:41:57 +0000 (15:41 +0800)
committerSascha Hauer <s.hauer@pengutronix.de>
Fri, 7 Oct 2011 12:42:56 +0000 (14:42 +0200)
Signed-off-by: Richard Zhu <richard.zhu@linaro.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
arch/arm/mach-mx5/board-mx53_smd.c

index bc02894eafefab9126347857ff709293e1bffeb5..efcab68840aed2f50c3ebc486d1f309b1d1d747d 100644 (file)
@@ -35,6 +35,7 @@
 #include "devices-imx53.h"
 
 #define SMD_FEC_PHY_RST                IMX_GPIO_NR(7, 6)
+#define MX53_SMD_SATA_PWR_EN    IMX_GPIO_NR(3, 3)
 
 static iomux_v3_cfg_t mx53_smd_pads[] = {
        MX53_PAD_CSI0_DAT10__UART1_TXD_MUX,
@@ -111,6 +112,19 @@ static const struct imxi2c_platform_data mx53_smd_i2c_data __initconst = {
        .bitrate = 100000,
 };
 
+static inline void mx53_smd_ahci_pwr_on(void)
+{
+       int ret;
+
+       /* Enable SATA PWR */
+       ret = gpio_request_one(MX53_SMD_SATA_PWR_EN,
+                       GPIOF_DIR_OUT | GPIOF_INIT_HIGH, "ahci-sata-pwr");
+       if (ret) {
+               pr_err("failed to enable SATA_PWR_EN: %d\n", ret);
+               return;
+       }
+}
+
 static void __init mx53_smd_board_init(void)
 {
        imx53_soc_init();
@@ -125,6 +139,8 @@ static void __init mx53_smd_board_init(void)
        imx53_add_sdhci_esdhc_imx(0, NULL);
        imx53_add_sdhci_esdhc_imx(1, NULL);
        imx53_add_sdhci_esdhc_imx(2, NULL);
+       mx53_smd_ahci_pwr_on();
+       imx53_add_ahci_imx();
 }
 
 static void __init mx53_smd_timer_init(void)