diff options
Diffstat (limited to 'arch/arm/mach-mx5/board-mx51_3ds.c')
-rw-r--r-- | arch/arm/mach-mx5/board-mx51_3ds.c | 44 |
1 files changed, 37 insertions, 7 deletions
diff --git a/arch/arm/mach-mx5/board-mx51_3ds.c b/arch/arm/mach-mx5/board-mx51_3ds.c index f95c2fd9466..79ce8dcf3cd 100644 --- a/arch/arm/mach-mx5/board-mx51_3ds.c +++ b/arch/arm/mach-mx5/board-mx51_3ds.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/irq.h> | 13 | #include <linux/irq.h> |
14 | #include <linux/platform_device.h> | 14 | #include <linux/platform_device.h> |
15 | #include <linux/input/matrix_keypad.h> | 15 | #include <linux/input/matrix_keypad.h> |
16 | #include <linux/spi/spi.h> | ||
16 | 17 | ||
17 | #include <asm/mach-types.h> | 18 | #include <asm/mach-types.h> |
18 | #include <asm/mach/arch.h> | 19 | #include <asm/mach/arch.h> |
@@ -21,12 +22,13 @@ | |||
21 | #include <mach/hardware.h> | 22 | #include <mach/hardware.h> |
22 | #include <mach/common.h> | 23 | #include <mach/common.h> |
23 | #include <mach/iomux-mx51.h> | 24 | #include <mach/iomux-mx51.h> |
24 | #include <mach/imx-uart.h> | ||
25 | #include <mach/3ds_debugboard.h> | 25 | #include <mach/3ds_debugboard.h> |
26 | 26 | ||
27 | #include "devices-imx51.h" | ||
27 | #include "devices.h" | 28 | #include "devices.h" |
28 | 29 | ||
29 | #define EXPIO_PARENT_INT (MXC_INTERNAL_IRQS + GPIO_PORTA + 6) | 30 | #define EXPIO_PARENT_INT (MXC_INTERNAL_IRQS + GPIO_PORTA + 6) |
31 | #define MX51_3DS_ECSPI2_CS (GPIO_PORTC + 28) | ||
30 | 32 | ||
31 | static struct pad_desc mx51_3ds_pads[] = { | 33 | static struct pad_desc mx51_3ds_pads[] = { |
32 | /* UART1 */ | 34 | /* UART1 */ |
@@ -61,19 +63,25 @@ static struct pad_desc mx51_3ds_pads[] = { | |||
61 | MX51_PAD_KEY_COL3__KEY_COL3, | 63 | MX51_PAD_KEY_COL3__KEY_COL3, |
62 | MX51_PAD_KEY_COL4__KEY_COL4, | 64 | MX51_PAD_KEY_COL4__KEY_COL4, |
63 | MX51_PAD_KEY_COL5__KEY_COL5, | 65 | MX51_PAD_KEY_COL5__KEY_COL5, |
66 | |||
67 | /* eCSPI2 */ | ||
68 | MX51_PAD_NANDF_RB2__ECSPI2_SCLK, | ||
69 | MX51_PAD_NANDF_RB3__ECSPI2_MISO, | ||
70 | MX51_PAD_NANDF_D15__ECSPI2_MOSI, | ||
71 | MX51_PAD_NANDF_D12__GPIO_3_28, | ||
64 | }; | 72 | }; |
65 | 73 | ||
66 | /* Serial ports */ | 74 | /* Serial ports */ |
67 | #if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE) | 75 | #if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE) |
68 | static struct imxuart_platform_data uart_pdata = { | 76 | static const struct imxuart_platform_data uart_pdata __initconst = { |
69 | .flags = IMXUART_HAVE_RTSCTS, | 77 | .flags = IMXUART_HAVE_RTSCTS, |
70 | }; | 78 | }; |
71 | 79 | ||
72 | static inline void mxc_init_imx_uart(void) | 80 | static inline void mxc_init_imx_uart(void) |
73 | { | 81 | { |
74 | mxc_register_device(&mxc_uart_device0, &uart_pdata); | 82 | imx51_add_imx_uart(0, &uart_pdata); |
75 | mxc_register_device(&mxc_uart_device1, &uart_pdata); | 83 | imx51_add_imx_uart(1, &uart_pdata); |
76 | mxc_register_device(&mxc_uart_device2, &uart_pdata); | 84 | imx51_add_imx_uart(2, &uart_pdata); |
77 | } | 85 | } |
78 | #else /* !SERIAL_IMX */ | 86 | #else /* !SERIAL_IMX */ |
79 | static inline void mxc_init_imx_uart(void) | 87 | static inline void mxc_init_imx_uart(void) |
@@ -127,6 +135,26 @@ static inline void mxc_init_keypad(void) | |||
127 | } | 135 | } |
128 | #endif | 136 | #endif |
129 | 137 | ||
138 | static int mx51_3ds_spi2_cs[] = { | ||
139 | MXC_SPI_CS(0), | ||
140 | MX51_3DS_ECSPI2_CS, | ||
141 | }; | ||
142 | |||
143 | static const struct spi_imx_master mx51_3ds_ecspi2_pdata __initconst = { | ||
144 | .chipselect = mx51_3ds_spi2_cs, | ||
145 | .num_chipselect = ARRAY_SIZE(mx51_3ds_spi2_cs), | ||
146 | }; | ||
147 | |||
148 | static struct spi_board_info mx51_3ds_spi_nor_device[] = { | ||
149 | { | ||
150 | .modalias = "m25p80", | ||
151 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | ||
152 | .bus_num = 1, | ||
153 | .chip_select = 1, | ||
154 | .mode = SPI_MODE_0, | ||
155 | .platform_data = NULL,}, | ||
156 | }; | ||
157 | |||
130 | /* | 158 | /* |
131 | * Board specific initialization. | 159 | * Board specific initialization. |
132 | */ | 160 | */ |
@@ -136,6 +164,10 @@ static void __init mxc_board_init(void) | |||
136 | ARRAY_SIZE(mx51_3ds_pads)); | 164 | ARRAY_SIZE(mx51_3ds_pads)); |
137 | mxc_init_imx_uart(); | 165 | mxc_init_imx_uart(); |
138 | 166 | ||
167 | imx51_add_ecspi(1, &mx51_3ds_ecspi2_pdata); | ||
168 | spi_register_board_info(mx51_3ds_spi_nor_device, | ||
169 | ARRAY_SIZE(mx51_3ds_spi_nor_device)); | ||
170 | |||
139 | if (mxc_expio_init(MX51_CS5_BASE_ADDR, EXPIO_PARENT_INT)) | 171 | if (mxc_expio_init(MX51_CS5_BASE_ADDR, EXPIO_PARENT_INT)) |
140 | printk(KERN_WARNING "Init of the debugboard failed, all " | 172 | printk(KERN_WARNING "Init of the debugboard failed, all " |
141 | "devices on the board are unusable.\n"); | 173 | "devices on the board are unusable.\n"); |
@@ -154,8 +186,6 @@ static struct sys_timer mxc_timer = { | |||
154 | 186 | ||
155 | MACHINE_START(MX51_3DS, "Freescale MX51 3-Stack Board") | 187 | MACHINE_START(MX51_3DS, "Freescale MX51 3-Stack Board") |
156 | /* Maintainer: Freescale Semiconductor, Inc. */ | 188 | /* Maintainer: Freescale Semiconductor, Inc. */ |
157 | .phys_io = MX51_AIPS1_BASE_ADDR, | ||
158 | .io_pg_offst = ((MX51_AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, | ||
159 | .boot_params = PHYS_OFFSET + 0x100, | 189 | .boot_params = PHYS_OFFSET + 0x100, |
160 | .map_io = mx51_map_io, | 190 | .map_io = mx51_map_io, |
161 | .init_irq = mx51_init_irq, | 191 | .init_irq = mx51_init_irq, |