diff options
-rw-r--r-- | arch/arm/mach-mx5/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/mach-mx5/board-mx51_efikamx.c | 58 |
2 files changed, 59 insertions, 0 deletions
diff --git a/arch/arm/mach-mx5/Kconfig b/arch/arm/mach-mx5/Kconfig index 0345abe79e29..13602045df62 100644 --- a/arch/arm/mach-mx5/Kconfig +++ b/arch/arm/mach-mx5/Kconfig | |||
@@ -83,6 +83,7 @@ config MACH_MX51_EFIKAMX | |||
83 | bool "Support MX51 Genesi Efika MX nettop" | 83 | bool "Support MX51 Genesi Efika MX nettop" |
84 | select IMX_HAVE_PLATFORM_ESDHC | 84 | select IMX_HAVE_PLATFORM_ESDHC |
85 | select IMX_HAVE_PLATFORM_IMX_UART | 85 | select IMX_HAVE_PLATFORM_IMX_UART |
86 | select IMX_HAVE_PLATFORM_SPI_IMX | ||
86 | help | 87 | help |
87 | Include support for Genesi Efika MX nettop. This includes specific | 88 | Include support for Genesi Efika MX nettop. This includes specific |
88 | configurations for the board and its peripherals. | 89 | configurations for the board and its peripherals. |
diff --git a/arch/arm/mach-mx5/board-mx51_efikamx.c b/arch/arm/mach-mx5/board-mx51_efikamx.c index 4d102ea22e70..f84452f8ef74 100644 --- a/arch/arm/mach-mx5/board-mx51_efikamx.c +++ b/arch/arm/mach-mx5/board-mx51_efikamx.c | |||
@@ -23,6 +23,8 @@ | |||
23 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
24 | #include <linux/io.h> | 24 | #include <linux/io.h> |
25 | #include <linux/fsl_devices.h> | 25 | #include <linux/fsl_devices.h> |
26 | #include <linux/spi/flash.h> | ||
27 | #include <linux/spi/spi.h> | ||
26 | 28 | ||
27 | #include <mach/common.h> | 29 | #include <mach/common.h> |
28 | #include <mach/hardware.h> | 30 | #include <mach/hardware.h> |
@@ -51,6 +53,9 @@ | |||
51 | 53 | ||
52 | #define EFIKAMX_POWER_KEY (1*32 + 31) | 54 | #define EFIKAMX_POWER_KEY (1*32 + 31) |
53 | 55 | ||
56 | #define EFIKAMX_SPI_CS0 (3*32 + 24) | ||
57 | #define EFIKAMX_SPI_CS1 (3*32 + 25) | ||
58 | |||
54 | /* the pci ids pin have pull up. they're driven low according to board id */ | 59 | /* the pci ids pin have pull up. they're driven low according to board id */ |
55 | #define MX51_PAD_PCBID0 IOMUX_PAD(0x518, 0x130, 3, 0x0, 0, PAD_CTL_PUS_100K_UP) | 60 | #define MX51_PAD_PCBID0 IOMUX_PAD(0x518, 0x130, 3, 0x0, 0, PAD_CTL_PUS_100K_UP) |
56 | #define MX51_PAD_PCBID1 IOMUX_PAD(0x51C, 0x134, 3, 0x0, 0, PAD_CTL_PUS_100K_UP) | 61 | #define MX51_PAD_PCBID1 IOMUX_PAD(0x51C, 0x134, 3, 0x0, 0, PAD_CTL_PUS_100K_UP) |
@@ -97,6 +102,14 @@ static iomux_v3_cfg_t mx51efikamx_pads[] = { | |||
97 | 102 | ||
98 | /* power key */ | 103 | /* power key */ |
99 | MX51_PAD_PWRKEY, | 104 | MX51_PAD_PWRKEY, |
105 | |||
106 | /* spi */ | ||
107 | MX51_PAD_CSPI1_MOSI__ECSPI1_MOSI, | ||
108 | MX51_PAD_CSPI1_MISO__ECSPI1_MISO, | ||
109 | MX51_PAD_CSPI1_SS0__GPIO_4_24, | ||
110 | MX51_PAD_CSPI1_SS1__GPIO_4_25, | ||
111 | MX51_PAD_CSPI1_RDY__ECSPI1_RDY, | ||
112 | MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK, | ||
100 | }; | 113 | }; |
101 | 114 | ||
102 | /* Serial ports */ | 115 | /* Serial ports */ |
@@ -242,6 +255,47 @@ static const struct gpio_keys_platform_data mx51_efikamx_powerkey_data __initcon | |||
242 | .nbuttons = ARRAY_SIZE(mx51_efikamx_powerkey), | 255 | .nbuttons = ARRAY_SIZE(mx51_efikamx_powerkey), |
243 | }; | 256 | }; |
244 | 257 | ||
258 | static struct mtd_partition mx51_efikamx_spi_nor_partitions[] = { | ||
259 | { | ||
260 | .name = "u-boot", | ||
261 | .offset = 0, | ||
262 | .size = SZ_256K, | ||
263 | }, | ||
264 | { | ||
265 | .name = "config", | ||
266 | .offset = MTDPART_OFS_APPEND, | ||
267 | .size = SZ_64K, | ||
268 | }, | ||
269 | }; | ||
270 | |||
271 | static struct flash_platform_data mx51_efikamx_spi_flash_data = { | ||
272 | .name = "spi_flash", | ||
273 | .parts = mx51_efikamx_spi_nor_partitions, | ||
274 | .nr_parts = ARRAY_SIZE(mx51_efikamx_spi_nor_partitions), | ||
275 | .type = "sst25vf032b", | ||
276 | }; | ||
277 | |||
278 | static struct spi_board_info mx51_efikamx_spi_board_info[] __initdata = { | ||
279 | { | ||
280 | .modalias = "m25p80", | ||
281 | .max_speed_hz = 25000000, | ||
282 | .bus_num = 0, | ||
283 | .chip_select = 1, | ||
284 | .platform_data = &mx51_efikamx_spi_flash_data, | ||
285 | .irq = -1, | ||
286 | }, | ||
287 | }; | ||
288 | |||
289 | static int mx51_efikamx_spi_cs[] = { | ||
290 | EFIKAMX_SPI_CS0, | ||
291 | EFIKAMX_SPI_CS1, | ||
292 | }; | ||
293 | |||
294 | static const struct spi_imx_master mx51_efikamx_spi_pdata __initconst = { | ||
295 | .chipselect = mx51_efikamx_spi_cs, | ||
296 | .num_chipselect = ARRAY_SIZE(mx51_efikamx_spi_cs), | ||
297 | }; | ||
298 | |||
245 | static void __init mxc_board_init(void) | 299 | static void __init mxc_board_init(void) |
246 | { | 300 | { |
247 | mxc_iomux_v3_setup_multiple_pads(mx51efikamx_pads, | 301 | mxc_iomux_v3_setup_multiple_pads(mx51efikamx_pads, |
@@ -259,6 +313,10 @@ static void __init mxc_board_init(void) | |||
259 | 313 | ||
260 | platform_device_register(&mx51_efikamx_leds_device); | 314 | platform_device_register(&mx51_efikamx_leds_device); |
261 | imx51_add_gpio_keys(&mx51_efikamx_powerkey_data); | 315 | imx51_add_gpio_keys(&mx51_efikamx_powerkey_data); |
316 | |||
317 | spi_register_board_info(mx51_efikamx_spi_board_info, | ||
318 | ARRAY_SIZE(mx51_efikamx_spi_board_info)); | ||
319 | imx51_add_ecspi(0, &mx51_efikamx_spi_pdata); | ||
262 | } | 320 | } |
263 | 321 | ||
264 | static void __init mx51_efikamx_timer_init(void) | 322 | static void __init mx51_efikamx_timer_init(void) |