diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /arch/arm/mach-omap2/board-omap3evm.c | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'arch/arm/mach-omap2/board-omap3evm.c')
-rw-r--r-- | arch/arm/mach-omap2/board-omap3evm.c | 501 |
1 files changed, 450 insertions, 51 deletions
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index 4c4d7f8dbd72..017bb2f4f7d2 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c | |||
@@ -22,34 +22,75 @@ | |||
22 | #include <linux/input.h> | 22 | #include <linux/input.h> |
23 | #include <linux/input/matrix_keypad.h> | 23 | #include <linux/input/matrix_keypad.h> |
24 | #include <linux/leds.h> | 24 | #include <linux/leds.h> |
25 | #include <linux/interrupt.h> | ||
25 | 26 | ||
26 | #include <linux/spi/spi.h> | 27 | #include <linux/spi/spi.h> |
27 | #include <linux/spi/ads7846.h> | 28 | #include <linux/spi/ads7846.h> |
28 | #include <linux/i2c/twl4030.h> | 29 | #include <linux/i2c/twl.h> |
29 | #include <linux/usb/otg.h> | 30 | #include <linux/usb/otg.h> |
31 | #include <linux/smsc911x.h> | ||
32 | |||
33 | #include <linux/regulator/machine.h> | ||
30 | 34 | ||
31 | #include <mach/hardware.h> | 35 | #include <mach/hardware.h> |
32 | #include <asm/mach-types.h> | 36 | #include <asm/mach-types.h> |
33 | #include <asm/mach/arch.h> | 37 | #include <asm/mach/arch.h> |
34 | #include <asm/mach/map.h> | 38 | #include <asm/mach/map.h> |
35 | 39 | ||
36 | #include <mach/board.h> | 40 | #include <plat/board.h> |
37 | #include <mach/mux.h> | 41 | #include <plat/usb.h> |
38 | #include <mach/usb.h> | 42 | #include <plat/common.h> |
39 | #include <mach/common.h> | 43 | #include <plat/mcspi.h> |
40 | #include <mach/mcspi.h> | 44 | #include <plat/display.h> |
41 | 45 | ||
46 | #include "mux.h" | ||
42 | #include "sdram-micron-mt46h32m32lf-6.h" | 47 | #include "sdram-micron-mt46h32m32lf-6.h" |
43 | #include "mmc-twl4030.h" | 48 | #include "hsmmc.h" |
44 | 49 | ||
45 | #define OMAP3_EVM_TS_GPIO 175 | 50 | #define OMAP3_EVM_TS_GPIO 175 |
51 | #define OMAP3_EVM_EHCI_VBUS 22 | ||
52 | #define OMAP3_EVM_EHCI_SELECT 61 | ||
46 | 53 | ||
47 | #define OMAP3EVM_ETHR_START 0x2c000000 | 54 | #define OMAP3EVM_ETHR_START 0x2c000000 |
48 | #define OMAP3EVM_ETHR_SIZE 1024 | 55 | #define OMAP3EVM_ETHR_SIZE 1024 |
56 | #define OMAP3EVM_ETHR_ID_REV 0x50 | ||
49 | #define OMAP3EVM_ETHR_GPIO_IRQ 176 | 57 | #define OMAP3EVM_ETHR_GPIO_IRQ 176 |
50 | #define OMAP3EVM_SMC911X_CS 5 | 58 | #define OMAP3EVM_SMSC911X_CS 5 |
59 | |||
60 | static u8 omap3_evm_version; | ||
61 | |||
62 | u8 get_omap3_evm_rev(void) | ||
63 | { | ||
64 | return omap3_evm_version; | ||
65 | } | ||
66 | EXPORT_SYMBOL(get_omap3_evm_rev); | ||
67 | |||
68 | static void __init omap3_evm_get_revision(void) | ||
69 | { | ||
70 | void __iomem *ioaddr; | ||
71 | unsigned int smsc_id; | ||
72 | |||
73 | /* Ethernet PHY ID is stored at ID_REV register */ | ||
74 | ioaddr = ioremap_nocache(OMAP3EVM_ETHR_START, SZ_1K); | ||
75 | if (!ioaddr) | ||
76 | return; | ||
77 | smsc_id = readl(ioaddr + OMAP3EVM_ETHR_ID_REV) & 0xFFFF0000; | ||
78 | iounmap(ioaddr); | ||
79 | |||
80 | switch (smsc_id) { | ||
81 | /*SMSC9115 chipset*/ | ||
82 | case 0x01150000: | ||
83 | omap3_evm_version = OMAP3EVM_BOARD_GEN_1; | ||
84 | break; | ||
85 | /*SMSC 9220 chipset*/ | ||
86 | case 0x92200000: | ||
87 | default: | ||
88 | omap3_evm_version = OMAP3EVM_BOARD_GEN_2; | ||
89 | } | ||
90 | } | ||
51 | 91 | ||
52 | static struct resource omap3evm_smc911x_resources[] = { | 92 | #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) |
93 | static struct resource omap3evm_smsc911x_resources[] = { | ||
53 | [0] = { | 94 | [0] = { |
54 | .start = OMAP3EVM_ETHR_START, | 95 | .start = OMAP3EVM_ETHR_START, |
55 | .end = (OMAP3EVM_ETHR_START + OMAP3EVM_ETHR_SIZE - 1), | 96 | .end = (OMAP3EVM_ETHR_START + OMAP3EVM_ETHR_SIZE - 1), |
@@ -58,24 +99,34 @@ static struct resource omap3evm_smc911x_resources[] = { | |||
58 | [1] = { | 99 | [1] = { |
59 | .start = OMAP_GPIO_IRQ(OMAP3EVM_ETHR_GPIO_IRQ), | 100 | .start = OMAP_GPIO_IRQ(OMAP3EVM_ETHR_GPIO_IRQ), |
60 | .end = OMAP_GPIO_IRQ(OMAP3EVM_ETHR_GPIO_IRQ), | 101 | .end = OMAP_GPIO_IRQ(OMAP3EVM_ETHR_GPIO_IRQ), |
61 | .flags = IORESOURCE_IRQ, | 102 | .flags = (IORESOURCE_IRQ | IRQF_TRIGGER_LOW), |
62 | }, | 103 | }, |
63 | }; | 104 | }; |
64 | 105 | ||
65 | static struct platform_device omap3evm_smc911x_device = { | 106 | static struct smsc911x_platform_config smsc911x_config = { |
66 | .name = "smc911x", | 107 | .phy_interface = PHY_INTERFACE_MODE_MII, |
108 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, | ||
109 | .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN, | ||
110 | .flags = (SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS), | ||
111 | }; | ||
112 | |||
113 | static struct platform_device omap3evm_smsc911x_device = { | ||
114 | .name = "smsc911x", | ||
67 | .id = -1, | 115 | .id = -1, |
68 | .num_resources = ARRAY_SIZE(omap3evm_smc911x_resources), | 116 | .num_resources = ARRAY_SIZE(omap3evm_smsc911x_resources), |
69 | .resource = &omap3evm_smc911x_resources[0], | 117 | .resource = &omap3evm_smsc911x_resources[0], |
118 | .dev = { | ||
119 | .platform_data = &smsc911x_config, | ||
120 | }, | ||
70 | }; | 121 | }; |
71 | 122 | ||
72 | static inline void __init omap3evm_init_smc911x(void) | 123 | static inline void __init omap3evm_init_smsc911x(void) |
73 | { | 124 | { |
74 | int eth_cs; | 125 | int eth_cs; |
75 | struct clk *l3ck; | 126 | struct clk *l3ck; |
76 | unsigned int rate; | 127 | unsigned int rate; |
77 | 128 | ||
78 | eth_cs = OMAP3EVM_SMC911X_CS; | 129 | eth_cs = OMAP3EVM_SMSC911X_CS; |
79 | 130 | ||
80 | l3ck = clk_get(NULL, "l3_ck"); | 131 | l3ck = clk_get(NULL, "l3_ck"); |
81 | if (IS_ERR(l3ck)) | 132 | if (IS_ERR(l3ck)) |
@@ -83,16 +134,240 @@ static inline void __init omap3evm_init_smc911x(void) | |||
83 | else | 134 | else |
84 | rate = clk_get_rate(l3ck); | 135 | rate = clk_get_rate(l3ck); |
85 | 136 | ||
86 | if (gpio_request(OMAP3EVM_ETHR_GPIO_IRQ, "SMC911x irq") < 0) { | 137 | if (gpio_request(OMAP3EVM_ETHR_GPIO_IRQ, "SMSC911x irq") < 0) { |
87 | printk(KERN_ERR "Failed to request GPIO%d for smc911x IRQ\n", | 138 | printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n", |
88 | OMAP3EVM_ETHR_GPIO_IRQ); | 139 | OMAP3EVM_ETHR_GPIO_IRQ); |
89 | return; | 140 | return; |
90 | } | 141 | } |
91 | 142 | ||
92 | gpio_direction_input(OMAP3EVM_ETHR_GPIO_IRQ); | 143 | gpio_direction_input(OMAP3EVM_ETHR_GPIO_IRQ); |
144 | platform_device_register(&omap3evm_smsc911x_device); | ||
145 | } | ||
146 | |||
147 | #else | ||
148 | static inline void __init omap3evm_init_smsc911x(void) { return; } | ||
149 | #endif | ||
150 | |||
151 | /* | ||
152 | * OMAP3EVM LCD Panel control signals | ||
153 | */ | ||
154 | #define OMAP3EVM_LCD_PANEL_LR 2 | ||
155 | #define OMAP3EVM_LCD_PANEL_UD 3 | ||
156 | #define OMAP3EVM_LCD_PANEL_INI 152 | ||
157 | #define OMAP3EVM_LCD_PANEL_ENVDD 153 | ||
158 | #define OMAP3EVM_LCD_PANEL_QVGA 154 | ||
159 | #define OMAP3EVM_LCD_PANEL_RESB 155 | ||
160 | #define OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO 210 | ||
161 | #define OMAP3EVM_DVI_PANEL_EN_GPIO 199 | ||
162 | |||
163 | static int lcd_enabled; | ||
164 | static int dvi_enabled; | ||
165 | |||
166 | static void __init omap3_evm_display_init(void) | ||
167 | { | ||
168 | int r; | ||
169 | |||
170 | r = gpio_request(OMAP3EVM_LCD_PANEL_RESB, "lcd_panel_resb"); | ||
171 | if (r) { | ||
172 | printk(KERN_ERR "failed to get lcd_panel_resb\n"); | ||
173 | return; | ||
174 | } | ||
175 | gpio_direction_output(OMAP3EVM_LCD_PANEL_RESB, 1); | ||
176 | |||
177 | r = gpio_request(OMAP3EVM_LCD_PANEL_INI, "lcd_panel_ini"); | ||
178 | if (r) { | ||
179 | printk(KERN_ERR "failed to get lcd_panel_ini\n"); | ||
180 | goto err_1; | ||
181 | } | ||
182 | gpio_direction_output(OMAP3EVM_LCD_PANEL_INI, 1); | ||
183 | |||
184 | r = gpio_request(OMAP3EVM_LCD_PANEL_QVGA, "lcd_panel_qvga"); | ||
185 | if (r) { | ||
186 | printk(KERN_ERR "failed to get lcd_panel_qvga\n"); | ||
187 | goto err_2; | ||
188 | } | ||
189 | gpio_direction_output(OMAP3EVM_LCD_PANEL_QVGA, 0); | ||
190 | |||
191 | r = gpio_request(OMAP3EVM_LCD_PANEL_LR, "lcd_panel_lr"); | ||
192 | if (r) { | ||
193 | printk(KERN_ERR "failed to get lcd_panel_lr\n"); | ||
194 | goto err_3; | ||
195 | } | ||
196 | gpio_direction_output(OMAP3EVM_LCD_PANEL_LR, 1); | ||
197 | |||
198 | r = gpio_request(OMAP3EVM_LCD_PANEL_UD, "lcd_panel_ud"); | ||
199 | if (r) { | ||
200 | printk(KERN_ERR "failed to get lcd_panel_ud\n"); | ||
201 | goto err_4; | ||
202 | } | ||
203 | gpio_direction_output(OMAP3EVM_LCD_PANEL_UD, 1); | ||
204 | |||
205 | r = gpio_request(OMAP3EVM_LCD_PANEL_ENVDD, "lcd_panel_envdd"); | ||
206 | if (r) { | ||
207 | printk(KERN_ERR "failed to get lcd_panel_envdd\n"); | ||
208 | goto err_5; | ||
209 | } | ||
210 | gpio_direction_output(OMAP3EVM_LCD_PANEL_ENVDD, 0); | ||
211 | |||
212 | return; | ||
213 | |||
214 | err_5: | ||
215 | gpio_free(OMAP3EVM_LCD_PANEL_UD); | ||
216 | err_4: | ||
217 | gpio_free(OMAP3EVM_LCD_PANEL_LR); | ||
218 | err_3: | ||
219 | gpio_free(OMAP3EVM_LCD_PANEL_QVGA); | ||
220 | err_2: | ||
221 | gpio_free(OMAP3EVM_LCD_PANEL_INI); | ||
222 | err_1: | ||
223 | gpio_free(OMAP3EVM_LCD_PANEL_RESB); | ||
224 | |||
225 | } | ||
226 | |||
227 | static int omap3_evm_enable_lcd(struct omap_dss_device *dssdev) | ||
228 | { | ||
229 | if (dvi_enabled) { | ||
230 | printk(KERN_ERR "cannot enable LCD, DVI is enabled\n"); | ||
231 | return -EINVAL; | ||
232 | } | ||
233 | gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 0); | ||
234 | |||
235 | if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) | ||
236 | gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0); | ||
237 | else | ||
238 | gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1); | ||
239 | |||
240 | lcd_enabled = 1; | ||
241 | return 0; | ||
242 | } | ||
243 | |||
244 | static void omap3_evm_disable_lcd(struct omap_dss_device *dssdev) | ||
245 | { | ||
246 | gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 1); | ||
247 | |||
248 | if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) | ||
249 | gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1); | ||
250 | else | ||
251 | gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0); | ||
252 | |||
253 | lcd_enabled = 0; | ||
254 | } | ||
255 | |||
256 | static struct omap_dss_device omap3_evm_lcd_device = { | ||
257 | .name = "lcd", | ||
258 | .driver_name = "sharp_ls_panel", | ||
259 | .type = OMAP_DISPLAY_TYPE_DPI, | ||
260 | .phy.dpi.data_lines = 18, | ||
261 | .platform_enable = omap3_evm_enable_lcd, | ||
262 | .platform_disable = omap3_evm_disable_lcd, | ||
263 | }; | ||
264 | |||
265 | static int omap3_evm_enable_tv(struct omap_dss_device *dssdev) | ||
266 | { | ||
267 | return 0; | ||
268 | } | ||
269 | |||
270 | static void omap3_evm_disable_tv(struct omap_dss_device *dssdev) | ||
271 | { | ||
272 | } | ||
273 | |||
274 | static struct omap_dss_device omap3_evm_tv_device = { | ||
275 | .name = "tv", | ||
276 | .driver_name = "venc", | ||
277 | .type = OMAP_DISPLAY_TYPE_VENC, | ||
278 | .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO, | ||
279 | .platform_enable = omap3_evm_enable_tv, | ||
280 | .platform_disable = omap3_evm_disable_tv, | ||
281 | }; | ||
282 | |||
283 | static int omap3_evm_enable_dvi(struct omap_dss_device *dssdev) | ||
284 | { | ||
285 | if (lcd_enabled) { | ||
286 | printk(KERN_ERR "cannot enable DVI, LCD is enabled\n"); | ||
287 | return -EINVAL; | ||
288 | } | ||
289 | |||
290 | gpio_set_value(OMAP3EVM_DVI_PANEL_EN_GPIO, 1); | ||
291 | |||
292 | dvi_enabled = 1; | ||
293 | return 0; | ||
93 | } | 294 | } |
94 | 295 | ||
95 | static struct twl4030_hsmmc_info mmc[] = { | 296 | static void omap3_evm_disable_dvi(struct omap_dss_device *dssdev) |
297 | { | ||
298 | gpio_set_value(OMAP3EVM_DVI_PANEL_EN_GPIO, 0); | ||
299 | |||
300 | dvi_enabled = 0; | ||
301 | } | ||
302 | |||
303 | static struct omap_dss_device omap3_evm_dvi_device = { | ||
304 | .name = "dvi", | ||
305 | .driver_name = "generic_panel", | ||
306 | .type = OMAP_DISPLAY_TYPE_DPI, | ||
307 | .phy.dpi.data_lines = 24, | ||
308 | .platform_enable = omap3_evm_enable_dvi, | ||
309 | .platform_disable = omap3_evm_disable_dvi, | ||
310 | }; | ||
311 | |||
312 | static struct omap_dss_device *omap3_evm_dss_devices[] = { | ||
313 | &omap3_evm_lcd_device, | ||
314 | &omap3_evm_tv_device, | ||
315 | &omap3_evm_dvi_device, | ||
316 | }; | ||
317 | |||
318 | static struct omap_dss_board_info omap3_evm_dss_data = { | ||
319 | .num_devices = ARRAY_SIZE(omap3_evm_dss_devices), | ||
320 | .devices = omap3_evm_dss_devices, | ||
321 | .default_device = &omap3_evm_lcd_device, | ||
322 | }; | ||
323 | |||
324 | static struct platform_device omap3_evm_dss_device = { | ||
325 | .name = "omapdss", | ||
326 | .id = -1, | ||
327 | .dev = { | ||
328 | .platform_data = &omap3_evm_dss_data, | ||
329 | }, | ||
330 | }; | ||
331 | |||
332 | static struct regulator_consumer_supply omap3evm_vmmc1_supply = { | ||
333 | .supply = "vmmc", | ||
334 | }; | ||
335 | |||
336 | static struct regulator_consumer_supply omap3evm_vsim_supply = { | ||
337 | .supply = "vmmc_aux", | ||
338 | }; | ||
339 | |||
340 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ | ||
341 | static struct regulator_init_data omap3evm_vmmc1 = { | ||
342 | .constraints = { | ||
343 | .min_uV = 1850000, | ||
344 | .max_uV = 3150000, | ||
345 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
346 | | REGULATOR_MODE_STANDBY, | ||
347 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | ||
348 | | REGULATOR_CHANGE_MODE | ||
349 | | REGULATOR_CHANGE_STATUS, | ||
350 | }, | ||
351 | .num_consumer_supplies = 1, | ||
352 | .consumer_supplies = &omap3evm_vmmc1_supply, | ||
353 | }; | ||
354 | |||
355 | /* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */ | ||
356 | static struct regulator_init_data omap3evm_vsim = { | ||
357 | .constraints = { | ||
358 | .min_uV = 1800000, | ||
359 | .max_uV = 3000000, | ||
360 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
361 | | REGULATOR_MODE_STANDBY, | ||
362 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | ||
363 | | REGULATOR_CHANGE_MODE | ||
364 | | REGULATOR_CHANGE_STATUS, | ||
365 | }, | ||
366 | .num_consumer_supplies = 1, | ||
367 | .consumer_supplies = &omap3evm_vsim_supply, | ||
368 | }; | ||
369 | |||
370 | static struct omap2_hsmmc_info mmc[] = { | ||
96 | { | 371 | { |
97 | .mmc = 1, | 372 | .mmc = 1, |
98 | .wires = 4, | 373 | .wires = 4, |
@@ -130,15 +405,27 @@ static int omap3evm_twl_gpio_setup(struct device *dev, | |||
130 | unsigned gpio, unsigned ngpio) | 405 | unsigned gpio, unsigned ngpio) |
131 | { | 406 | { |
132 | /* gpio + 0 is "mmc0_cd" (input/IRQ) */ | 407 | /* gpio + 0 is "mmc0_cd" (input/IRQ) */ |
133 | omap_cfg_reg(L8_34XX_GPIO63); | 408 | omap_mux_init_gpio(63, OMAP_PIN_INPUT); |
134 | mmc[0].gpio_cd = gpio + 0; | 409 | mmc[0].gpio_cd = gpio + 0; |
135 | twl4030_mmc_init(mmc); | 410 | omap2_hsmmc_init(mmc); |
411 | |||
412 | /* link regulators to MMC adapters */ | ||
413 | omap3evm_vmmc1_supply.dev = mmc[0].dev; | ||
414 | omap3evm_vsim_supply.dev = mmc[0].dev; | ||
136 | 415 | ||
137 | /* | 416 | /* |
138 | * Most GPIOs are for USB OTG. Some are mostly sent to | 417 | * Most GPIOs are for USB OTG. Some are mostly sent to |
139 | * the P2 connector; notably LEDA for the LCD backlight. | 418 | * the P2 connector; notably LEDA for the LCD backlight. |
140 | */ | 419 | */ |
141 | 420 | ||
421 | /* TWL4030_GPIO_MAX + 0 == ledA, LCD Backlight control */ | ||
422 | gpio_request(gpio + TWL4030_GPIO_MAX, "EN_LCD_BKL"); | ||
423 | gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0); | ||
424 | |||
425 | /* gpio + 7 == DVI Enable */ | ||
426 | gpio_request(gpio + 7, "EN_DVI"); | ||
427 | gpio_direction_output(gpio + 7, 0); | ||
428 | |||
142 | /* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */ | 429 | /* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */ |
143 | gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; | 430 | gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; |
144 | 431 | ||
@@ -161,20 +448,23 @@ static struct twl4030_usb_data omap3evm_usb_data = { | |||
161 | 448 | ||
162 | static int board_keymap[] = { | 449 | static int board_keymap[] = { |
163 | KEY(0, 0, KEY_LEFT), | 450 | KEY(0, 0, KEY_LEFT), |
164 | KEY(0, 1, KEY_RIGHT), | 451 | KEY(0, 1, KEY_DOWN), |
165 | KEY(0, 2, KEY_A), | 452 | KEY(0, 2, KEY_ENTER), |
166 | KEY(0, 3, KEY_B), | 453 | KEY(0, 3, KEY_M), |
167 | KEY(1, 0, KEY_DOWN), | 454 | |
455 | KEY(1, 0, KEY_RIGHT), | ||
168 | KEY(1, 1, KEY_UP), | 456 | KEY(1, 1, KEY_UP), |
169 | KEY(1, 2, KEY_E), | 457 | KEY(1, 2, KEY_I), |
170 | KEY(1, 3, KEY_F), | 458 | KEY(1, 3, KEY_N), |
171 | KEY(2, 0, KEY_ENTER), | 459 | |
172 | KEY(2, 1, KEY_I), | 460 | KEY(2, 0, KEY_A), |
461 | KEY(2, 1, KEY_E), | ||
173 | KEY(2, 2, KEY_J), | 462 | KEY(2, 2, KEY_J), |
174 | KEY(2, 3, KEY_K), | 463 | KEY(2, 3, KEY_O), |
175 | KEY(3, 0, KEY_M), | 464 | |
176 | KEY(3, 1, KEY_N), | 465 | KEY(3, 0, KEY_B), |
177 | KEY(3, 2, KEY_O), | 466 | KEY(3, 1, KEY_F), |
467 | KEY(3, 2, KEY_K), | ||
178 | KEY(3, 3, KEY_P) | 468 | KEY(3, 3, KEY_P) |
179 | }; | 469 | }; |
180 | 470 | ||
@@ -194,6 +484,56 @@ static struct twl4030_madc_platform_data omap3evm_madc_data = { | |||
194 | .irq_line = 1, | 484 | .irq_line = 1, |
195 | }; | 485 | }; |
196 | 486 | ||
487 | static struct twl4030_codec_audio_data omap3evm_audio_data = { | ||
488 | .audio_mclk = 26000000, | ||
489 | }; | ||
490 | |||
491 | static struct twl4030_codec_data omap3evm_codec_data = { | ||
492 | .audio_mclk = 26000000, | ||
493 | .audio = &omap3evm_audio_data, | ||
494 | }; | ||
495 | |||
496 | static struct regulator_consumer_supply omap3_evm_vdda_dac_supply = { | ||
497 | .supply = "vdda_dac", | ||
498 | .dev = &omap3_evm_dss_device.dev, | ||
499 | }; | ||
500 | |||
501 | /* VDAC for DSS driving S-Video */ | ||
502 | static struct regulator_init_data omap3_evm_vdac = { | ||
503 | .constraints = { | ||
504 | .min_uV = 1800000, | ||
505 | .max_uV = 1800000, | ||
506 | .apply_uV = true, | ||
507 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
508 | | REGULATOR_MODE_STANDBY, | ||
509 | .valid_ops_mask = REGULATOR_CHANGE_MODE | ||
510 | | REGULATOR_CHANGE_STATUS, | ||
511 | }, | ||
512 | .num_consumer_supplies = 1, | ||
513 | .consumer_supplies = &omap3_evm_vdda_dac_supply, | ||
514 | }; | ||
515 | |||
516 | /* VPLL2 for digital video outputs */ | ||
517 | static struct regulator_consumer_supply omap3_evm_vpll2_supply = { | ||
518 | .supply = "vdvi", | ||
519 | .dev = &omap3_evm_lcd_device.dev, | ||
520 | }; | ||
521 | |||
522 | static struct regulator_init_data omap3_evm_vpll2 = { | ||
523 | .constraints = { | ||
524 | .name = "VDVI", | ||
525 | .min_uV = 1800000, | ||
526 | .max_uV = 1800000, | ||
527 | .apply_uV = true, | ||
528 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
529 | | REGULATOR_MODE_STANDBY, | ||
530 | .valid_ops_mask = REGULATOR_CHANGE_MODE | ||
531 | | REGULATOR_CHANGE_STATUS, | ||
532 | }, | ||
533 | .num_consumer_supplies = 1, | ||
534 | .consumer_supplies = &omap3_evm_vpll2_supply, | ||
535 | }; | ||
536 | |||
197 | static struct twl4030_platform_data omap3evm_twldata = { | 537 | static struct twl4030_platform_data omap3evm_twldata = { |
198 | .irq_base = TWL4030_IRQ_BASE, | 538 | .irq_base = TWL4030_IRQ_BASE, |
199 | .irq_end = TWL4030_IRQ_END, | 539 | .irq_end = TWL4030_IRQ_END, |
@@ -203,6 +543,9 @@ static struct twl4030_platform_data omap3evm_twldata = { | |||
203 | .madc = &omap3evm_madc_data, | 543 | .madc = &omap3evm_madc_data, |
204 | .usb = &omap3evm_usb_data, | 544 | .usb = &omap3evm_usb_data, |
205 | .gpio = &omap3evm_gpio_data, | 545 | .gpio = &omap3evm_gpio_data, |
546 | .codec = &omap3evm_codec_data, | ||
547 | .vdac = &omap3_evm_vdac, | ||
548 | .vpll2 = &omap3_evm_vpll2, | ||
206 | }; | 549 | }; |
207 | 550 | ||
208 | static struct i2c_board_info __initdata omap3evm_i2c_boardinfo[] = { | 551 | static struct i2c_board_info __initdata omap3evm_i2c_boardinfo[] = { |
@@ -216,6 +559,13 @@ static struct i2c_board_info __initdata omap3evm_i2c_boardinfo[] = { | |||
216 | 559 | ||
217 | static int __init omap3_evm_i2c_init(void) | 560 | static int __init omap3_evm_i2c_init(void) |
218 | { | 561 | { |
562 | /* | ||
563 | * REVISIT: These entries can be set in omap3evm_twl_data | ||
564 | * after a merge with MFD tree | ||
565 | */ | ||
566 | omap3evm_twldata.vmmc1 = &omap3evm_vmmc1; | ||
567 | omap3evm_twldata.vsim = &omap3evm_vsim; | ||
568 | |||
219 | omap_register_i2c_bus(1, 2600, omap3evm_i2c_boardinfo, | 569 | omap_register_i2c_bus(1, 2600, omap3evm_i2c_boardinfo, |
220 | ARRAY_SIZE(omap3evm_i2c_boardinfo)); | 570 | ARRAY_SIZE(omap3evm_i2c_boardinfo)); |
221 | omap_register_i2c_bus(2, 400, NULL, 0); | 571 | omap_register_i2c_bus(2, 400, NULL, 0); |
@@ -223,15 +573,6 @@ static int __init omap3_evm_i2c_init(void) | |||
223 | return 0; | 573 | return 0; |
224 | } | 574 | } |
225 | 575 | ||
226 | static struct platform_device omap3_evm_lcd_device = { | ||
227 | .name = "omap3evm_lcd", | ||
228 | .id = -1, | ||
229 | }; | ||
230 | |||
231 | static struct omap_lcd_config omap3_evm_lcd_config __initdata = { | ||
232 | .ctrl_name = "internal", | ||
233 | }; | ||
234 | |||
235 | static void ads7846_dev_init(void) | 576 | static void ads7846_dev_init(void) |
236 | { | 577 | { |
237 | if (gpio_request(OMAP3_EVM_TS_GPIO, "ADS7846 pendown") < 0) | 578 | if (gpio_request(OMAP3_EVM_TS_GPIO, "ADS7846 pendown") < 0) |
@@ -279,7 +620,6 @@ struct spi_board_info omap3evm_spi_board_info[] = { | |||
279 | }; | 620 | }; |
280 | 621 | ||
281 | static struct omap_board_config_kernel omap3_evm_config[] __initdata = { | 622 | static struct omap_board_config_kernel omap3_evm_config[] __initdata = { |
282 | { OMAP_TAG_LCD, &omap3_evm_lcd_config }, | ||
283 | }; | 623 | }; |
284 | 624 | ||
285 | static void __init omap3_evm_init_irq(void) | 625 | static void __init omap3_evm_init_irq(void) |
@@ -289,16 +629,50 @@ static void __init omap3_evm_init_irq(void) | |||
289 | omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL); | 629 | omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL); |
290 | omap_init_irq(); | 630 | omap_init_irq(); |
291 | omap_gpio_init(); | 631 | omap_gpio_init(); |
292 | omap3evm_init_smc911x(); | ||
293 | } | 632 | } |
294 | 633 | ||
295 | static struct platform_device *omap3_evm_devices[] __initdata = { | 634 | static struct platform_device *omap3_evm_devices[] __initdata = { |
296 | &omap3_evm_lcd_device, | 635 | &omap3_evm_dss_device, |
297 | &omap3evm_smc911x_device, | 636 | }; |
637 | |||
638 | static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = { | ||
639 | |||
640 | .port_mode[0] = EHCI_HCD_OMAP_MODE_UNKNOWN, | ||
641 | .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY, | ||
642 | .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, | ||
643 | |||
644 | .phy_reset = true, | ||
645 | /* PHY reset GPIO will be runtime programmed based on EVM version */ | ||
646 | .reset_gpio_port[0] = -EINVAL, | ||
647 | .reset_gpio_port[1] = -EINVAL, | ||
648 | .reset_gpio_port[2] = -EINVAL | ||
649 | }; | ||
650 | |||
651 | #ifdef CONFIG_OMAP_MUX | ||
652 | static struct omap_board_mux board_mux[] __initdata = { | ||
653 | OMAP3_MUX(SYS_NIRQ, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP | | ||
654 | OMAP_PIN_OFF_INPUT_PULLUP | | ||
655 | OMAP_PIN_OFF_WAKEUPENABLE), | ||
656 | OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP | | ||
657 | OMAP_PIN_OFF_INPUT_PULLUP | | ||
658 | OMAP_PIN_OFF_WAKEUPENABLE), | ||
659 | { .reg_offset = OMAP_MUX_TERMINATOR }, | ||
660 | }; | ||
661 | #else | ||
662 | #define board_mux NULL | ||
663 | #endif | ||
664 | |||
665 | static struct omap_musb_board_data musb_board_data = { | ||
666 | .interface_type = MUSB_INTERFACE_ULPI, | ||
667 | .mode = MUSB_OTG, | ||
668 | .power = 100, | ||
298 | }; | 669 | }; |
299 | 670 | ||
300 | static void __init omap3_evm_init(void) | 671 | static void __init omap3_evm_init(void) |
301 | { | 672 | { |
673 | omap3_evm_get_revision(); | ||
674 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | ||
675 | |||
302 | omap3_evm_i2c_init(); | 676 | omap3_evm_i2c_init(); |
303 | 677 | ||
304 | platform_add_devices(omap3_evm_devices, ARRAY_SIZE(omap3_evm_devices)); | 678 | platform_add_devices(omap3_evm_devices, ARRAY_SIZE(omap3_evm_devices)); |
@@ -307,24 +681,49 @@ static void __init omap3_evm_init(void) | |||
307 | ARRAY_SIZE(omap3evm_spi_board_info)); | 681 | ARRAY_SIZE(omap3evm_spi_board_info)); |
308 | 682 | ||
309 | omap_serial_init(); | 683 | omap_serial_init(); |
310 | #ifdef CONFIG_NOP_USB_XCEIV | 684 | |
311 | /* OMAP3EVM uses ISP1504 phy and so register nop transceiver */ | 685 | /* OMAP3EVM uses ISP1504 phy and so register nop transceiver */ |
312 | usb_nop_xceiv_register(); | 686 | usb_nop_xceiv_register(); |
313 | #endif | 687 | |
314 | usb_musb_init(); | 688 | if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) { |
689 | /* enable EHCI VBUS using GPIO22 */ | ||
690 | omap_mux_init_gpio(22, OMAP_PIN_INPUT_PULLUP); | ||
691 | gpio_request(OMAP3_EVM_EHCI_VBUS, "enable EHCI VBUS"); | ||
692 | gpio_direction_output(OMAP3_EVM_EHCI_VBUS, 0); | ||
693 | gpio_set_value(OMAP3_EVM_EHCI_VBUS, 1); | ||
694 | |||
695 | /* Select EHCI port on main board */ | ||
696 | omap_mux_init_gpio(61, OMAP_PIN_INPUT_PULLUP); | ||
697 | gpio_request(OMAP3_EVM_EHCI_SELECT, "select EHCI port"); | ||
698 | gpio_direction_output(OMAP3_EVM_EHCI_SELECT, 0); | ||
699 | gpio_set_value(OMAP3_EVM_EHCI_SELECT, 0); | ||
700 | |||
701 | /* setup EHCI phy reset config */ | ||
702 | omap_mux_init_gpio(21, OMAP_PIN_INPUT_PULLUP); | ||
703 | ehci_pdata.reset_gpio_port[1] = 21; | ||
704 | |||
705 | } else { | ||
706 | /* setup EHCI phy reset on MDC */ | ||
707 | omap_mux_init_gpio(135, OMAP_PIN_OUTPUT); | ||
708 | ehci_pdata.reset_gpio_port[1] = 135; | ||
709 | } | ||
710 | usb_musb_init(&musb_board_data); | ||
711 | usb_ehci_init(&ehci_pdata); | ||
315 | ads7846_dev_init(); | 712 | ads7846_dev_init(); |
713 | omap3evm_init_smsc911x(); | ||
714 | omap3_evm_display_init(); | ||
316 | } | 715 | } |
317 | 716 | ||
318 | static void __init omap3_evm_map_io(void) | 717 | static void __init omap3_evm_map_io(void) |
319 | { | 718 | { |
320 | omap2_set_globals_343x(); | 719 | omap2_set_globals_343x(); |
321 | omap2_map_common_io(); | 720 | omap34xx_map_common_io(); |
322 | } | 721 | } |
323 | 722 | ||
324 | MACHINE_START(OMAP3EVM, "OMAP3 EVM") | 723 | MACHINE_START(OMAP3EVM, "OMAP3 EVM") |
325 | /* Maintainer: Syed Mohammed Khasim - Texas Instruments */ | 724 | /* Maintainer: Syed Mohammed Khasim - Texas Instruments */ |
326 | .phys_io = 0x48000000, | 725 | .phys_io = 0x48000000, |
327 | .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc, | 726 | .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc, |
328 | .boot_params = 0x80000100, | 727 | .boot_params = 0x80000100, |
329 | .map_io = omap3_evm_map_io, | 728 | .map_io = omap3_evm_map_io, |
330 | .init_irq = omap3_evm_init_irq, | 729 | .init_irq = omap3_evm_init_irq, |