diff options
Diffstat (limited to 'arch/arm/mach-mxs/mach-tx28.c')
-rw-r--r-- | arch/arm/mach-mxs/mach-tx28.c | 173 |
1 files changed, 173 insertions, 0 deletions
diff --git a/arch/arm/mach-mxs/mach-tx28.c b/arch/arm/mach-mxs/mach-tx28.c new file mode 100644 index 000000000000..b609b84784d0 --- /dev/null +++ b/arch/arm/mach-mxs/mach-tx28.c | |||
@@ -0,0 +1,173 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 <LW@KARO-electronics.de> | ||
3 | * | ||
4 | * based on: mach-mx28_evk.c | ||
5 | * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or | ||
8 | * modify it under the terms of the GNU General Public License | ||
9 | * version 2 as published by the Free Software Foundation | ||
10 | */ | ||
11 | #include <linux/kernel.h> | ||
12 | #include <linux/gpio.h> | ||
13 | #include <linux/leds.h> | ||
14 | #include <linux/platform_device.h> | ||
15 | #include <linux/spi/spi.h> | ||
16 | #include <linux/spi/spi_gpio.h> | ||
17 | |||
18 | #include <asm/mach/arch.h> | ||
19 | #include <asm/mach/time.h> | ||
20 | |||
21 | #include <mach/common.h> | ||
22 | #include <mach/iomux-mx28.h> | ||
23 | |||
24 | #include "devices-mx28.h" | ||
25 | #include "module-tx28.h" | ||
26 | |||
27 | #define TX28_STK5_GPIO_LED MXS_GPIO_NR(4, 10) | ||
28 | |||
29 | static const iomux_cfg_t tx28_stk5v3_pads[] __initconst = { | ||
30 | /* LED */ | ||
31 | MX28_PAD_ENET0_RXD3__GPIO_4_10 | | ||
32 | MXS_PAD_3V3 | MXS_PAD_4MA | MXS_PAD_NOPULL, | ||
33 | |||
34 | /* framebuffer */ | ||
35 | #define LCD_MODE (MXS_PAD_3V3 | MXS_PAD_4MA) | ||
36 | MX28_PAD_LCD_D00__LCD_D0 | LCD_MODE, | ||
37 | MX28_PAD_LCD_D01__LCD_D1 | LCD_MODE, | ||
38 | MX28_PAD_LCD_D02__LCD_D2 | LCD_MODE, | ||
39 | MX28_PAD_LCD_D03__LCD_D3 | LCD_MODE, | ||
40 | MX28_PAD_LCD_D04__LCD_D4 | LCD_MODE, | ||
41 | MX28_PAD_LCD_D05__LCD_D5 | LCD_MODE, | ||
42 | MX28_PAD_LCD_D06__LCD_D6 | LCD_MODE, | ||
43 | MX28_PAD_LCD_D07__LCD_D7 | LCD_MODE, | ||
44 | MX28_PAD_LCD_D08__LCD_D8 | LCD_MODE, | ||
45 | MX28_PAD_LCD_D09__LCD_D9 | LCD_MODE, | ||
46 | MX28_PAD_LCD_D10__LCD_D10 | LCD_MODE, | ||
47 | MX28_PAD_LCD_D11__LCD_D11 | LCD_MODE, | ||
48 | MX28_PAD_LCD_D12__LCD_D12 | LCD_MODE, | ||
49 | MX28_PAD_LCD_D13__LCD_D13 | LCD_MODE, | ||
50 | MX28_PAD_LCD_D14__LCD_D14 | LCD_MODE, | ||
51 | MX28_PAD_LCD_D15__LCD_D15 | LCD_MODE, | ||
52 | MX28_PAD_LCD_D16__LCD_D16 | LCD_MODE, | ||
53 | MX28_PAD_LCD_D17__LCD_D17 | LCD_MODE, | ||
54 | MX28_PAD_LCD_D18__LCD_D18 | LCD_MODE, | ||
55 | MX28_PAD_LCD_D19__LCD_D19 | LCD_MODE, | ||
56 | MX28_PAD_LCD_D20__LCD_D20 | LCD_MODE, | ||
57 | MX28_PAD_LCD_D21__LCD_D21 | LCD_MODE, | ||
58 | MX28_PAD_LCD_D22__LCD_D22 | LCD_MODE, | ||
59 | MX28_PAD_LCD_D23__LCD_D23 | LCD_MODE, | ||
60 | MX28_PAD_LCD_RD_E__LCD_VSYNC | LCD_MODE, | ||
61 | MX28_PAD_LCD_WR_RWN__LCD_HSYNC | LCD_MODE, | ||
62 | MX28_PAD_LCD_RS__LCD_DOTCLK | LCD_MODE, | ||
63 | MX28_PAD_LCD_CS__LCD_CS | LCD_MODE, | ||
64 | MX28_PAD_LCD_VSYNC__LCD_VSYNC | LCD_MODE, | ||
65 | MX28_PAD_LCD_HSYNC__LCD_HSYNC | LCD_MODE, | ||
66 | MX28_PAD_LCD_DOTCLK__LCD_DOTCLK | LCD_MODE, | ||
67 | MX28_PAD_LCD_ENABLE__GPIO_1_31 | LCD_MODE, | ||
68 | MX28_PAD_LCD_RESET__GPIO_3_30 | LCD_MODE, | ||
69 | MX28_PAD_PWM0__PWM_0 | LCD_MODE, | ||
70 | |||
71 | /* UART1 */ | ||
72 | MX28_PAD_AUART0_CTS__DUART_RX, | ||
73 | MX28_PAD_AUART0_RTS__DUART_TX, | ||
74 | MX28_PAD_AUART0_TX__DUART_RTS, | ||
75 | MX28_PAD_AUART0_RX__DUART_CTS, | ||
76 | |||
77 | /* UART2 */ | ||
78 | MX28_PAD_AUART1_RX__AUART1_RX, | ||
79 | MX28_PAD_AUART1_TX__AUART1_TX, | ||
80 | MX28_PAD_AUART1_RTS__AUART1_RTS, | ||
81 | MX28_PAD_AUART1_CTS__AUART1_CTS, | ||
82 | |||
83 | /* CAN */ | ||
84 | MX28_PAD_GPMI_RDY2__CAN0_TX, | ||
85 | MX28_PAD_GPMI_RDY3__CAN0_RX, | ||
86 | |||
87 | /* I2C */ | ||
88 | MX28_PAD_I2C0_SCL__I2C0_SCL, | ||
89 | MX28_PAD_I2C0_SDA__I2C0_SDA, | ||
90 | |||
91 | /* TSC2007 */ | ||
92 | MX28_PAD_SAIF0_MCLK__GPIO_3_20 | MXS_PAD_3V3 | MXS_PAD_4MA | MXS_PAD_PULLUP, | ||
93 | |||
94 | /* MMC0 */ | ||
95 | MX28_PAD_SSP0_DATA0__SSP0_D0 | | ||
96 | (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), | ||
97 | MX28_PAD_SSP0_DATA1__SSP0_D1 | | ||
98 | (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), | ||
99 | MX28_PAD_SSP0_DATA2__SSP0_D2 | | ||
100 | (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), | ||
101 | MX28_PAD_SSP0_DATA3__SSP0_D3 | | ||
102 | (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), | ||
103 | MX28_PAD_SSP0_DATA4__SSP0_D4 | | ||
104 | (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), | ||
105 | MX28_PAD_SSP0_DATA5__SSP0_D5 | | ||
106 | (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), | ||
107 | MX28_PAD_SSP0_DATA6__SSP0_D6 | | ||
108 | (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), | ||
109 | MX28_PAD_SSP0_DATA7__SSP0_D7 | | ||
110 | (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), | ||
111 | MX28_PAD_SSP0_CMD__SSP0_CMD | | ||
112 | (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), | ||
113 | MX28_PAD_SSP0_DETECT__SSP0_CARD_DETECT | | ||
114 | (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_NOPULL), | ||
115 | MX28_PAD_SSP0_SCK__SSP0_SCK | | ||
116 | (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_NOPULL), | ||
117 | }; | ||
118 | |||
119 | static struct gpio_led tx28_stk5v3_leds[] = { | ||
120 | { | ||
121 | .name = "GPIO-LED", | ||
122 | .default_trigger = "heartbeat", | ||
123 | .gpio = TX28_STK5_GPIO_LED, | ||
124 | }, | ||
125 | }; | ||
126 | |||
127 | static const struct gpio_led_platform_data tx28_stk5v3_led_data __initconst = { | ||
128 | .leds = tx28_stk5v3_leds, | ||
129 | .num_leds = ARRAY_SIZE(tx28_stk5v3_leds), | ||
130 | }; | ||
131 | |||
132 | static struct spi_board_info tx28_spi_board_info[] = { | ||
133 | { | ||
134 | .modalias = "spidev", | ||
135 | .max_speed_hz = 20000000, | ||
136 | .bus_num = 0, | ||
137 | .chip_select = 1, | ||
138 | .controller_data = (void *)SPI_GPIO_NO_CHIPSELECT, | ||
139 | .mode = SPI_MODE_0, | ||
140 | }, | ||
141 | }; | ||
142 | |||
143 | static void __init tx28_stk5v3_init(void) | ||
144 | { | ||
145 | mxs_iomux_setup_multiple_pads(tx28_stk5v3_pads, | ||
146 | ARRAY_SIZE(tx28_stk5v3_pads)); | ||
147 | |||
148 | mx28_add_duart(); /* UART1 */ | ||
149 | mx28_add_auart(1); /* UART2 */ | ||
150 | |||
151 | tx28_add_fec0(); | ||
152 | /* spi via ssp will be added when available */ | ||
153 | spi_register_board_info(tx28_spi_board_info, | ||
154 | ARRAY_SIZE(tx28_spi_board_info)); | ||
155 | mxs_add_platform_device("leds-gpio", 0, NULL, 0, | ||
156 | &tx28_stk5v3_led_data, sizeof(tx28_stk5v3_led_data)); | ||
157 | } | ||
158 | |||
159 | static void __init tx28_timer_init(void) | ||
160 | { | ||
161 | mx28_clocks_init(); | ||
162 | } | ||
163 | |||
164 | static struct sys_timer tx28_timer = { | ||
165 | .init = tx28_timer_init, | ||
166 | }; | ||
167 | |||
168 | MACHINE_START(TX28, "Ka-Ro electronics TX28 module") | ||
169 | .map_io = mx28_map_io, | ||
170 | .init_irq = mx28_init_irq, | ||
171 | .init_machine = tx28_stk5v3_init, | ||
172 | .timer = &tx28_timer, | ||
173 | MACHINE_END | ||