diff options
author | Hiep Cao Minh <cm-hiep@jinso.co.jp> | 2013-10-21 22:21:12 -0400 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2013-12-10 03:24:29 -0500 |
commit | 24cf82f44213fe4d36157d9920b59420159616ec (patch) | |
tree | 2b5ddd6a00ac4b6cd32e6d6d161e36a04b979008 /arch/arm/mach-shmobile/board-lager.c | |
parent | 90d423faa0ed53cfda9f12d119f6938dd1ab515d (diff) |
ARM: shmobile: Lager:add SPI FLASH support on QSPI
This patch enables Spansion S25FL512SAGMFIG11 chip on QSPI,
Add support for the QSPI interface on Lager.
Signed-off-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'arch/arm/mach-shmobile/board-lager.c')
-rw-r--r-- | arch/arm/mach-shmobile/board-lager.c | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c index d47052e3ceef..04cb93293617 100644 --- a/arch/arm/mach-shmobile/board-lager.c +++ b/arch/arm/mach-shmobile/board-lager.c | |||
@@ -39,6 +39,11 @@ | |||
39 | #include <mach/r8a7790.h> | 39 | #include <mach/r8a7790.h> |
40 | #include <asm/mach-types.h> | 40 | #include <asm/mach-types.h> |
41 | #include <asm/mach/arch.h> | 41 | #include <asm/mach/arch.h> |
42 | #include <linux/mtd/partitions.h> | ||
43 | #include <linux/mtd/mtd.h> | ||
44 | #include <linux/spi/flash.h> | ||
45 | #include <linux/spi/rspi.h> | ||
46 | #include <linux/spi/spi.h> | ||
42 | 47 | ||
43 | /* DU */ | 48 | /* DU */ |
44 | static struct rcar_du_encoder_data lager_du_encoders[] = { | 49 | static struct rcar_du_encoder_data lager_du_encoders[] = { |
@@ -166,6 +171,59 @@ static const struct resource ether_resources[] __initconst = { | |||
166 | DEFINE_RES_IRQ(gic_spi(162)), | 171 | DEFINE_RES_IRQ(gic_spi(162)), |
167 | }; | 172 | }; |
168 | 173 | ||
174 | /* SPI Flash memory (Spansion S25FL512SAGMFIG11 64Mb) */ | ||
175 | static struct mtd_partition spi_flash_part[] = { | ||
176 | /* Reserved for user loader program, read-only */ | ||
177 | { | ||
178 | .name = "loader", | ||
179 | .offset = 0, | ||
180 | .size = SZ_256K, | ||
181 | .mask_flags = MTD_WRITEABLE, | ||
182 | }, | ||
183 | /* Reserved for user program, read-only */ | ||
184 | { | ||
185 | .name = "user", | ||
186 | .offset = MTDPART_OFS_APPEND, | ||
187 | .size = SZ_4M, | ||
188 | .mask_flags = MTD_WRITEABLE, | ||
189 | }, | ||
190 | /* All else is writable (e.g. JFFS2) */ | ||
191 | { | ||
192 | .name = "flash", | ||
193 | .offset = MTDPART_OFS_APPEND, | ||
194 | .size = MTDPART_SIZ_FULL, | ||
195 | .mask_flags = 0, | ||
196 | }, | ||
197 | }; | ||
198 | |||
199 | static struct flash_platform_data spi_flash_data = { | ||
200 | .name = "m25p80", | ||
201 | .parts = spi_flash_part, | ||
202 | .nr_parts = ARRAY_SIZE(spi_flash_part), | ||
203 | .type = "s25fl512s", | ||
204 | }; | ||
205 | |||
206 | static const struct rspi_plat_data qspi_pdata __initconst = { | ||
207 | .num_chipselect = 1, | ||
208 | }; | ||
209 | |||
210 | static const struct spi_board_info spi_info[] __initconst = { | ||
211 | { | ||
212 | .modalias = "m25p80", | ||
213 | .platform_data = &spi_flash_data, | ||
214 | .mode = SPI_MODE_0, | ||
215 | .max_speed_hz = 30000000, | ||
216 | .bus_num = 0, | ||
217 | .chip_select = 0, | ||
218 | }, | ||
219 | }; | ||
220 | |||
221 | /* QSPI resource */ | ||
222 | static const struct resource qspi_resources[] __initconst = { | ||
223 | DEFINE_RES_MEM(0xe6b10000, 0x1000), | ||
224 | DEFINE_RES_IRQ(gic_spi(184)), | ||
225 | }; | ||
226 | |||
169 | static const struct pinctrl_map lager_pinctrl_map[] = { | 227 | static const struct pinctrl_map lager_pinctrl_map[] = { |
170 | /* DU (CN10: ARGB0, CN13: LVDS) */ | 228 | /* DU (CN10: ARGB0, CN13: LVDS) */ |
171 | PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7790", "pfc-r8a7790", | 229 | PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7790", "pfc-r8a7790", |
@@ -223,6 +281,12 @@ static void __init lager_add_standard_devices(void) | |||
223 | ðer_pdata, sizeof(ether_pdata)); | 281 | ðer_pdata, sizeof(ether_pdata)); |
224 | 282 | ||
225 | lager_add_du_device(); | 283 | lager_add_du_device(); |
284 | |||
285 | platform_device_register_resndata(&platform_bus, "qspi", 0, | ||
286 | qspi_resources, | ||
287 | ARRAY_SIZE(qspi_resources), | ||
288 | &qspi_pdata, sizeof(qspi_pdata)); | ||
289 | spi_register_board_info(spi_info, ARRAY_SIZE(spi_info)); | ||
226 | } | 290 | } |
227 | 291 | ||
228 | /* | 292 | /* |