aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-devkit8000.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/board-devkit8000.c')
-rw-r--r--arch/arm/mach-omap2/board-devkit8000.c169
1 files changed, 74 insertions, 95 deletions
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index 922b7464807f..a07086d6a0b2 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -33,6 +33,7 @@
33#include <linux/i2c/twl.h> 33#include <linux/i2c/twl.h>
34 34
35#include <mach/hardware.h> 35#include <mach/hardware.h>
36#include <mach/id.h>
36#include <asm/mach-types.h> 37#include <asm/mach-types.h>
37#include <asm/mach/arch.h> 38#include <asm/mach/arch.h>
38#include <asm/mach/map.h> 39#include <asm/mach/map.h>
@@ -58,9 +59,6 @@
58#include "mux.h" 59#include "mux.h"
59#include "hsmmc.h" 60#include "hsmmc.h"
60 61
61#define GPMC_CS0_BASE 0x60
62#define GPMC_CS_SIZE 0x30
63
64#define NAND_BLOCK_SIZE SZ_128K 62#define NAND_BLOCK_SIZE SZ_128K
65 63
66#define OMAP_DM9000_GPIO_IRQ 25 64#define OMAP_DM9000_GPIO_IRQ 25
@@ -104,20 +102,6 @@ static struct omap_nand_platform_data devkit8000_nand_data = {
104 .dma_channel = -1, /* disable DMA in OMAP NAND driver */ 102 .dma_channel = -1, /* disable DMA in OMAP NAND driver */
105}; 103};
106 104
107static struct resource devkit8000_nand_resource = {
108 .flags = IORESOURCE_MEM,
109};
110
111static struct platform_device devkit8000_nand_device = {
112 .name = "omap2-nand",
113 .id = -1,
114 .dev = {
115 .platform_data = &devkit8000_nand_data,
116 },
117 .num_resources = 1,
118 .resource = &devkit8000_nand_resource,
119};
120
121static struct omap2_hsmmc_info mmc[] = { 105static struct omap2_hsmmc_info mmc[] = {
122 { 106 {
123 .mmc = 1, 107 .mmc = 1,
@@ -126,54 +110,50 @@ static struct omap2_hsmmc_info mmc[] = {
126 }, 110 },
127 {} /* Terminator */ 111 {} /* Terminator */
128}; 112};
129static struct omap_board_config_kernel devkit8000_config[] __initdata = {
130};
131 113
132static int devkit8000_panel_enable_lcd(struct omap_dss_device *dssdev) 114static int devkit8000_panel_enable_lcd(struct omap_dss_device *dssdev)
133{ 115{
134 twl_i2c_write_u8(TWL4030_MODULE_GPIO, 0x80, REG_GPIODATADIR1); 116 twl_i2c_write_u8(TWL4030_MODULE_GPIO, 0x80, REG_GPIODATADIR1);
135 twl_i2c_write_u8(TWL4030_MODULE_LED, 0x0, 0x0); 117 twl_i2c_write_u8(TWL4030_MODULE_LED, 0x0, 0x0);
136 118
119 if (gpio_is_valid(dssdev->reset_gpio))
120 gpio_set_value(dssdev->reset_gpio, 1);
137 return 0; 121 return 0;
138} 122}
139 123
140static void devkit8000_panel_disable_lcd(struct omap_dss_device *dssdev) 124static void devkit8000_panel_disable_lcd(struct omap_dss_device *dssdev)
141{ 125{
126 if (gpio_is_valid(dssdev->reset_gpio))
127 gpio_set_value(dssdev->reset_gpio, 0);
142} 128}
129
143static int devkit8000_panel_enable_dvi(struct omap_dss_device *dssdev) 130static int devkit8000_panel_enable_dvi(struct omap_dss_device *dssdev)
144{ 131{
132 if (gpio_is_valid(dssdev->reset_gpio))
133 gpio_set_value(dssdev->reset_gpio, 1);
145 return 0; 134 return 0;
146} 135}
147 136
148static void devkit8000_panel_disable_dvi(struct omap_dss_device *dssdev) 137static void devkit8000_panel_disable_dvi(struct omap_dss_device *dssdev)
149{ 138{
139 if (gpio_is_valid(dssdev->reset_gpio))
140 gpio_set_value(dssdev->reset_gpio, 0);
150} 141}
151 142
152static int devkit8000_panel_enable_tv(struct omap_dss_device *dssdev) 143static struct regulator_consumer_supply devkit8000_vmmc1_supply =
153{ 144 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.0");
154 145
155 return 0;
156}
157
158static void devkit8000_panel_disable_tv(struct omap_dss_device *dssdev)
159{
160}
161
162
163static struct regulator_consumer_supply devkit8000_vmmc1_supply = {
164 .supply = "vmmc",
165};
166
167static struct regulator_consumer_supply devkit8000_vsim_supply = {
168 .supply = "vmmc_aux",
169};
170 146
147/* ads7846 on SPI */
148static struct regulator_consumer_supply devkit8000_vio_supply =
149 REGULATOR_SUPPLY("vcc", "spi2.0");
171 150
172static struct omap_dss_device devkit8000_lcd_device = { 151static struct omap_dss_device devkit8000_lcd_device = {
173 .name = "lcd", 152 .name = "lcd",
174 .driver_name = "innolux_at_panel", 153 .driver_name = "generic_panel",
175 .type = OMAP_DISPLAY_TYPE_DPI, 154 .type = OMAP_DISPLAY_TYPE_DPI,
176 .phy.dpi.data_lines = 24, 155 .phy.dpi.data_lines = 24,
156 .reset_gpio = -EINVAL, /* will be replaced */
177 .platform_enable = devkit8000_panel_enable_lcd, 157 .platform_enable = devkit8000_panel_enable_lcd,
178 .platform_disable = devkit8000_panel_disable_lcd, 158 .platform_disable = devkit8000_panel_disable_lcd,
179}; 159};
@@ -182,6 +162,7 @@ static struct omap_dss_device devkit8000_dvi_device = {
182 .driver_name = "generic_panel", 162 .driver_name = "generic_panel",
183 .type = OMAP_DISPLAY_TYPE_DPI, 163 .type = OMAP_DISPLAY_TYPE_DPI,
184 .phy.dpi.data_lines = 24, 164 .phy.dpi.data_lines = 24,
165 .reset_gpio = -EINVAL, /* will be replaced */
185 .platform_enable = devkit8000_panel_enable_dvi, 166 .platform_enable = devkit8000_panel_enable_dvi,
186 .platform_disable = devkit8000_panel_disable_dvi, 167 .platform_disable = devkit8000_panel_disable_dvi,
187}; 168};
@@ -191,8 +172,6 @@ static struct omap_dss_device devkit8000_tv_device = {
191 .driver_name = "venc", 172 .driver_name = "venc",
192 .type = OMAP_DISPLAY_TYPE_VENC, 173 .type = OMAP_DISPLAY_TYPE_VENC,
193 .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO, 174 .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
194 .platform_enable = devkit8000_panel_enable_tv,
195 .platform_disable = devkit8000_panel_disable_tv,
196}; 175};
197 176
198 177
@@ -216,10 +195,8 @@ static struct platform_device devkit8000_dss_device = {
216 }, 195 },
217}; 196};
218 197
219static struct regulator_consumer_supply devkit8000_vdda_dac_supply = { 198static struct regulator_consumer_supply devkit8000_vdda_dac_supply =
220 .supply = "vdda_dac", 199 REGULATOR_SUPPLY("vdda_dac", "omapdss");
221 .dev = &devkit8000_dss_device.dev,
222};
223 200
224static int board_keymap[] = { 201static int board_keymap[] = {
225 KEY(0, 0, KEY_1), 202 KEY(0, 0, KEY_1),
@@ -266,7 +243,21 @@ static int devkit8000_twl_gpio_setup(struct device *dev,
266 243
267 /* link regulators to MMC adapters */ 244 /* link regulators to MMC adapters */
268 devkit8000_vmmc1_supply.dev = mmc[0].dev; 245 devkit8000_vmmc1_supply.dev = mmc[0].dev;
269 devkit8000_vsim_supply.dev = mmc[0].dev; 246
247 /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
248 gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
249
250 /* gpio + 1 is "LCD_PWREN" (out, active high) */
251 devkit8000_lcd_device.reset_gpio = gpio + 1;
252 gpio_request(devkit8000_lcd_device.reset_gpio, "LCD_PWREN");
253 /* Disable until needed */
254 gpio_direction_output(devkit8000_lcd_device.reset_gpio, 0);
255
256 /* gpio + 7 is "DVI_PD" (out, active low) */
257 devkit8000_dvi_device.reset_gpio = gpio + 7;
258 gpio_request(devkit8000_dvi_device.reset_gpio, "DVI PowerDown");
259 /* Disable until needed */
260 gpio_direction_output(devkit8000_dvi_device.reset_gpio, 0);
270 261
271 return 0; 262 return 0;
272} 263}
@@ -282,16 +273,8 @@ static struct twl4030_gpio_platform_data devkit8000_gpio_data = {
282 .setup = devkit8000_twl_gpio_setup, 273 .setup = devkit8000_twl_gpio_setup,
283}; 274};
284 275
285static struct regulator_consumer_supply devkit8000_vpll2_supplies[] = { 276static struct regulator_consumer_supply devkit8000_vpll1_supply =
286 { 277 REGULATOR_SUPPLY("vdds_dsi", "omapdss");
287 .supply = "vdvi",
288 .dev = &devkit8000_lcd_device.dev,
289 },
290 {
291 .supply = "vdds_dsi",
292 .dev = &devkit8000_dss_device.dev,
293 }
294};
295 278
296/* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ 279/* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
297static struct regulator_init_data devkit8000_vmmc1 = { 280static struct regulator_init_data devkit8000_vmmc1 = {
@@ -308,21 +291,6 @@ static struct regulator_init_data devkit8000_vmmc1 = {
308 .consumer_supplies = &devkit8000_vmmc1_supply, 291 .consumer_supplies = &devkit8000_vmmc1_supply,
309}; 292};
310 293
311/* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */
312static struct regulator_init_data devkit8000_vsim = {
313 .constraints = {
314 .min_uV = 1800000,
315 .max_uV = 3000000,
316 .valid_modes_mask = REGULATOR_MODE_NORMAL
317 | REGULATOR_MODE_STANDBY,
318 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
319 | REGULATOR_CHANGE_MODE
320 | REGULATOR_CHANGE_STATUS,
321 },
322 .num_consumer_supplies = 1,
323 .consumer_supplies = &devkit8000_vsim_supply,
324};
325
326/* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */ 294/* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */
327static struct regulator_init_data devkit8000_vdac = { 295static struct regulator_init_data devkit8000_vdac = {
328 .constraints = { 296 .constraints = {
@@ -337,10 +305,9 @@ static struct regulator_init_data devkit8000_vdac = {
337 .consumer_supplies = &devkit8000_vdda_dac_supply, 305 .consumer_supplies = &devkit8000_vdda_dac_supply,
338}; 306};
339 307
340/* VPLL2 for digital video outputs */ 308/* VPLL1 for digital video outputs */
341static struct regulator_init_data devkit8000_vpll2 = { 309static struct regulator_init_data devkit8000_vpll1 = {
342 .constraints = { 310 .constraints = {
343 .name = "VDVI",
344 .min_uV = 1800000, 311 .min_uV = 1800000,
345 .max_uV = 1800000, 312 .max_uV = 1800000,
346 .valid_modes_mask = REGULATOR_MODE_NORMAL 313 .valid_modes_mask = REGULATOR_MODE_NORMAL
@@ -348,8 +315,23 @@ static struct regulator_init_data devkit8000_vpll2 = {
348 .valid_ops_mask = REGULATOR_CHANGE_MODE 315 .valid_ops_mask = REGULATOR_CHANGE_MODE
349 | REGULATOR_CHANGE_STATUS, 316 | REGULATOR_CHANGE_STATUS,
350 }, 317 },
351 .num_consumer_supplies = ARRAY_SIZE(devkit8000_vpll2_supplies), 318 .num_consumer_supplies = 1,
352 .consumer_supplies = devkit8000_vpll2_supplies, 319 .consumer_supplies = &devkit8000_vpll1_supply,
320};
321
322/* VAUX4 for ads7846 and nubs */
323static struct regulator_init_data devkit8000_vio = {
324 .constraints = {
325 .min_uV = 1800000,
326 .max_uV = 1800000,
327 .apply_uV = true,
328 .valid_modes_mask = REGULATOR_MODE_NORMAL
329 | REGULATOR_MODE_STANDBY,
330 .valid_ops_mask = REGULATOR_CHANGE_MODE
331 | REGULATOR_CHANGE_STATUS,
332 },
333 .num_consumer_supplies = 1,
334 .consumer_supplies = &devkit8000_vio_supply,
353}; 335};
354 336
355static struct twl4030_usb_data devkit8000_usb_data = { 337static struct twl4030_usb_data devkit8000_usb_data = {
@@ -374,15 +356,15 @@ static struct twl4030_platform_data devkit8000_twldata = {
374 .gpio = &devkit8000_gpio_data, 356 .gpio = &devkit8000_gpio_data,
375 .codec = &devkit8000_codec_data, 357 .codec = &devkit8000_codec_data,
376 .vmmc1 = &devkit8000_vmmc1, 358 .vmmc1 = &devkit8000_vmmc1,
377 .vsim = &devkit8000_vsim,
378 .vdac = &devkit8000_vdac, 359 .vdac = &devkit8000_vdac,
379 .vpll2 = &devkit8000_vpll2, 360 .vpll1 = &devkit8000_vpll1,
361 .vio = &devkit8000_vio,
380 .keypad = &devkit8000_kp_data, 362 .keypad = &devkit8000_kp_data,
381}; 363};
382 364
383static struct i2c_board_info __initdata devkit8000_i2c_boardinfo[] = { 365static struct i2c_board_info __initdata devkit8000_i2c_boardinfo[] = {
384 { 366 {
385 I2C_BOARD_INFO("twl4030", 0x48), 367 I2C_BOARD_INFO("tps65930", 0x48),
386 .flags = I2C_CLIENT_WAKE, 368 .flags = I2C_CLIENT_WAKE,
387 .irq = INT_34XX_SYS_NIRQ, 369 .irq = INT_34XX_SYS_NIRQ,
388 .platform_data = &devkit8000_twldata, 370 .platform_data = &devkit8000_twldata,
@@ -464,8 +446,6 @@ static struct platform_device keys_gpio = {
464 446
465static void __init devkit8000_init_irq(void) 447static void __init devkit8000_init_irq(void)
466{ 448{
467 omap_board_config = devkit8000_config;
468 omap_board_config_size = ARRAY_SIZE(devkit8000_config);
469 omap2_init_common_hw(mt46h32m32lf6_sdrc_params, 449 omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
470 mt46h32m32lf6_sdrc_params); 450 mt46h32m32lf6_sdrc_params);
471 omap_init_irq(); 451 omap_init_irq();
@@ -560,6 +540,9 @@ static struct platform_device omap_dm9000_dev = {
560 540
561static void __init omap_dm9000_init(void) 541static void __init omap_dm9000_init(void)
562{ 542{
543 unsigned char *eth_addr = omap_dm9000_platdata.dev_addr;
544 struct omap_die_id odi;
545
563 if (gpio_request(OMAP_DM9000_GPIO_IRQ, "dm9000 irq") < 0) { 546 if (gpio_request(OMAP_DM9000_GPIO_IRQ, "dm9000 irq") < 0) {
564 printk(KERN_ERR "Failed to request GPIO%d for dm9000 IRQ\n", 547 printk(KERN_ERR "Failed to request GPIO%d for dm9000 IRQ\n",
565 OMAP_DM9000_GPIO_IRQ); 548 OMAP_DM9000_GPIO_IRQ);
@@ -567,6 +550,16 @@ static void __init omap_dm9000_init(void)
567 } 550 }
568 551
569 gpio_direction_input(OMAP_DM9000_GPIO_IRQ); 552 gpio_direction_input(OMAP_DM9000_GPIO_IRQ);
553
554 /* init the mac address using DIE id */
555 omap_get_die_id(&odi);
556
557 eth_addr[0] = 0x02; /* locally administered */
558 eth_addr[1] = odi.id_1 & 0xff;
559 eth_addr[2] = (odi.id_0 & 0xff000000) >> 24;
560 eth_addr[3] = (odi.id_0 & 0x00ff0000) >> 16;
561 eth_addr[4] = (odi.id_0 & 0x0000ff00) >> 8;
562 eth_addr[5] = (odi.id_0 & 0x000000ff);
570} 563}
571 564
572static struct platform_device *devkit8000_devices[] __initdata = { 565static struct platform_device *devkit8000_devices[] __initdata = {
@@ -581,8 +574,6 @@ static void __init devkit8000_flash_init(void)
581 u8 cs = 0; 574 u8 cs = 0;
582 u8 nandcs = GPMC_CS_NUM + 1; 575 u8 nandcs = GPMC_CS_NUM + 1;
583 576
584 u32 gpmc_base_add = OMAP34XX_GPMC_VIRT;
585
586 /* find out the chip-select on which NAND exists */ 577 /* find out the chip-select on which NAND exists */
587 while (cs < GPMC_CS_NUM) { 578 while (cs < GPMC_CS_NUM) {
588 u32 ret = 0; 579 u32 ret = 0;
@@ -604,13 +595,9 @@ static void __init devkit8000_flash_init(void)
604 595
605 if (nandcs < GPMC_CS_NUM) { 596 if (nandcs < GPMC_CS_NUM) {
606 devkit8000_nand_data.cs = nandcs; 597 devkit8000_nand_data.cs = nandcs;
607 devkit8000_nand_data.gpmc_cs_baseaddr = (void *)
608 (gpmc_base_add + GPMC_CS0_BASE + nandcs * GPMC_CS_SIZE);
609 devkit8000_nand_data.gpmc_baseaddr = (void *)
610 (gpmc_base_add);
611 598
612 printk(KERN_INFO "Registering NAND on CS%d\n", nandcs); 599 printk(KERN_INFO "Registering NAND on CS%d\n", nandcs);
613 if (platform_device_register(&devkit8000_nand_device) < 0) 600 if (gpmc_nand_init(&devkit8000_nand_data) < 0)
614 printk(KERN_ERR "Unable to register NAND device\n"); 601 printk(KERN_ERR "Unable to register NAND device\n");
615 } 602 }
616} 603}
@@ -797,8 +784,6 @@ static void __init devkit8000_init(void)
797 devkit8000_i2c_init(); 784 devkit8000_i2c_init();
798 platform_add_devices(devkit8000_devices, 785 platform_add_devices(devkit8000_devices,
799 ARRAY_SIZE(devkit8000_devices)); 786 ARRAY_SIZE(devkit8000_devices));
800 omap_board_config = devkit8000_config;
801 omap_board_config_size = ARRAY_SIZE(devkit8000_config);
802 787
803 spi_register_board_info(devkit8000_spi_board_info, 788 spi_register_board_info(devkit8000_spi_board_info,
804 ARRAY_SIZE(devkit8000_spi_board_info)); 789 ARRAY_SIZE(devkit8000_spi_board_info));
@@ -814,17 +799,11 @@ static void __init devkit8000_init(void)
814 omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); 799 omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
815} 800}
816 801
817static void __init devkit8000_map_io(void)
818{
819 omap2_set_globals_343x();
820 omap34xx_map_common_io();
821}
822
823MACHINE_START(DEVKIT8000, "OMAP3 Devkit8000") 802MACHINE_START(DEVKIT8000, "OMAP3 Devkit8000")
824 .phys_io = 0x48000000, 803 .phys_io = 0x48000000,
825 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc, 804 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
826 .boot_params = 0x80000100, 805 .boot_params = 0x80000100,
827 .map_io = devkit8000_map_io, 806 .map_io = omap3_map_io,
828 .reserve = omap_reserve, 807 .reserve = omap_reserve,
829 .init_irq = devkit8000_init_irq, 808 .init_irq = devkit8000_init_irq,
830 .init_machine = devkit8000_init, 809 .init_machine = devkit8000_init,