diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2013-06-11 22:11:41 -0400 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2013-06-13 01:42:42 -0400 |
commit | c06a164ce2f0f8791ac566a44eaf1d227a5b6b5b (patch) | |
tree | 2dd6084a2d3d6f216ddde683c035cfa9922f8e77 /arch | |
parent | ed17be92c00fde00b2431b31828736f8572d7ba7 (diff) |
ARM: shmobile: bockw: add SPI FLASH support
This patch enables Spansion S25FL008K chip on HSPI0
Signed-off-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-shmobile/board-bockw.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-bockw.c b/arch/arm/mach-shmobile/board-bockw.c index a4251cc2a405..7d42f12bf790 100644 --- a/arch/arm/mach-shmobile/board-bockw.c +++ b/arch/arm/mach-shmobile/board-bockw.c | |||
@@ -20,11 +20,14 @@ | |||
20 | 20 | ||
21 | #include <linux/mfd/tmio.h> | 21 | #include <linux/mfd/tmio.h> |
22 | #include <linux/mmc/host.h> | 22 | #include <linux/mmc/host.h> |
23 | #include <linux/mtd/partitions.h> | ||
23 | #include <linux/pinctrl/machine.h> | 24 | #include <linux/pinctrl/machine.h> |
24 | #include <linux/platform_device.h> | 25 | #include <linux/platform_device.h> |
25 | #include <linux/regulator/fixed.h> | 26 | #include <linux/regulator/fixed.h> |
26 | #include <linux/regulator/machine.h> | 27 | #include <linux/regulator/machine.h> |
27 | #include <linux/smsc911x.h> | 28 | #include <linux/smsc911x.h> |
29 | #include <linux/spi/spi.h> | ||
30 | #include <linux/spi/flash.h> | ||
28 | #include <mach/common.h> | 31 | #include <mach/common.h> |
29 | #include <mach/irqs.h> | 32 | #include <mach/irqs.h> |
30 | #include <mach/r8a7778.h> | 33 | #include <mach/r8a7778.h> |
@@ -84,10 +87,40 @@ static struct i2c_board_info i2c0_devices[] = { | |||
84 | }, | 87 | }, |
85 | }; | 88 | }; |
86 | 89 | ||
90 | /* HSPI*/ | ||
91 | static struct mtd_partition m25p80_spi_flash_partitions[] = { | ||
92 | { | ||
93 | .name = "data(spi)", | ||
94 | .size = 0x0100000, | ||
95 | .offset = 0, | ||
96 | }, | ||
97 | }; | ||
98 | |||
99 | static struct flash_platform_data spi_flash_data = { | ||
100 | .name = "m25p80", | ||
101 | .type = "s25fl008k", | ||
102 | .parts = m25p80_spi_flash_partitions, | ||
103 | .nr_parts = ARRAY_SIZE(m25p80_spi_flash_partitions), | ||
104 | }; | ||
105 | |||
106 | static struct spi_board_info spi_board_info[] __initdata = { | ||
107 | { | ||
108 | .modalias = "m25p80", | ||
109 | .max_speed_hz = 104000000, | ||
110 | .chip_select = 0, | ||
111 | .bus_num = 0, | ||
112 | .mode = SPI_MODE_0, | ||
113 | .platform_data = &spi_flash_data, | ||
114 | }, | ||
115 | }; | ||
116 | |||
87 | static const struct pinctrl_map bockw_pinctrl_map[] = { | 117 | static const struct pinctrl_map bockw_pinctrl_map[] = { |
88 | /* Ether */ | 118 | /* Ether */ |
89 | PIN_MAP_MUX_GROUP_DEFAULT("sh-eth", "pfc-r8a7778", | 119 | PIN_MAP_MUX_GROUP_DEFAULT("sh-eth", "pfc-r8a7778", |
90 | "ether_rmii", "ether"), | 120 | "ether_rmii", "ether"), |
121 | /* HSPI0 */ | ||
122 | PIN_MAP_MUX_GROUP_DEFAULT("sh-hspi.0", "pfc-r8a7778", | ||
123 | "hspi0_a", "hspi0"), | ||
91 | /* SCIF0 */ | 124 | /* SCIF0 */ |
92 | PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.0", "pfc-r8a7778", | 125 | PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.0", "pfc-r8a7778", |
93 | "scif0_data_a", "scif0"), | 126 | "scif0_data_a", "scif0"), |
@@ -111,9 +144,12 @@ static void __init bockw_init(void) | |||
111 | r8a7778_add_standard_devices(); | 144 | r8a7778_add_standard_devices(); |
112 | r8a7778_add_ether_device(ðer_platform_data); | 145 | r8a7778_add_ether_device(ðer_platform_data); |
113 | r8a7778_add_i2c_device(0); | 146 | r8a7778_add_i2c_device(0); |
147 | r8a7778_add_hspi_device(0); | ||
114 | 148 | ||
115 | i2c_register_board_info(0, i2c0_devices, | 149 | i2c_register_board_info(0, i2c0_devices, |
116 | ARRAY_SIZE(i2c0_devices)); | 150 | ARRAY_SIZE(i2c0_devices)); |
151 | spi_register_board_info(spi_board_info, | ||
152 | ARRAY_SIZE(spi_board_info)); | ||
117 | pinctrl_register_mappings(bockw_pinctrl_map, | 153 | pinctrl_register_mappings(bockw_pinctrl_map, |
118 | ARRAY_SIZE(bockw_pinctrl_map)); | 154 | ARRAY_SIZE(bockw_pinctrl_map)); |
119 | r8a7778_pinmux_init(); | 155 | r8a7778_pinmux_init(); |