From: richard.zhu@linaro.org (Richard Zhu)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V7 5/5] MX53 Enable the AHCI SATA on MX53 SMD board
Date: Tue, 30 Aug 2011 17:56:10 +0800 [thread overview]
Message-ID: <1314698171-7937-5-git-send-email-richard.zhu@linaro.org> (raw)
In-Reply-To: <1314698171-7937-1-git-send-email-richard.zhu@linaro.org>
Signed-off-by: Richard Zhu <richard.zhu@linaro.org>
---
arch/arm/mach-mx5/board-mx53_smd.c | 32 ++++++++++++++++++++++++++++++++
1 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-mx5/board-mx53_smd.c b/arch/arm/mach-mx5/board-mx53_smd.c
index bc02894..3005c7c 100644
--- a/arch/arm/mach-mx5/board-mx53_smd.c
+++ b/arch/arm/mach-mx5/board-mx53_smd.c
@@ -26,6 +26,7 @@
#include <mach/common.h>
#include <mach/hardware.h>
#include <mach/iomux-mx53.h>
+#include <mach/ahci_sata.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -35,6 +36,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 +113,35 @@ static const struct imxi2c_platform_data mx53_smd_i2c_data __initconst = {
.bitrate = 100000,
};
+static int mx53_smd_sata_init(struct device *dev, void __iomem *addr)
+{
+ int ret;
+
+ /* Enable SATA PWR */
+ ret = gpio_request(MX53_SMD_SATA_PWR_EN, "ahci-sata-pwr");
+ if (ret) {
+ printk(KERN_ERR "failed to get SATA_PWR_EN: %d\n", ret);
+ return ret;
+ }
+ gpio_direction_output(MX53_SMD_SATA_PWR_EN, 1);
+
+ return sata_init(dev, addr);
+}
+
+void mx53_smd_sata_exit(struct device *dev)
+{
+ sata_exit(dev);
+
+ /* Disable SATA PWR */
+ gpio_direction_output(MX53_SMD_SATA_PWR_EN, 0);
+ gpio_free(MX53_SMD_SATA_PWR_EN);
+}
+
+static struct ahci_platform_data sata_data = {
+ .init = mx53_smd_sata_init,
+ .exit = mx53_smd_sata_exit,
+};
+
static void __init mx53_smd_board_init(void)
{
imx53_soc_init();
@@ -125,6 +156,7 @@ 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);
+ imx53_add_ahci_imx(0, &sata_data);
}
static void __init mx53_smd_timer_init(void)
--
1.7.1
next prev parent reply other threads:[~2011-08-30 9:56 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-30 9:56 [PATCH V7 1/5] AHCI Add the AHCI SATA feature on the MX53 platforms Richard Zhu
2011-08-30 9:56 ` [PATCH V7 2/5] ahci_plt Add the board_ids and pi refer to different features Richard Zhu
2011-08-30 9:56 ` [PATCH V7 3/5] MX53 Enable the AHCI SATA on MX53 ARD board Richard Zhu
2011-08-30 9:56 ` [PATCH V7 4/5] MX53 Enable the AHCI SATA on MX53 LOCO board Richard Zhu
2011-08-30 9:56 ` Richard Zhu [this message]
2011-08-30 10:37 ` [PATCH V7 1/5] AHCI Add the AHCI SATA feature on the MX53 platforms Wolfram Sang
2011-08-30 10:43 ` Hector Oron
2011-08-31 2:08 ` Richard Zhu
2011-08-31 12:57 ` Hector Oron
2011-09-01 3:09 ` Richard Zhu
2011-09-05 18:06 ` Eric Miao
2011-09-06 8:46 ` Hector Oron
2011-09-06 13:25 ` Eric Miao
2011-09-22 9:30 ` Hector Oron
2011-09-22 12:19 ` Eric Miao
2011-09-23 8:58 ` Hector Oron
2011-09-05 19:25 ` Arnaud Patard (Rtp)
-- strict thread matches above, loose matches on Subject: below --
2011-08-31 3:50 [PATCH V7 0/5] imx53 ahci driver v7 Richard Zhu
2011-08-31 3:50 ` [PATCH V7 5/5] MX53 Enable the AHCI SATA on MX53 SMD board Richard Zhu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1314698171-7937-5-git-send-email-richard.zhu@linaro.org \
--to=richard.zhu@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).