obj-$(CONFIG_ARCH_MXC_AUDMUX_V2) += audmux-v2.o
obj-$(CONFIG_MXC_DEBUG_BOARD) += 3ds_debugboard.o
obj-$(CONFIG_CPU_FREQ_IMX) += cpufreq.o
+obj-$(CONFIG_IMX_HAVE_PLATFORM_AHCI) += ahci_sata.o
ifdef CONFIG_SND_IMX_SOC
obj-y += ssi-fiq.o
obj-y += ssi-fiq-ksym.o
--- /dev/null
+/*
+ * 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/kernel.h>
+#include <mach/ahci_sata.h>
+
+/* AHCI module Initialization, if return 0, initialization is successful. */
+int sata_init(void __iomem *addr, unsigned long timer1ms)
+{
+ u32 tmpdata;
+
+ /* Reset HBA */
+ writel(HOST_RESET, addr + HOST_CTL);
+
+ tmpdata = readl(addr + HOST_VERSIONR);
+ tmpdata = 0;
+ while (readl(addr + HOST_VERSIONR) == 0) {
+ tmpdata++;
+ if (tmpdata > 100000) {
+ printk(KERN_ERR "Can't recover from RESET HBA!\n");
+ break;
+ }
+ }
+
+ tmpdata = readl(addr + HOST_CAP);
+ if (!(tmpdata & HOST_CAP_SSS)) {
+ tmpdata |= HOST_CAP_SSS;
+ writel(tmpdata, addr + HOST_CAP);
+ }
+ tmpdata = readl(addr + HOST_CAP);
+
+ if (!(readl(addr + HOST_PORTS_IMPL) & 0x1))
+ writel((readl(addr + HOST_PORTS_IMPL) | 0x1),
+ addr + HOST_PORTS_IMPL);
+
+ writel(timer1ms, addr + HOST_TIMER1MS);
+
+ return 0;
+}
config IMX_HAVE_PLATFORM_IMX_DVFS
bool
-config IMX_HAVE_PLATFORM_SATA_AHCI
+config IMX_HAVE_PLATFORM_AHCI
bool
config IMX_HAVE_PLATFORM_IMX_IIM
obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_TVE) += platform-imx_tve.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_VPU) += platform-imx_vpu.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_DVFS) += platform-imx_dvfs.o
-obj-$(CONFIG_IMX_HAVE_PLATFORM_SATA_AHCI) += platform-ahci-imx.o
+obj-$(CONFIG_IMX_HAVE_PLATFORM_AHCI) += platform-ahci-imx.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_IIM) += platform-imx-iim.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_GPU) += platform-mxc_gpu.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_OCOTP) += platform-imx-ocotp.o
}
#ifdef CONFIG_SOC_IMX53
-const struct imx_ahci_imx_data imx53_ahci_imx_data __initconst =
+const struct imx_ahci_data imx53_ahci_data __initconst =
imx_ahci_data_entry_single(MX53);
#endif
-struct platform_device *__init imx_add_ahci_imx(
- const struct imx_ahci_imx_data *data,
+#ifdef CONFIG_SOC_IMX6Q
+const struct imx_ahci_data imx6q_ahci_data __initconst =
+ imx_ahci_data_entry_single(MX6Q);
+#endif
+
+struct platform_device *__init imx_add_ahci(
+ const struct imx_ahci_data *data,
const struct ahci_platform_data *pdata)
{
struct resource res[] = {
enum {
HOST_CAP = 0x00,
HOST_CAP_SSS = (1 << 27), /* Staggered Spin-up */
+ HOST_CTL = 0x04, /* global host control */
+ HOST_RESET = (1 << 0), /* reset controller; self-clear */
HOST_PORTS_IMPL = 0x0c,
HOST_TIMER1MS = 0xe0, /* Timer 1-ms */
+ HOST_VERSIONR = 0xfc, /* host version register*/
+
/* Offest used to control the MPLL input clk */
PHY_CR_CLOCK_FREQ_OVRD = 0x12,
/* Port0 SATA Status */
SATA_PHY_CR_CLOCK_MPLL_TST = 0x0017,
};
+extern int sata_init(void __iomem *addr, unsigned long timer1ms);
#endif /* __PLAT_MXC_AHCI_SATA_H__ */
const struct fsl_mxc_tve_platform_data *pdata);
#include <linux/ahci_platform.h>
-struct imx_ahci_imx_data {
+struct imx_ahci_data {
int id;
resource_size_t iobase;
resource_size_t irq;
};
-struct platform_device *__init imx_add_ahci_imx(
- const struct imx_ahci_imx_data *data,
+struct platform_device *__init imx_add_ahci(
+ const struct imx_ahci_data *data,
const struct ahci_platform_data *pdata);
struct imx_iim_data {