diff options
author | Geert Uytterhoeven <geert+renesas@linux-m68k.org> | 2014-02-04 10:24:01 -0500 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2014-02-06 06:32:23 -0500 |
commit | bcca4e8e5b6383cea9a2b310d5a964d8db18b9c7 (patch) | |
tree | cf2a6ad4807385216832633c43140b8ea312cd35 /arch/arm/mach-shmobile | |
parent | 664517474c4993c5d560d0e394c36583b7c99535 (diff) |
ARM: shmobile: koelsch legacy: Add QSPI support
Enable support for the Spansion s25fl512s SPI FLASH on the Koelsch board:
- Add QSPI platform device, resources, platform data, and pinmux,
- Add FLASH data and MTD partitions.
Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r-- | arch/arm/mach-shmobile/board-koelsch.c | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c index 2741dba74aaa..d42637db596a 100644 --- a/arch/arm/mach-shmobile/board-koelsch.c +++ b/arch/arm/mach-shmobile/board-koelsch.c | |||
@@ -26,12 +26,17 @@ | |||
26 | #include <linux/irq.h> | 26 | #include <linux/irq.h> |
27 | #include <linux/kernel.h> | 27 | #include <linux/kernel.h> |
28 | #include <linux/leds.h> | 28 | #include <linux/leds.h> |
29 | #include <linux/mtd/mtd.h> | ||
30 | #include <linux/mtd/partitions.h> | ||
29 | #include <linux/phy.h> | 31 | #include <linux/phy.h> |
30 | #include <linux/pinctrl/machine.h> | 32 | #include <linux/pinctrl/machine.h> |
31 | #include <linux/platform_data/gpio-rcar.h> | 33 | #include <linux/platform_data/gpio-rcar.h> |
32 | #include <linux/platform_data/rcar-du.h> | 34 | #include <linux/platform_data/rcar-du.h> |
33 | #include <linux/platform_device.h> | 35 | #include <linux/platform_device.h> |
34 | #include <linux/sh_eth.h> | 36 | #include <linux/sh_eth.h> |
37 | #include <linux/spi/flash.h> | ||
38 | #include <linux/spi/rspi.h> | ||
39 | #include <linux/spi/spi.h> | ||
35 | #include <mach/common.h> | 40 | #include <mach/common.h> |
36 | #include <mach/irqs.h> | 41 | #include <mach/irqs.h> |
37 | #include <mach/r8a7791.h> | 42 | #include <mach/r8a7791.h> |
@@ -150,6 +155,55 @@ static const struct gpio_keys_platform_data koelsch_keys_pdata __initconst = { | |||
150 | .nbuttons = ARRAY_SIZE(gpio_buttons), | 155 | .nbuttons = ARRAY_SIZE(gpio_buttons), |
151 | }; | 156 | }; |
152 | 157 | ||
158 | /* QSPI */ | ||
159 | static const struct resource qspi_resources[] __initconst = { | ||
160 | DEFINE_RES_MEM(0xe6b10000, 0x1000), | ||
161 | DEFINE_RES_IRQ_NAMED(gic_spi(184), "mux"), | ||
162 | }; | ||
163 | |||
164 | static const struct rspi_plat_data qspi_pdata __initconst = { | ||
165 | .num_chipselect = 1, | ||
166 | }; | ||
167 | |||
168 | /* SPI Flash memory (Spansion S25FL512SAGMFIG11 64 MiB) */ | ||
169 | static struct mtd_partition spi_flash_part[] = { | ||
170 | { | ||
171 | .name = "loader", | ||
172 | .offset = 0x00000000, | ||
173 | .size = 512 * 1024, | ||
174 | .mask_flags = MTD_WRITEABLE, | ||
175 | }, | ||
176 | { | ||
177 | .name = "bootenv", | ||
178 | .offset = MTDPART_OFS_APPEND, | ||
179 | .size = 512 * 1024, | ||
180 | .mask_flags = MTD_WRITEABLE, | ||
181 | }, | ||
182 | { | ||
183 | .name = "data", | ||
184 | .offset = MTDPART_OFS_APPEND, | ||
185 | .size = MTDPART_SIZ_FULL, | ||
186 | }, | ||
187 | }; | ||
188 | |||
189 | static const struct flash_platform_data spi_flash_data = { | ||
190 | .name = "m25p80", | ||
191 | .parts = spi_flash_part, | ||
192 | .nr_parts = ARRAY_SIZE(spi_flash_part), | ||
193 | .type = "s25fl512s", | ||
194 | }; | ||
195 | |||
196 | static const struct spi_board_info spi_info[] __initconst = { | ||
197 | { | ||
198 | .modalias = "m25p80", | ||
199 | .platform_data = &spi_flash_data, | ||
200 | .mode = SPI_MODE_0, | ||
201 | .max_speed_hz = 30000000, | ||
202 | .bus_num = 0, | ||
203 | .chip_select = 0, | ||
204 | }, | ||
205 | }; | ||
206 | |||
153 | /* SATA0 */ | 207 | /* SATA0 */ |
154 | static const struct resource sata0_resources[] __initconst = { | 208 | static const struct resource sata0_resources[] __initconst = { |
155 | DEFINE_RES_MEM(0xee300000, 0x2000), | 209 | DEFINE_RES_MEM(0xee300000, 0x2000), |
@@ -214,6 +268,11 @@ static const struct pinctrl_map koelsch_pinctrl_map[] = { | |||
214 | "eth_rmii", "eth"), | 268 | "eth_rmii", "eth"), |
215 | PIN_MAP_MUX_GROUP_DEFAULT("r8a7791-ether", "pfc-r8a7791", | 269 | PIN_MAP_MUX_GROUP_DEFAULT("r8a7791-ether", "pfc-r8a7791", |
216 | "intc_irq0", "intc"), | 270 | "intc_irq0", "intc"), |
271 | /* QSPI */ | ||
272 | PIN_MAP_MUX_GROUP_DEFAULT("qspi.0", "pfc-r8a7791", | ||
273 | "qspi_ctrl", "qspi"), | ||
274 | PIN_MAP_MUX_GROUP_DEFAULT("qspi.0", "pfc-r8a7791", | ||
275 | "qspi_data4", "qspi"), | ||
217 | /* SCIF0 (CN19: DEBUG SERIAL0) */ | 276 | /* SCIF0 (CN19: DEBUG SERIAL0) */ |
218 | PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.6", "pfc-r8a7791", | 277 | PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.6", "pfc-r8a7791", |
219 | "scif0_data_d", "scif0"), | 278 | "scif0_data_d", "scif0"), |
@@ -248,6 +307,11 @@ static void __init koelsch_add_standard_devices(void) | |||
248 | platform_device_register_data(&platform_bus, "gpio-keys", -1, | 307 | platform_device_register_data(&platform_bus, "gpio-keys", -1, |
249 | &koelsch_keys_pdata, | 308 | &koelsch_keys_pdata, |
250 | sizeof(koelsch_keys_pdata)); | 309 | sizeof(koelsch_keys_pdata)); |
310 | platform_device_register_resndata(&platform_bus, "qspi", 0, | ||
311 | qspi_resources, | ||
312 | ARRAY_SIZE(qspi_resources), | ||
313 | &qspi_pdata, sizeof(qspi_pdata)); | ||
314 | spi_register_board_info(spi_info, ARRAY_SIZE(spi_info)); | ||
251 | 315 | ||
252 | koelsch_add_du_device(); | 316 | koelsch_add_du_device(); |
253 | 317 | ||