Add support for pata on iMX51 and AHCI on iMX53
svn path=/dists/trunk/linux-2.6/; revision=18267
This commit is contained in:
parent
35a7f31573
commit
221a62f8e0
|
@ -28,6 +28,7 @@ linux-2.6 (3.1.1-1) UNRELEASED; urgency=low
|
|||
* [arm] add missing ioread/write be functions to ixp4xx to fix FTBFS
|
||||
* [armhf] allow to build kernel image for iMX51 and iMX53 and enable some
|
||||
iMX53 platforms.
|
||||
* [armhf] add ahci for iMX53, pata for iMX51
|
||||
|
||||
-- Ben Hutchings <ben@decadent.org.uk> Fri, 04 Nov 2011 15:05:47 +0000
|
||||
|
||||
|
|
|
@ -0,0 +1,111 @@
|
|||
commit a45adf1ce8012f67fe6014175f666ab2960e0350
|
||||
Author: Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>
|
||||
Date: Tue Jul 26 16:54:25 2011 +0200
|
||||
|
||||
imx51: add pata device
|
||||
|
||||
Declare the pata device found on mx51
|
||||
|
||||
Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
|
||||
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
||||
|
||||
diff --git a/arch/arm/mach-mx5/devices-imx51.h b/arch/arm/mach-mx5/devices-imx51.h
|
||||
index e11bc0e..89fe77f 100644
|
||||
--- a/arch/arm/mach-mx5/devices-imx51.h
|
||||
+++ b/arch/arm/mach-mx5/devices-imx51.h
|
||||
@@ -52,3 +52,7 @@ extern const struct imx_mxc_pwm_data imx51_mxc_pwm_data[];
|
||||
extern const struct imx_imx_keypad_data imx51_imx_keypad_data;
|
||||
#define imx51_add_imx_keypad(pdata) \
|
||||
imx_add_imx_keypad(&imx51_imx_keypad_data, pdata)
|
||||
+
|
||||
+extern const struct imx_pata_imx_data imx51_pata_imx_data;
|
||||
+#define imx51_add_pata_imx() \
|
||||
+ imx_add_pata_imx(&imx51_pata_imx_data)
|
||||
diff --git a/arch/arm/plat-mxc/devices/Kconfig b/arch/arm/plat-mxc/devices/Kconfig
|
||||
index bd294ad..c55916c 100644
|
||||
--- a/arch/arm/plat-mxc/devices/Kconfig
|
||||
+++ b/arch/arm/plat-mxc/devices/Kconfig
|
||||
@@ -31,6 +31,9 @@ config IMX_HAVE_PLATFORM_IMX_I2C
|
||||
config IMX_HAVE_PLATFORM_IMX_KEYPAD
|
||||
bool
|
||||
|
||||
+config IMX_HAVE_PLATFORM_PATA_IMX
|
||||
+ bool
|
||||
+
|
||||
config IMX_HAVE_PLATFORM_IMX_SSI
|
||||
bool
|
||||
|
||||
diff --git a/arch/arm/plat-mxc/devices/Makefile b/arch/arm/plat-mxc/devices/Makefile
|
||||
index b41bf97..a093b45 100644
|
||||
--- a/arch/arm/plat-mxc/devices/Makefile
|
||||
+++ b/arch/arm/plat-mxc/devices/Makefile
|
||||
@@ -10,6 +10,7 @@ obj-y += platform-imx-dma.o
|
||||
obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_FB) += platform-imx-fb.o
|
||||
obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_I2C) += platform-imx-i2c.o
|
||||
obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_KEYPAD) += platform-imx-keypad.o
|
||||
+obj-$(CONFIG_IMX_HAVE_PLATFORM_PATA_IMX) += platform-pata_imx.o
|
||||
obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_SSI) += platform-imx-ssi.o
|
||||
obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UART) += platform-imx-uart.o
|
||||
obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UDC) += platform-imx_udc.o
|
||||
diff --git a/arch/arm/plat-mxc/devices/platform-pata_imx.c b/arch/arm/plat-mxc/devices/platform-pata_imx.c
|
||||
new file mode 100644
|
||||
index 0000000..c1cbaf9
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/plat-mxc/devices/platform-pata_imx.c
|
||||
@@ -0,0 +1,38 @@
|
||||
+/*
|
||||
+ * This program is free software; you can redistribute it and/or modify it under
|
||||
+ * the terms of the GNU General Public License version 2 as published by the
|
||||
+ * Free Software Foundation.
|
||||
+ */
|
||||
+#include <mach/hardware.h>
|
||||
+#include <mach/devices-common.h>
|
||||
+
|
||||
+#define imx_pata_imx_data_entry_single(soc) \
|
||||
+ { \
|
||||
+ .iobase = soc ## _ATA_BASE_ADDR, \
|
||||
+ .irq = soc ## _MXC_INT_ATA, \
|
||||
+ }
|
||||
+
|
||||
+#ifdef CONFIG_SOC_IMX51
|
||||
+const struct imx_pata_imx_data imx51_pata_imx_data __initconst =
|
||||
+ imx_pata_imx_data_entry_single(MX51);
|
||||
+#endif /* ifdef CONFIG_SOC_IMX51 */
|
||||
+
|
||||
+struct platform_device *__init imx_add_pata_imx(
|
||||
+ const struct imx_pata_imx_data *data)
|
||||
+{
|
||||
+ struct resource res[] = {
|
||||
+ {
|
||||
+ .start = data->iobase,
|
||||
+ .end = data->iobase + SZ_16K - 1,
|
||||
+ .flags = IORESOURCE_MEM,
|
||||
+ },
|
||||
+ {
|
||||
+ .start = data->irq,
|
||||
+ .end = data->irq,
|
||||
+ .flags = IORESOURCE_IRQ,
|
||||
+ },
|
||||
+ };
|
||||
+ return imx_add_platform_device("pata_imx", -1,
|
||||
+ res, ARRAY_SIZE(res), NULL, 0);
|
||||
+}
|
||||
+
|
||||
diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/plat-mxc/include/mach/devices-common.h
|
||||
index 524538a..1b76c67 100644
|
||||
--- a/arch/arm/plat-mxc/include/mach/devices-common.h
|
||||
+++ b/arch/arm/plat-mxc/include/mach/devices-common.h
|
||||
@@ -251,6 +251,13 @@ struct platform_device *__init imx_add_mxc_nand(
|
||||
const struct imx_mxc_nand_data *data,
|
||||
const struct mxc_nand_platform_data *pdata);
|
||||
|
||||
+struct imx_pata_imx_data {
|
||||
+ resource_size_t iobase;
|
||||
+ resource_size_t irq;
|
||||
+};
|
||||
+struct platform_device *__init imx_add_pata_imx(
|
||||
+ const struct imx_pata_imx_data *data);
|
||||
+
|
||||
struct imx_mxc_pwm_data {
|
||||
int id;
|
||||
resource_size_t iobase;
|
|
@ -0,0 +1,34 @@
|
|||
commit 5bc59bff8c3ee0971fbddb8d6885cb5f30f91c5a
|
||||
Author: Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>
|
||||
Date: Tue Jul 26 16:54:26 2011 +0200
|
||||
|
||||
imx51: add pata clock
|
||||
|
||||
Define the clock used by the imx51 pata device.
|
||||
|
||||
Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
|
||||
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
||||
|
||||
diff --git a/arch/arm/mach-mx5/clock-mx51-mx53.c b/arch/arm/mach-mx5/clock-mx51-mx53.c
|
||||
index 7f20308..b653133 100644
|
||||
--- a/arch/arm/mach-mx5/clock-mx51-mx53.c
|
||||
+++ b/arch/arm/mach-mx5/clock-mx51-mx53.c
|
||||
@@ -1414,6 +1414,10 @@ DEFINE_CLOCK(ipu_di0_clk, 0, MXC_CCM_CCGR6, MXC_CCM_CCGRx_CG5_OFFSET,
|
||||
DEFINE_CLOCK(ipu_di1_clk, 0, MXC_CCM_CCGR6, MXC_CCM_CCGRx_CG6_OFFSET,
|
||||
NULL, NULL, &pll3_sw_clk, NULL);
|
||||
|
||||
+/* PATA */
|
||||
+DEFINE_CLOCK(pata_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG0_OFFSET,
|
||||
+ NULL, NULL, &ipg_clk, &spba_clk);
|
||||
+
|
||||
#define _REGISTER_CLOCK(d, n, c) \
|
||||
{ \
|
||||
.dev_id = d, \
|
||||
@@ -1470,6 +1474,7 @@ static struct clk_lookup mx51_lookups[] = {
|
||||
_REGISTER_CLOCK("imx-ipuv3", "di0", ipu_di0_clk)
|
||||
_REGISTER_CLOCK("imx-ipuv3", "di1", ipu_di1_clk)
|
||||
_REGISTER_CLOCK(NULL, "gpc_dvfs", gpc_dvfs_clk)
|
||||
+ _REGISTER_CLOCK("pata_imx", NULL, pata_clk)
|
||||
};
|
||||
|
||||
static struct clk_lookup mx53_lookups[] = {
|
|
@ -0,0 +1,36 @@
|
|||
commit d8f4059bf96d9bc1b8d2003602404f3d011ac9f2
|
||||
Author: Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>
|
||||
Date: Tue Jul 26 16:54:27 2011 +0200
|
||||
|
||||
imx: efika: Enable pata.
|
||||
|
||||
Enable pata support on efika mx/sb platforms.
|
||||
|
||||
Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
|
||||
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
||||
|
||||
diff --git a/arch/arm/mach-mx5/Kconfig b/arch/arm/mach-mx5/Kconfig
|
||||
index b4e7c58..28b94e0 100644
|
||||
--- a/arch/arm/mach-mx5/Kconfig
|
||||
+++ b/arch/arm/mach-mx5/Kconfig
|
||||
@@ -147,6 +147,7 @@ config MX51_EFIKA_COMMON
|
||||
bool
|
||||
select SOC_IMX51
|
||||
select IMX_HAVE_PLATFORM_IMX_UART
|
||||
+ select IMX_HAVE_PLATFORM_PATA_IMX
|
||||
select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
|
||||
select IMX_HAVE_PLATFORM_SPI_IMX
|
||||
select MXC_ULPI if USB_ULPI
|
||||
diff --git a/arch/arm/mach-mx5/mx51_efika.c b/arch/arm/mach-mx5/mx51_efika.c
|
||||
index 4435e03..31c152e 100644
|
||||
--- a/arch/arm/mach-mx5/mx51_efika.c
|
||||
+++ b/arch/arm/mach-mx5/mx51_efika.c
|
||||
@@ -627,6 +627,8 @@ void __init efika_board_common_init(void)
|
||||
ARRAY_SIZE(mx51_efika_spi_board_info));
|
||||
imx51_add_ecspi(0, &mx51_efika_spi_pdata);
|
||||
|
||||
+ imx51_add_pata_imx();
|
||||
+
|
||||
#if defined(CONFIG_CPU_FREQ_IMX)
|
||||
get_cpu_op = mx51_get_cpu_op;
|
||||
#endif
|
|
@ -0,0 +1,258 @@
|
|||
commit 97915bdf3c1833e7855272788a24b191a17c67f4
|
||||
Author: Richard Zhu <richard.zhu@linaro.org>
|
||||
Date: Wed Sep 28 15:41:53 2011 +0800
|
||||
|
||||
AHCI Add the AHCI SATA feature on the MX53 platforms
|
||||
|
||||
Signed-off-by: Richard Zhu <richard.zhu@linaro.org>
|
||||
Tested-by: Hector Oron Martinez <hector.oron@gmail.com>
|
||||
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
||||
|
||||
diff --git a/arch/arm/mach-mx5/clock-mx51-mx53.c b/arch/arm/mach-mx5/clock-mx51-mx53.c
|
||||
index f7bf996..1ef7e97 100644
|
||||
--- a/arch/arm/mach-mx5/clock-mx51-mx53.c
|
||||
+++ b/arch/arm/mach-mx5/clock-mx51-mx53.c
|
||||
@@ -1401,6 +1401,22 @@ static struct clk esdhc4_mx53_clk = {
|
||||
.secondary = &esdhc4_ipg_clk,
|
||||
};
|
||||
|
||||
+static struct clk sata_clk = {
|
||||
+ .parent = &ipg_clk,
|
||||
+ .enable = _clk_max_enable,
|
||||
+ .enable_reg = MXC_CCM_CCGR4,
|
||||
+ .enable_shift = MXC_CCM_CCGRx_CG1_OFFSET,
|
||||
+ .disable = _clk_max_disable,
|
||||
+};
|
||||
+
|
||||
+static struct clk ahci_phy_clk = {
|
||||
+ .parent = &usb_phy1_clk,
|
||||
+};
|
||||
+
|
||||
+static struct clk ahci_dma_clk = {
|
||||
+ .parent = &ahb_clk,
|
||||
+};
|
||||
+
|
||||
DEFINE_CLOCK(mipi_esc_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG5_OFFSET, NULL, NULL, NULL, &pll2_sw_clk);
|
||||
DEFINE_CLOCK(mipi_hsc2_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG4_OFFSET, NULL, NULL, &mipi_esc_clk, &pll2_sw_clk);
|
||||
DEFINE_CLOCK(mipi_hsc1_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG3_OFFSET, NULL, NULL, &mipi_hsc2_clk, &pll2_sw_clk);
|
||||
@@ -1507,6 +1523,9 @@ static struct clk_lookup mx53_lookups[] = {
|
||||
_REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk)
|
||||
_REGISTER_CLOCK("imx-ssi.2", NULL, ssi3_clk)
|
||||
_REGISTER_CLOCK("imx-keypad", NULL, dummy_clk)
|
||||
+ _REGISTER_CLOCK("imx53-ahci.0", "ahci", sata_clk)
|
||||
+ _REGISTER_CLOCK("imx53-ahci.0", "ahci_phy", ahci_phy_clk)
|
||||
+ _REGISTER_CLOCK("imx53-ahci.0", "ahci_dma", ahci_dma_clk)
|
||||
};
|
||||
|
||||
static void clk_tree_init(void)
|
||||
diff --git a/arch/arm/mach-mx5/devices-imx53.h b/arch/arm/mach-mx5/devices-imx53.h
|
||||
index c27fe8b..1ab399e 100644
|
||||
--- a/arch/arm/mach-mx5/devices-imx53.h
|
||||
+++ b/arch/arm/mach-mx5/devices-imx53.h
|
||||
@@ -40,3 +40,5 @@ extern const struct imx_imx_ssi_data imx53_imx_ssi_data[];
|
||||
extern const struct imx_imx_keypad_data imx53_imx_keypad_data;
|
||||
#define imx53_add_imx_keypad(pdata) \
|
||||
imx_add_imx_keypad(&imx53_imx_keypad_data, pdata)
|
||||
+
|
||||
+extern struct platform_device *__init imx53_add_ahci_imx(void);
|
||||
diff --git a/arch/arm/plat-mxc/devices/Kconfig b/arch/arm/plat-mxc/devices/Kconfig
|
||||
index bd294ad..f63887b 100644
|
||||
--- a/arch/arm/plat-mxc/devices/Kconfig
|
||||
+++ b/arch/arm/plat-mxc/devices/Kconfig
|
||||
@@ -76,3 +76,7 @@ config IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
|
||||
|
||||
config IMX_HAVE_PLATFORM_SPI_IMX
|
||||
bool
|
||||
+
|
||||
+config IMX_HAVE_PLATFORM_AHCI
|
||||
+ bool
|
||||
+ default y if ARCH_MX53
|
||||
diff --git a/arch/arm/plat-mxc/devices/Makefile b/arch/arm/plat-mxc/devices/Makefile
|
||||
index b41bf97..e858ad9 100644
|
||||
--- a/arch/arm/plat-mxc/devices/Makefile
|
||||
+++ b/arch/arm/plat-mxc/devices/Makefile
|
||||
@@ -25,3 +25,4 @@ obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_RTC) += platform-mxc_rtc.o
|
||||
obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_W1) += platform-mxc_w1.o
|
||||
obj-$(CONFIG_IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX) += platform-sdhci-esdhc-imx.o
|
||||
obj-$(CONFIG_IMX_HAVE_PLATFORM_SPI_IMX) += platform-spi_imx.o
|
||||
+obj-$(CONFIG_IMX_HAVE_PLATFORM_AHCI) += platform-ahci-imx.o
|
||||
diff --git a/arch/arm/plat-mxc/devices/platform-ahci-imx.c b/arch/arm/plat-mxc/devices/platform-ahci-imx.c
|
||||
new file mode 100644
|
||||
index 0000000..d8a56ae
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/plat-mxc/devices/platform-ahci-imx.c
|
||||
@@ -0,0 +1,156 @@
|
||||
+/*
|
||||
+ * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved.
|
||||
+ */
|
||||
+
|
||||
+/*
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+
|
||||
+ * You should have received a copy of the GNU General Public License along
|
||||
+ * with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
+ */
|
||||
+
|
||||
+#include <linux/io.h>
|
||||
+#include <linux/clk.h>
|
||||
+#include <linux/err.h>
|
||||
+#include <linux/device.h>
|
||||
+#include <linux/dma-mapping.h>
|
||||
+#include <asm/sizes.h>
|
||||
+#include <mach/hardware.h>
|
||||
+#include <mach/devices-common.h>
|
||||
+
|
||||
+#define imx_ahci_imx_data_entry_single(soc, _devid) \
|
||||
+ { \
|
||||
+ .devid = _devid, \
|
||||
+ .iobase = soc ## _SATA_BASE_ADDR, \
|
||||
+ .irq = soc ## _INT_SATA, \
|
||||
+ }
|
||||
+
|
||||
+#ifdef CONFIG_SOC_IMX53
|
||||
+const struct imx_ahci_imx_data imx53_ahci_imx_data __initconst =
|
||||
+ imx_ahci_imx_data_entry_single(MX53, "imx53-ahci");
|
||||
+#endif
|
||||
+
|
||||
+enum {
|
||||
+ HOST_CAP = 0x00,
|
||||
+ HOST_CAP_SSS = (1 << 27), /* Staggered Spin-up */
|
||||
+ HOST_PORTS_IMPL = 0x0c,
|
||||
+ HOST_TIMER1MS = 0xe0, /* Timer 1-ms */
|
||||
+};
|
||||
+
|
||||
+static struct clk *sata_clk, *sata_ref_clk;
|
||||
+
|
||||
+/* AHCI module Initialization, if return 0, initialization is successful. */
|
||||
+static int imx_sata_init(struct device *dev, void __iomem *addr)
|
||||
+{
|
||||
+ u32 tmpdata;
|
||||
+ int ret = 0;
|
||||
+ struct clk *clk;
|
||||
+
|
||||
+ sata_clk = clk_get(dev, "ahci");
|
||||
+ if (IS_ERR(sata_clk)) {
|
||||
+ dev_err(dev, "no sata clock.\n");
|
||||
+ return PTR_ERR(sata_clk);
|
||||
+ }
|
||||
+ ret = clk_enable(sata_clk);
|
||||
+ if (ret) {
|
||||
+ dev_err(dev, "can't enable sata clock.\n");
|
||||
+ goto put_sata_clk;
|
||||
+ }
|
||||
+
|
||||
+ /* Get the AHCI SATA PHY CLK */
|
||||
+ sata_ref_clk = clk_get(dev, "ahci_phy");
|
||||
+ if (IS_ERR(sata_ref_clk)) {
|
||||
+ dev_err(dev, "no sata ref clock.\n");
|
||||
+ ret = PTR_ERR(sata_ref_clk);
|
||||
+ goto release_sata_clk;
|
||||
+ }
|
||||
+ ret = clk_enable(sata_ref_clk);
|
||||
+ if (ret) {
|
||||
+ dev_err(dev, "can't enable sata ref clock.\n");
|
||||
+ goto put_sata_ref_clk;
|
||||
+ }
|
||||
+
|
||||
+ /* Get the AHB clock rate, and configure the TIMER1MS reg later */
|
||||
+ clk = clk_get(dev, "ahci_dma");
|
||||
+ if (IS_ERR(clk)) {
|
||||
+ dev_err(dev, "no dma clock.\n");
|
||||
+ ret = PTR_ERR(clk);
|
||||
+ goto release_sata_ref_clk;
|
||||
+ }
|
||||
+ tmpdata = clk_get_rate(clk) / 1000;
|
||||
+ clk_put(clk);
|
||||
+
|
||||
+ writel(tmpdata, addr + HOST_TIMER1MS);
|
||||
+
|
||||
+ tmpdata = readl(addr + HOST_CAP);
|
||||
+ if (!(tmpdata & HOST_CAP_SSS)) {
|
||||
+ tmpdata |= HOST_CAP_SSS;
|
||||
+ writel(tmpdata, addr + HOST_CAP);
|
||||
+ }
|
||||
+
|
||||
+ if (!(readl(addr + HOST_PORTS_IMPL) & 0x1))
|
||||
+ writel((readl(addr + HOST_PORTS_IMPL) | 0x1),
|
||||
+ addr + HOST_PORTS_IMPL);
|
||||
+
|
||||
+ return 0;
|
||||
+
|
||||
+release_sata_ref_clk:
|
||||
+ clk_disable(sata_ref_clk);
|
||||
+put_sata_ref_clk:
|
||||
+ clk_put(sata_ref_clk);
|
||||
+release_sata_clk:
|
||||
+ clk_disable(sata_clk);
|
||||
+put_sata_clk:
|
||||
+ clk_put(sata_clk);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static void imx_sata_exit(struct device *dev)
|
||||
+{
|
||||
+ clk_disable(sata_ref_clk);
|
||||
+ clk_put(sata_ref_clk);
|
||||
+
|
||||
+ clk_disable(sata_clk);
|
||||
+ clk_put(sata_clk);
|
||||
+
|
||||
+}
|
||||
+struct platform_device *__init imx_add_ahci_imx(
|
||||
+ const struct imx_ahci_imx_data *data,
|
||||
+ const struct ahci_platform_data *pdata)
|
||||
+{
|
||||
+ struct resource res[] = {
|
||||
+ {
|
||||
+ .start = data->iobase,
|
||||
+ .end = data->iobase + SZ_4K - 1,
|
||||
+ .flags = IORESOURCE_MEM,
|
||||
+ }, {
|
||||
+ .start = data->irq,
|
||||
+ .end = data->irq,
|
||||
+ .flags = IORESOURCE_IRQ,
|
||||
+ },
|
||||
+ };
|
||||
+
|
||||
+ return imx_add_platform_device_dmamask(data->devid, 0,
|
||||
+ res, ARRAY_SIZE(res),
|
||||
+ pdata, sizeof(*pdata), DMA_BIT_MASK(32));
|
||||
+}
|
||||
+
|
||||
+struct platform_device *__init imx53_add_ahci_imx(void)
|
||||
+{
|
||||
+ struct ahci_platform_data pdata = {
|
||||
+ .init = imx_sata_init,
|
||||
+ .exit = imx_sata_exit,
|
||||
+ };
|
||||
+
|
||||
+ return imx_add_ahci_imx(&imx53_ahci_imx_data, &pdata);
|
||||
+}
|
||||
diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/plat-mxc/include/mach/devices-common.h
|
||||
index 524538a..f04e063 100644
|
||||
--- a/arch/arm/plat-mxc/include/mach/devices-common.h
|
||||
+++ b/arch/arm/plat-mxc/include/mach/devices-common.h
|
||||
@@ -301,3 +301,13 @@ struct platform_device *__init imx_add_spi_imx(
|
||||
struct platform_device *imx_add_imx_dma(void);
|
||||
struct platform_device *imx_add_imx_sdma(char *name,
|
||||
resource_size_t iobase, int irq, struct sdma_platform_data *pdata);
|
||||
+
|
||||
+#include <linux/ahci_platform.h>
|
||||
+struct imx_ahci_imx_data {
|
||||
+ const char *devid;
|
||||
+ resource_size_t iobase;
|
||||
+ resource_size_t irq;
|
||||
+};
|
||||
+struct platform_device *__init imx_add_ahci_imx(
|
||||
+ const struct imx_ahci_imx_data *data,
|
||||
+ const struct ahci_platform_data *pdata);
|
|
@ -0,0 +1,85 @@
|
|||
commit 904c04feaf13ed58790a34a0b11cd7b885b94b4b
|
||||
Author: Richard Zhu <richard.zhu@linaro.org>
|
||||
Date: Wed Sep 28 15:41:54 2011 +0800
|
||||
|
||||
[libata] ahci_platform: Add the board_ids and pi refer to different features
|
||||
|
||||
On imx53 AHCI, soft reset fails with IPMS set when PMP
|
||||
is enabled but SATA HDD/ODD is connected to SATA port,
|
||||
do soft reset again to port 0.
|
||||
So the 'ahci_pmp_retry_srst_ops' is required when imx53
|
||||
ahci is present.
|
||||
|
||||
Signed-off-by: Richard Zhu <richard.zhu@linaro.org>
|
||||
Acked-by: Eric Miao <eric.miao@linaro.org>
|
||||
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
|
||||
|
||||
diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c
|
||||
index 6fef1fa..c03277d 100644
|
||||
--- a/drivers/ata/ahci_platform.c
|
||||
+++ b/drivers/ata/ahci_platform.c
|
||||
@@ -23,6 +23,41 @@
|
||||
#include <linux/ahci_platform.h>
|
||||
#include "ahci.h"
|
||||
|
||||
+enum ahci_type {
|
||||
+ AHCI, /* standard platform ahci */
|
||||
+ IMX53_AHCI, /* ahci on i.mx53 */
|
||||
+};
|
||||
+
|
||||
+static struct platform_device_id ahci_devtype[] = {
|
||||
+ {
|
||||
+ .name = "ahci",
|
||||
+ .driver_data = AHCI,
|
||||
+ }, {
|
||||
+ .name = "imx53-ahci",
|
||||
+ .driver_data = IMX53_AHCI,
|
||||
+ }, {
|
||||
+ /* sentinel */
|
||||
+ }
|
||||
+};
|
||||
+MODULE_DEVICE_TABLE(platform, ahci_devtype);
|
||||
+
|
||||
+
|
||||
+static const struct ata_port_info ahci_port_info[] = {
|
||||
+ /* by features */
|
||||
+ [AHCI] = {
|
||||
+ .flags = AHCI_FLAG_COMMON,
|
||||
+ .pio_mask = ATA_PIO4,
|
||||
+ .udma_mask = ATA_UDMA6,
|
||||
+ .port_ops = &ahci_ops,
|
||||
+ },
|
||||
+ [IMX53_AHCI] = {
|
||||
+ .flags = AHCI_FLAG_COMMON,
|
||||
+ .pio_mask = ATA_PIO4,
|
||||
+ .udma_mask = ATA_UDMA6,
|
||||
+ .port_ops = &ahci_pmp_retry_srst_ops,
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
static struct scsi_host_template ahci_platform_sht = {
|
||||
AHCI_SHT("ahci_platform"),
|
||||
};
|
||||
@@ -31,12 +66,8 @@ static int __init ahci_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
struct ahci_platform_data *pdata = dev->platform_data;
|
||||
- struct ata_port_info pi = {
|
||||
- .flags = AHCI_FLAG_COMMON,
|
||||
- .pio_mask = ATA_PIO4,
|
||||
- .udma_mask = ATA_UDMA6,
|
||||
- .port_ops = &ahci_ops,
|
||||
- };
|
||||
+ const struct platform_device_id *id = platform_get_device_id(pdev);
|
||||
+ struct ata_port_info pi = ahci_port_info[id->driver_data];
|
||||
const struct ata_port_info *ppi[] = { &pi, NULL };
|
||||
struct ahci_host_priv *hpriv;
|
||||
struct ata_host *host;
|
||||
@@ -177,6 +208,7 @@ static struct platform_driver ahci_driver = {
|
||||
.name = "ahci",
|
||||
.owner = THIS_MODULE,
|
||||
},
|
||||
+ .id_table = ahci_devtype,
|
||||
};
|
||||
|
||||
static int __init ahci_init(void)
|
|
@ -0,0 +1,21 @@
|
|||
commit e97e303d801f9ab74590ff5d56e614e811efe98b
|
||||
Author: Richard Zhu <richard.zhu@linaro.org>
|
||||
Date: Wed Sep 28 15:41:55 2011 +0800
|
||||
|
||||
MX53 Enable the AHCI SATA on MX53 ARD board
|
||||
|
||||
Signed-off-by: Richard Zhu <richard.zhu@linaro.org>
|
||||
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
||||
|
||||
diff --git a/arch/arm/mach-mx5/board-mx53_ard.c b/arch/arm/mach-mx5/board-mx53_ard.c
|
||||
index 76a67c4..ef2039e 100644
|
||||
--- a/arch/arm/mach-mx5/board-mx53_ard.c
|
||||
+++ b/arch/arm/mach-mx5/board-mx53_ard.c
|
||||
@@ -234,6 +234,7 @@ static void __init mx53_ard_board_init(void)
|
||||
imx53_add_imx_i2c(1, &mx53_ard_i2c2_data);
|
||||
imx53_add_imx_i2c(2, &mx53_ard_i2c3_data);
|
||||
imx_add_gpio_keys(&ard_button_data);
|
||||
+ imx53_add_ahci_imx();
|
||||
}
|
||||
|
||||
static void __init mx53_ard_timer_init(void)
|
|
@ -0,0 +1,21 @@
|
|||
commit 0661b82c94925fb47708165eaf78cf380b31ffb3
|
||||
Author: Richard Zhu <richard.zhu@linaro.org>
|
||||
Date: Wed Sep 28 15:41:56 2011 +0800
|
||||
|
||||
MX53 Enable the AHCI SATA on MX53 LOCO board
|
||||
|
||||
Signed-off-by: Richard Zhu <richard.zhu@linaro.org>
|
||||
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
||||
|
||||
diff --git a/arch/arm/mach-mx5/board-mx53_loco.c b/arch/arm/mach-mx5/board-mx53_loco.c
|
||||
index 4e1d51d..940aac9 100644
|
||||
--- a/arch/arm/mach-mx5/board-mx53_loco.c
|
||||
+++ b/arch/arm/mach-mx5/board-mx53_loco.c
|
||||
@@ -273,6 +273,7 @@ static void __init mx53_loco_board_init(void)
|
||||
imx53_add_sdhci_esdhc_imx(2, &mx53_loco_sd3_data);
|
||||
imx_add_gpio_keys(&loco_button_data);
|
||||
gpio_led_register_device(-1, &mx53loco_leds_data);
|
||||
+ imx53_add_ahci_imx();
|
||||
}
|
||||
|
||||
static void __init mx53_loco_timer_init(void)
|
|
@ -0,0 +1,50 @@
|
|||
commit d870ea1d6bc5057f2599416655b42ab192dae6d0
|
||||
Author: Richard Zhu <richard.zhu@linaro.org>
|
||||
Date: Wed Sep 28 15:41:57 2011 +0800
|
||||
|
||||
MX53 Enable the AHCI SATA on MX53 SMD board
|
||||
|
||||
Signed-off-by: Richard Zhu <richard.zhu@linaro.org>
|
||||
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
||||
|
||||
diff --git a/arch/arm/mach-mx5/board-mx53_smd.c b/arch/arm/mach-mx5/board-mx53_smd.c
|
||||
index bc02894..efcab68 100644
|
||||
--- a/arch/arm/mach-mx5/board-mx53_smd.c
|
||||
+++ b/arch/arm/mach-mx5/board-mx53_smd.c
|
||||
@@ -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)
|
|
@ -64,3 +64,12 @@
|
|||
#+ bugfix/ia64/ia64-Add-accept4-syscall.patch
|
||||
+ bugfix/arm/ixp4xx_iobe.patch
|
||||
+ features/arm/allow_imx5x_build.patch
|
||||
+ features/arm/imx51_pata1.patch
|
||||
+ features/arm/imx51_pata2.patch
|
||||
+ features/arm/imx51_pata3.patch
|
||||
+ features/arm/imx53_ahci1.patch
|
||||
+ features/arm/imx53_ahci2.patch
|
||||
+ features/arm/imx53_ahci3.patch
|
||||
+ features/arm/imx53_ahci4.patch
|
||||
+ features/arm/imx53_ahci5.patch
|
||||
|
||||
|
|
Loading…
Reference in New Issue