diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-04-09 02:58:22 -0400 |
---|---|---|
committer | Shawn Guo <shawn.guo@linaro.org> | 2013-04-09 09:07:20 -0400 |
commit | e27da53bae60247d87c29cf744fb92afce673d6a (patch) | |
tree | 05e47fd4713c836c6bcde71ea7028ea370baa3bf | |
parent | 50dc3ef5365a8109a27084e62f2a17af02a06596 (diff) |
ARM i.MX53: remove platform ahci support
The i.MX53 ahci platform support is unused in mainline. To demotivate
people using it just remove it from the tree.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
-rw-r--r-- | arch/arm/mach-imx/devices/Kconfig | 4 | ||||
-rw-r--r-- | arch/arm/mach-imx/devices/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-imx/devices/devices-common.h | 10 | ||||
-rw-r--r-- | arch/arm/mach-imx/devices/platform-ahci-imx.c | 157 |
4 files changed, 0 insertions, 172 deletions
diff --git a/arch/arm/mach-imx/devices/Kconfig b/arch/arm/mach-imx/devices/Kconfig index 9b9ba1f4ffe1..3dd2b1b041d1 100644 --- a/arch/arm/mach-imx/devices/Kconfig +++ b/arch/arm/mach-imx/devices/Kconfig | |||
@@ -86,7 +86,3 @@ config IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX | |||
86 | 86 | ||
87 | config IMX_HAVE_PLATFORM_SPI_IMX | 87 | config IMX_HAVE_PLATFORM_SPI_IMX |
88 | bool | 88 | bool |
89 | |||
90 | config IMX_HAVE_PLATFORM_AHCI | ||
91 | bool | ||
92 | default y if ARCH_MX53 | ||
diff --git a/arch/arm/mach-imx/devices/Makefile b/arch/arm/mach-imx/devices/Makefile index 6acf37e0c119..67416fb1dc69 100644 --- a/arch/arm/mach-imx/devices/Makefile +++ b/arch/arm/mach-imx/devices/Makefile | |||
@@ -29,5 +29,4 @@ obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_RTC) += platform-mxc_rtc.o | |||
29 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_W1) += platform-mxc_w1.o | 29 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_W1) += platform-mxc_w1.o |
30 | obj-$(CONFIG_IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX) += platform-sdhci-esdhc-imx.o | 30 | obj-$(CONFIG_IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX) += platform-sdhci-esdhc-imx.o |
31 | obj-$(CONFIG_IMX_HAVE_PLATFORM_SPI_IMX) += platform-spi_imx.o | 31 | obj-$(CONFIG_IMX_HAVE_PLATFORM_SPI_IMX) += platform-spi_imx.o |
32 | obj-$(CONFIG_IMX_HAVE_PLATFORM_AHCI) += platform-ahci-imx.o | ||
33 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MX2_EMMA) += platform-mx2-emma.o | 32 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MX2_EMMA) += platform-mx2-emma.o |
diff --git a/arch/arm/mach-imx/devices/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h index 9bd5777ff0e7..453e20bc2657 100644 --- a/arch/arm/mach-imx/devices/devices-common.h +++ b/arch/arm/mach-imx/devices/devices-common.h | |||
@@ -344,13 +344,3 @@ struct platform_device *imx_add_imx_dma(char *name, resource_size_t iobase, | |||
344 | int irq, int irq_err); | 344 | int irq, int irq_err); |
345 | struct platform_device *imx_add_imx_sdma(char *name, | 345 | struct platform_device *imx_add_imx_sdma(char *name, |
346 | resource_size_t iobase, int irq, struct sdma_platform_data *pdata); | 346 | resource_size_t iobase, int irq, struct sdma_platform_data *pdata); |
347 | |||
348 | #include <linux/ahci_platform.h> | ||
349 | struct imx_ahci_imx_data { | ||
350 | const char *devid; | ||
351 | resource_size_t iobase; | ||
352 | resource_size_t irq; | ||
353 | }; | ||
354 | struct platform_device *__init imx_add_ahci_imx( | ||
355 | const struct imx_ahci_imx_data *data, | ||
356 | const struct ahci_platform_data *pdata); | ||
diff --git a/arch/arm/mach-imx/devices/platform-ahci-imx.c b/arch/arm/mach-imx/devices/platform-ahci-imx.c deleted file mode 100644 index 3d87dd9c284a..000000000000 --- a/arch/arm/mach-imx/devices/platform-ahci-imx.c +++ /dev/null | |||
@@ -1,157 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved. | ||
3 | */ | ||
4 | |||
5 | /* | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | |||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | |||
16 | * You should have received a copy of the GNU General Public License along | ||
17 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
19 | */ | ||
20 | |||
21 | #include <linux/io.h> | ||
22 | #include <linux/clk.h> | ||
23 | #include <linux/err.h> | ||
24 | #include <linux/device.h> | ||
25 | #include <linux/dma-mapping.h> | ||
26 | #include <asm/sizes.h> | ||
27 | |||
28 | #include "../hardware.h" | ||
29 | #include "devices-common.h" | ||
30 | |||
31 | #define imx_ahci_imx_data_entry_single(soc, _devid) \ | ||
32 | { \ | ||
33 | .devid = _devid, \ | ||
34 | .iobase = soc ## _SATA_BASE_ADDR, \ | ||
35 | .irq = soc ## _INT_SATA, \ | ||
36 | } | ||
37 | |||
38 | #ifdef CONFIG_SOC_IMX53 | ||
39 | const struct imx_ahci_imx_data imx53_ahci_imx_data __initconst = | ||
40 | imx_ahci_imx_data_entry_single(MX53, "imx53-ahci"); | ||
41 | #endif | ||
42 | |||
43 | enum { | ||
44 | HOST_CAP = 0x00, | ||
45 | HOST_CAP_SSS = (1 << 27), /* Staggered Spin-up */ | ||
46 | HOST_PORTS_IMPL = 0x0c, | ||
47 | HOST_TIMER1MS = 0xe0, /* Timer 1-ms */ | ||
48 | }; | ||
49 | |||
50 | static struct clk *sata_clk, *sata_ref_clk; | ||
51 | |||
52 | /* AHCI module Initialization, if return 0, initialization is successful. */ | ||
53 | static int imx_sata_init(struct device *dev, void __iomem *addr) | ||
54 | { | ||
55 | u32 tmpdata; | ||
56 | int ret = 0; | ||
57 | struct clk *clk; | ||
58 | |||
59 | sata_clk = clk_get(dev, "ahci"); | ||
60 | if (IS_ERR(sata_clk)) { | ||
61 | dev_err(dev, "no sata clock.\n"); | ||
62 | return PTR_ERR(sata_clk); | ||
63 | } | ||
64 | ret = clk_prepare_enable(sata_clk); | ||
65 | if (ret) { | ||
66 | dev_err(dev, "can't prepare/enable sata clock.\n"); | ||
67 | goto put_sata_clk; | ||
68 | } | ||
69 | |||
70 | /* Get the AHCI SATA PHY CLK */ | ||
71 | sata_ref_clk = clk_get(dev, "ahci_phy"); | ||
72 | if (IS_ERR(sata_ref_clk)) { | ||
73 | dev_err(dev, "no sata ref clock.\n"); | ||
74 | ret = PTR_ERR(sata_ref_clk); | ||
75 | goto release_sata_clk; | ||
76 | } | ||
77 | ret = clk_prepare_enable(sata_ref_clk); | ||
78 | if (ret) { | ||
79 | dev_err(dev, "can't prepare/enable sata ref clock.\n"); | ||
80 | goto put_sata_ref_clk; | ||
81 | } | ||
82 | |||
83 | /* Get the AHB clock rate, and configure the TIMER1MS reg later */ | ||
84 | clk = clk_get(dev, "ahci_dma"); | ||
85 | if (IS_ERR(clk)) { | ||
86 | dev_err(dev, "no dma clock.\n"); | ||
87 | ret = PTR_ERR(clk); | ||
88 | goto release_sata_ref_clk; | ||
89 | } | ||
90 | tmpdata = clk_get_rate(clk) / 1000; | ||
91 | clk_put(clk); | ||
92 | |||
93 | writel(tmpdata, addr + HOST_TIMER1MS); | ||
94 | |||
95 | tmpdata = readl(addr + HOST_CAP); | ||
96 | if (!(tmpdata & HOST_CAP_SSS)) { | ||
97 | tmpdata |= HOST_CAP_SSS; | ||
98 | writel(tmpdata, addr + HOST_CAP); | ||
99 | } | ||
100 | |||
101 | if (!(readl(addr + HOST_PORTS_IMPL) & 0x1)) | ||
102 | writel((readl(addr + HOST_PORTS_IMPL) | 0x1), | ||
103 | addr + HOST_PORTS_IMPL); | ||
104 | |||
105 | return 0; | ||
106 | |||
107 | release_sata_ref_clk: | ||
108 | clk_disable_unprepare(sata_ref_clk); | ||
109 | put_sata_ref_clk: | ||
110 | clk_put(sata_ref_clk); | ||
111 | release_sata_clk: | ||
112 | clk_disable_unprepare(sata_clk); | ||
113 | put_sata_clk: | ||
114 | clk_put(sata_clk); | ||
115 | |||
116 | return ret; | ||
117 | } | ||
118 | |||
119 | static void imx_sata_exit(struct device *dev) | ||
120 | { | ||
121 | clk_disable_unprepare(sata_ref_clk); | ||
122 | clk_put(sata_ref_clk); | ||
123 | |||
124 | clk_disable_unprepare(sata_clk); | ||
125 | clk_put(sata_clk); | ||
126 | |||
127 | } | ||
128 | struct platform_device *__init imx_add_ahci_imx( | ||
129 | const struct imx_ahci_imx_data *data, | ||
130 | const struct ahci_platform_data *pdata) | ||
131 | { | ||
132 | struct resource res[] = { | ||
133 | { | ||
134 | .start = data->iobase, | ||
135 | .end = data->iobase + SZ_4K - 1, | ||
136 | .flags = IORESOURCE_MEM, | ||
137 | }, { | ||
138 | .start = data->irq, | ||
139 | .end = data->irq, | ||
140 | .flags = IORESOURCE_IRQ, | ||
141 | }, | ||
142 | }; | ||
143 | |||
144 | return imx_add_platform_device_dmamask(data->devid, 0, | ||
145 | res, ARRAY_SIZE(res), | ||
146 | pdata, sizeof(*pdata), DMA_BIT_MASK(32)); | ||
147 | } | ||
148 | |||
149 | struct platform_device *__init imx53_add_ahci_imx(void) | ||
150 | { | ||
151 | struct ahci_platform_data pdata = { | ||
152 | .init = imx_sata_init, | ||
153 | .exit = imx_sata_exit, | ||
154 | }; | ||
155 | |||
156 | return imx_add_ahci_imx(&imx53_ahci_imx_data, &pdata); | ||
157 | } | ||