diff options
author | Michael Williamson <[michael.williamson@criticallink.com]> | 2011-02-23 23:52:47 -0500 |
---|---|---|
committer | Kevin Hilman <khilman@ti.com> | 2011-03-11 13:48:29 -0500 |
commit | dd561c6a77edd5a106484901d8a5d3d5eb4a54b5 (patch) | |
tree | ed27674a16c6a6c9a098473ebf12b57ff75d54eb /arch/arm/mach-davinci/board-mityomapl138.c | |
parent | 54ce6883d29630ff334bee4256a25e3f8719a181 (diff) |
davinci: add spi devices support for MityDSP-L138/MityARM-1808 platform
This patch adds support for accessing the on board SPI NOR FLASH
device for MityDSP-L138 and MityARM-1808 SoMs.
Signed-off-by: Michael Williamson <michael.williamson@criticallink.com>
Tested-by: Michael Williamson <michael.williamson@criticallink.com>
Acked-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm/mach-davinci/board-mityomapl138.c')
-rw-r--r-- | arch/arm/mach-davinci/board-mityomapl138.c | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/board-mityomapl138.c b/arch/arm/mach-davinci/board-mityomapl138.c index 0ea59327dc28..2aa79c54f98e 100644 --- a/arch/arm/mach-davinci/board-mityomapl138.c +++ b/arch/arm/mach-davinci/board-mityomapl138.c | |||
@@ -17,6 +17,8 @@ | |||
17 | #include <linux/i2c.h> | 17 | #include <linux/i2c.h> |
18 | #include <linux/i2c/at24.h> | 18 | #include <linux/i2c/at24.h> |
19 | #include <linux/etherdevice.h> | 19 | #include <linux/etherdevice.h> |
20 | #include <linux/spi/spi.h> | ||
21 | #include <linux/spi/flash.h> | ||
20 | 22 | ||
21 | #include <asm/mach-types.h> | 23 | #include <asm/mach-types.h> |
22 | #include <asm/mach/arch.h> | 24 | #include <asm/mach/arch.h> |
@@ -25,6 +27,7 @@ | |||
25 | #include <mach/da8xx.h> | 27 | #include <mach/da8xx.h> |
26 | #include <mach/nand.h> | 28 | #include <mach/nand.h> |
27 | #include <mach/mux.h> | 29 | #include <mach/mux.h> |
30 | #include <mach/spi.h> | ||
28 | 31 | ||
29 | #define MITYOMAPL138_PHY_ID "0:03" | 32 | #define MITYOMAPL138_PHY_ID "0:03" |
30 | 33 | ||
@@ -294,6 +297,82 @@ static int __init pmic_tps65023_init(void) | |||
294 | } | 297 | } |
295 | 298 | ||
296 | /* | 299 | /* |
300 | * SPI Devices: | ||
301 | * SPI1_CS0: 8M Flash ST-M25P64-VME6G | ||
302 | */ | ||
303 | static struct mtd_partition spi_flash_partitions[] = { | ||
304 | [0] = { | ||
305 | .name = "ubl", | ||
306 | .offset = 0, | ||
307 | .size = SZ_64K, | ||
308 | .mask_flags = MTD_WRITEABLE, | ||
309 | }, | ||
310 | [1] = { | ||
311 | .name = "u-boot", | ||
312 | .offset = MTDPART_OFS_APPEND, | ||
313 | .size = SZ_512K, | ||
314 | .mask_flags = MTD_WRITEABLE, | ||
315 | }, | ||
316 | [2] = { | ||
317 | .name = "u-boot-env", | ||
318 | .offset = MTDPART_OFS_APPEND, | ||
319 | .size = SZ_64K, | ||
320 | .mask_flags = MTD_WRITEABLE, | ||
321 | }, | ||
322 | [3] = { | ||
323 | .name = "periph-config", | ||
324 | .offset = MTDPART_OFS_APPEND, | ||
325 | .size = SZ_64K, | ||
326 | .mask_flags = MTD_WRITEABLE, | ||
327 | }, | ||
328 | [4] = { | ||
329 | .name = "reserved", | ||
330 | .offset = MTDPART_OFS_APPEND, | ||
331 | .size = SZ_256K + SZ_64K, | ||
332 | }, | ||
333 | [5] = { | ||
334 | .name = "kernel", | ||
335 | .offset = MTDPART_OFS_APPEND, | ||
336 | .size = SZ_2M + SZ_1M, | ||
337 | }, | ||
338 | [6] = { | ||
339 | .name = "fpga", | ||
340 | .offset = MTDPART_OFS_APPEND, | ||
341 | .size = SZ_2M, | ||
342 | }, | ||
343 | [7] = { | ||
344 | .name = "spare", | ||
345 | .offset = MTDPART_OFS_APPEND, | ||
346 | .size = MTDPART_SIZ_FULL, | ||
347 | }, | ||
348 | }; | ||
349 | |||
350 | static struct flash_platform_data mityomapl138_spi_flash_data = { | ||
351 | .name = "m25p80", | ||
352 | .parts = spi_flash_partitions, | ||
353 | .nr_parts = ARRAY_SIZE(spi_flash_partitions), | ||
354 | .type = "m24p64", | ||
355 | }; | ||
356 | |||
357 | static struct davinci_spi_config spi_eprom_config = { | ||
358 | .io_type = SPI_IO_TYPE_DMA, | ||
359 | .c2tdelay = 8, | ||
360 | .t2cdelay = 8, | ||
361 | }; | ||
362 | |||
363 | static struct spi_board_info mityomapl138_spi_flash_info[] = { | ||
364 | { | ||
365 | .modalias = "m25p80", | ||
366 | .platform_data = &mityomapl138_spi_flash_data, | ||
367 | .controller_data = &spi_eprom_config, | ||
368 | .mode = SPI_MODE_0, | ||
369 | .max_speed_hz = 30000000, | ||
370 | .bus_num = 1, | ||
371 | .chip_select = 0, | ||
372 | }, | ||
373 | }; | ||
374 | |||
375 | /* | ||
297 | * MityDSP-L138 includes a 256 MByte large-page NAND flash | 376 | * MityDSP-L138 includes a 256 MByte large-page NAND flash |
298 | * (128K blocks). | 377 | * (128K blocks). |
299 | */ | 378 | */ |
@@ -448,6 +527,11 @@ static void __init mityomapl138_init(void) | |||
448 | 527 | ||
449 | mityomapl138_setup_nand(); | 528 | mityomapl138_setup_nand(); |
450 | 529 | ||
530 | ret = da8xx_register_spi(1, mityomapl138_spi_flash_info, | ||
531 | ARRAY_SIZE(mityomapl138_spi_flash_info)); | ||
532 | if (ret) | ||
533 | pr_warning("spi 1 registration failed: %d\n", ret); | ||
534 | |||
451 | mityomapl138_config_emac(); | 535 | mityomapl138_config_emac(); |
452 | 536 | ||
453 | ret = da8xx_register_rtc(); | 537 | ret = da8xx_register_rtc(); |