RT-AC56 3.0.0.4.374.37 core
[tomato.git] / release / src-rt-6.x.4708 / linux / linux-2.6.36 / arch / arm / mach-davinci / board-da850-evm.c
blob8f9b27e0e07327e463bcdd3d5bc5d4ca9ec036af
1 /*
2 * TI DA850/OMAP-L138 EVM board
4 * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
6 * Derived from: arch/arm/mach-davinci/board-da830-evm.c
7 * Original Copyrights follow:
9 * 2007, 2009 (c) MontaVista Software, Inc. This file is licensed under
10 * the terms of the GNU General Public License version 2. This program
11 * is licensed "as is" without any warranty of any kind, whether express
12 * or implied.
14 #include <linux/kernel.h>
15 #include <linux/init.h>
16 #include <linux/console.h>
17 #include <linux/i2c.h>
18 #include <linux/i2c/at24.h>
19 #include <linux/i2c/pca953x.h>
20 #include <linux/mfd/tps6507x.h>
21 #include <linux/gpio.h>
22 #include <linux/platform_device.h>
23 #include <linux/mtd/mtd.h>
24 #include <linux/mtd/nand.h>
25 #include <linux/mtd/partitions.h>
26 #include <linux/mtd/physmap.h>
27 #include <linux/regulator/machine.h>
28 #include <linux/regulator/tps6507x.h>
29 #include <linux/mfd/tps6507x.h>
30 #include <linux/input/tps6507x-ts.h>
32 #include <asm/mach-types.h>
33 #include <asm/mach/arch.h>
35 #include <mach/cp_intc.h>
36 #include <mach/da8xx.h>
37 #include <mach/nand.h>
38 #include <mach/mux.h>
40 #define DA850_EVM_PHY_MASK 0x1
41 #define DA850_EVM_MDIO_FREQUENCY 2200000 /* PHY bus frequency */
43 #define DA850_LCD_PWR_PIN GPIO_TO_PIN(2, 8)
44 #define DA850_LCD_BL_PIN GPIO_TO_PIN(2, 15)
46 #define DA850_MMCSD_CD_PIN GPIO_TO_PIN(4, 0)
47 #define DA850_MMCSD_WP_PIN GPIO_TO_PIN(4, 1)
49 #define DA850_MII_MDIO_CLKEN_PIN GPIO_TO_PIN(2, 6)
51 static struct mtd_partition da850_evm_norflash_partition[] = {
53 .name = "bootloaders + env",
54 .offset = 0,
55 .size = SZ_512K,
56 .mask_flags = MTD_WRITEABLE,
59 .name = "kernel",
60 .offset = MTDPART_OFS_APPEND,
61 .size = SZ_2M,
62 .mask_flags = 0,
65 .name = "filesystem",
66 .offset = MTDPART_OFS_APPEND,
67 .size = MTDPART_SIZ_FULL,
68 .mask_flags = 0,
72 static struct physmap_flash_data da850_evm_norflash_data = {
73 .width = 2,
74 .parts = da850_evm_norflash_partition,
75 .nr_parts = ARRAY_SIZE(da850_evm_norflash_partition),
78 static struct resource da850_evm_norflash_resource[] = {
80 .start = DA8XX_AEMIF_CS2_BASE,
81 .end = DA8XX_AEMIF_CS2_BASE + SZ_32M - 1,
82 .flags = IORESOURCE_MEM,
86 static struct platform_device da850_evm_norflash_device = {
87 .name = "physmap-flash",
88 .id = 0,
89 .dev = {
90 .platform_data = &da850_evm_norflash_data,
92 .num_resources = 1,
93 .resource = da850_evm_norflash_resource,
96 static struct davinci_pm_config da850_pm_pdata = {
97 .sleepcount = 128,
100 static struct platform_device da850_pm_device = {
101 .name = "pm-davinci",
102 .dev = {
103 .platform_data = &da850_pm_pdata,
105 .id = -1,
108 /* DA850/OMAP-L138 EVM includes a 512 MByte large-page NAND flash
109 * (128K blocks). It may be used instead of the (default) SPI flash
110 * to boot, using TI's tools to install the secondary boot loader
111 * (UBL) and U-Boot.
113 struct mtd_partition da850_evm_nandflash_partition[] = {
115 .name = "u-boot env",
116 .offset = 0,
117 .size = SZ_128K,
118 .mask_flags = MTD_WRITEABLE,
121 .name = "UBL",
122 .offset = MTDPART_OFS_APPEND,
123 .size = SZ_128K,
124 .mask_flags = MTD_WRITEABLE,
127 .name = "u-boot",
128 .offset = MTDPART_OFS_APPEND,
129 .size = 4 * SZ_128K,
130 .mask_flags = MTD_WRITEABLE,
133 .name = "kernel",
134 .offset = 0x200000,
135 .size = SZ_2M,
136 .mask_flags = 0,
139 .name = "filesystem",
140 .offset = MTDPART_OFS_APPEND,
141 .size = MTDPART_SIZ_FULL,
142 .mask_flags = 0,
146 static struct davinci_nand_pdata da850_evm_nandflash_data = {
147 .parts = da850_evm_nandflash_partition,
148 .nr_parts = ARRAY_SIZE(da850_evm_nandflash_partition),
149 .ecc_mode = NAND_ECC_HW,
150 .ecc_bits = 4,
151 .options = NAND_USE_FLASH_BBT,
154 static struct resource da850_evm_nandflash_resource[] = {
156 .start = DA8XX_AEMIF_CS3_BASE,
157 .end = DA8XX_AEMIF_CS3_BASE + SZ_512K + 2 * SZ_1K - 1,
158 .flags = IORESOURCE_MEM,
161 .start = DA8XX_AEMIF_CTL_BASE,
162 .end = DA8XX_AEMIF_CTL_BASE + SZ_32K - 1,
163 .flags = IORESOURCE_MEM,
167 static struct platform_device da850_evm_nandflash_device = {
168 .name = "davinci_nand",
169 .id = 1,
170 .dev = {
171 .platform_data = &da850_evm_nandflash_data,
173 .num_resources = ARRAY_SIZE(da850_evm_nandflash_resource),
174 .resource = da850_evm_nandflash_resource,
177 static struct platform_device *da850_evm_devices[] __initdata = {
178 &da850_evm_nandflash_device,
179 &da850_evm_norflash_device,
182 #define DA8XX_AEMIF_CE2CFG_OFFSET 0x10
183 #define DA8XX_AEMIF_ASIZE_16BIT 0x1
185 static void __init da850_evm_init_nor(void)
187 void __iomem *aemif_addr;
189 aemif_addr = ioremap(DA8XX_AEMIF_CTL_BASE, SZ_32K);
191 /* Configure data bus width of CS2 to 16 bit */
192 writel(readl(aemif_addr + DA8XX_AEMIF_CE2CFG_OFFSET) |
193 DA8XX_AEMIF_ASIZE_16BIT,
194 aemif_addr + DA8XX_AEMIF_CE2CFG_OFFSET);
196 iounmap(aemif_addr);
199 static u32 ui_card_detected;
201 #if defined(CONFIG_MMC_DAVINCI) || defined(CONFIG_MMC_DAVINCI_MODULE)
202 #define HAS_MMC 1
203 #else
204 #define HAS_MMC 0
205 #endif
207 static __init void da850_evm_setup_nor_nand(void)
209 int ret = 0;
211 if (ui_card_detected & !HAS_MMC) {
212 ret = davinci_cfg_reg_list(da850_nand_pins);
213 if (ret)
214 pr_warning("da850_evm_init: nand mux setup failed: "
215 "%d\n", ret);
217 ret = davinci_cfg_reg_list(da850_nor_pins);
218 if (ret)
219 pr_warning("da850_evm_init: nor mux setup failed: %d\n",
220 ret);
222 da850_evm_init_nor();
224 platform_add_devices(da850_evm_devices,
225 ARRAY_SIZE(da850_evm_devices));
229 #ifdef CONFIG_DA850_UI_RMII
230 static inline void da850_evm_setup_emac_rmii(int rmii_sel)
232 struct davinci_soc_info *soc_info = &davinci_soc_info;
234 soc_info->emac_pdata->rmii_en = 1;
235 gpio_set_value(rmii_sel, 0);
237 #else
238 static inline void da850_evm_setup_emac_rmii(int rmii_sel) { }
239 #endif
241 static int da850_evm_ui_expander_setup(struct i2c_client *client, unsigned gpio,
242 unsigned ngpio, void *c)
244 int sel_a, sel_b, sel_c, ret;
246 sel_a = gpio + 7;
247 sel_b = gpio + 6;
248 sel_c = gpio + 5;
250 ret = gpio_request(sel_a, "sel_a");
251 if (ret) {
252 pr_warning("Cannot open UI expander pin %d\n", sel_a);
253 goto exp_setup_sela_fail;
256 ret = gpio_request(sel_b, "sel_b");
257 if (ret) {
258 pr_warning("Cannot open UI expander pin %d\n", sel_b);
259 goto exp_setup_selb_fail;
262 ret = gpio_request(sel_c, "sel_c");
263 if (ret) {
264 pr_warning("Cannot open UI expander pin %d\n", sel_c);
265 goto exp_setup_selc_fail;
268 /* deselect all functionalities */
269 gpio_direction_output(sel_a, 1);
270 gpio_direction_output(sel_b, 1);
271 gpio_direction_output(sel_c, 1);
273 ui_card_detected = 1;
274 pr_info("DA850/OMAP-L138 EVM UI card detected\n");
276 da850_evm_setup_nor_nand();
278 da850_evm_setup_emac_rmii(sel_a);
280 return 0;
282 exp_setup_selc_fail:
283 gpio_free(sel_b);
284 exp_setup_selb_fail:
285 gpio_free(sel_a);
286 exp_setup_sela_fail:
287 return ret;
290 static int da850_evm_ui_expander_teardown(struct i2c_client *client,
291 unsigned gpio, unsigned ngpio, void *c)
293 /* deselect all functionalities */
294 gpio_set_value(gpio + 5, 1);
295 gpio_set_value(gpio + 6, 1);
296 gpio_set_value(gpio + 7, 1);
298 gpio_free(gpio + 5);
299 gpio_free(gpio + 6);
300 gpio_free(gpio + 7);
302 return 0;
305 static struct pca953x_platform_data da850_evm_ui_expander_info = {
306 .gpio_base = DAVINCI_N_GPIO,
307 .setup = da850_evm_ui_expander_setup,
308 .teardown = da850_evm_ui_expander_teardown,
311 static struct i2c_board_info __initdata da850_evm_i2c_devices[] = {
313 I2C_BOARD_INFO("tlv320aic3x", 0x18),
316 I2C_BOARD_INFO("tca6416", 0x20),
317 .platform_data = &da850_evm_ui_expander_info,
321 static struct davinci_i2c_platform_data da850_evm_i2c_0_pdata = {
322 .bus_freq = 100, /* kHz */
323 .bus_delay = 0, /* usec */
326 static struct davinci_uart_config da850_evm_uart_config __initdata = {
327 .enabled_uarts = 0x7,
330 /* davinci da850 evm audio machine driver */
331 static u8 da850_iis_serializer_direction[] = {
332 INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE,
333 INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE,
334 INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, TX_MODE,
335 RX_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE,
338 static struct snd_platform_data da850_evm_snd_data = {
339 .tx_dma_offset = 0x2000,
340 .rx_dma_offset = 0x2000,
341 .op_mode = DAVINCI_MCASP_IIS_MODE,
342 .num_serializer = ARRAY_SIZE(da850_iis_serializer_direction),
343 .tdm_slots = 2,
344 .serial_dir = da850_iis_serializer_direction,
345 .asp_chan_q = EVENTQ_1,
346 .version = MCASP_VERSION_2,
347 .txnumevt = 1,
348 .rxnumevt = 1,
351 static int da850_evm_mmc_get_ro(int index)
353 return gpio_get_value(DA850_MMCSD_WP_PIN);
356 static int da850_evm_mmc_get_cd(int index)
358 return !gpio_get_value(DA850_MMCSD_CD_PIN);
361 static struct davinci_mmc_config da850_mmc_config = {
362 .get_ro = da850_evm_mmc_get_ro,
363 .get_cd = da850_evm_mmc_get_cd,
364 .wires = 4,
365 .max_freq = 50000000,
366 .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
367 .version = MMC_CTLR_VERSION_2,
370 static void da850_panel_power_ctrl(int val)
372 /* lcd backlight */
373 gpio_set_value(DA850_LCD_BL_PIN, val);
375 /* lcd power */
376 gpio_set_value(DA850_LCD_PWR_PIN, val);
379 static int da850_lcd_hw_init(void)
381 int status;
383 status = gpio_request(DA850_LCD_BL_PIN, "lcd bl\n");
384 if (status < 0)
385 return status;
387 status = gpio_request(DA850_LCD_PWR_PIN, "lcd pwr\n");
388 if (status < 0) {
389 gpio_free(DA850_LCD_BL_PIN);
390 return status;
393 gpio_direction_output(DA850_LCD_BL_PIN, 0);
394 gpio_direction_output(DA850_LCD_PWR_PIN, 0);
396 /* Switch off panel power and backlight */
397 da850_panel_power_ctrl(0);
399 /* Switch on panel power and backlight */
400 da850_panel_power_ctrl(1);
402 return 0;
405 /* TPS65070 voltage regulator support */
407 /* 3.3V */
408 struct regulator_consumer_supply tps65070_dcdc1_consumers[] = {
410 .supply = "usb0_vdda33",
413 .supply = "usb1_vdda33",
417 /* 3.3V or 1.8V */
418 struct regulator_consumer_supply tps65070_dcdc2_consumers[] = {
420 .supply = "dvdd3318_a",
423 .supply = "dvdd3318_b",
426 .supply = "dvdd3318_c",
430 /* 1.2V */
431 struct regulator_consumer_supply tps65070_dcdc3_consumers[] = {
433 .supply = "cvdd",
437 /* 1.8V LDO */
438 struct regulator_consumer_supply tps65070_ldo1_consumers[] = {
440 .supply = "sata_vddr",
443 .supply = "usb0_vdda18",
446 .supply = "usb1_vdda18",
449 .supply = "ddr_dvdd18",
453 /* 1.2V LDO */
454 struct regulator_consumer_supply tps65070_ldo2_consumers[] = {
456 .supply = "sata_vdd",
459 .supply = "pll0_vdda",
462 .supply = "pll1_vdda",
465 .supply = "usbs_cvdd",
468 .supply = "vddarnwa1",
472 /* We take advantage of the fact that both defdcdc{2,3} are tied high */
473 static struct tps6507x_reg_platform_data tps6507x_platform_data = {
474 .defdcdc_default = true,
477 struct regulator_init_data tps65070_regulator_data[] = {
478 /* dcdc1 */
480 .constraints = {
481 .min_uV = 3150000,
482 .max_uV = 3450000,
483 .valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE |
484 REGULATOR_CHANGE_STATUS),
485 .boot_on = 1,
487 .num_consumer_supplies = ARRAY_SIZE(tps65070_dcdc1_consumers),
488 .consumer_supplies = tps65070_dcdc1_consumers,
491 /* dcdc2 */
493 .constraints = {
494 .min_uV = 1710000,
495 .max_uV = 3450000,
496 .valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE |
497 REGULATOR_CHANGE_STATUS),
498 .boot_on = 1,
500 .num_consumer_supplies = ARRAY_SIZE(tps65070_dcdc2_consumers),
501 .consumer_supplies = tps65070_dcdc2_consumers,
502 .driver_data = &tps6507x_platform_data,
505 /* dcdc3 */
507 .constraints = {
508 .min_uV = 950000,
509 .max_uV = 1320000,
510 .valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE |
511 REGULATOR_CHANGE_STATUS),
512 .boot_on = 1,
514 .num_consumer_supplies = ARRAY_SIZE(tps65070_dcdc3_consumers),
515 .consumer_supplies = tps65070_dcdc3_consumers,
516 .driver_data = &tps6507x_platform_data,
519 /* ldo1 */
521 .constraints = {
522 .min_uV = 1710000,
523 .max_uV = 1890000,
524 .valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE |
525 REGULATOR_CHANGE_STATUS),
526 .boot_on = 1,
528 .num_consumer_supplies = ARRAY_SIZE(tps65070_ldo1_consumers),
529 .consumer_supplies = tps65070_ldo1_consumers,
532 /* ldo2 */
534 .constraints = {
535 .min_uV = 1140000,
536 .max_uV = 1320000,
537 .valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE |
538 REGULATOR_CHANGE_STATUS),
539 .boot_on = 1,
541 .num_consumer_supplies = ARRAY_SIZE(tps65070_ldo2_consumers),
542 .consumer_supplies = tps65070_ldo2_consumers,
546 static struct touchscreen_init_data tps6507x_touchscreen_data = {
547 .poll_period = 30, /* ms between touch samples */
548 .min_pressure = 0x30, /* minimum pressure to trigger touch */
549 .vref = 0, /* turn off vref when not using A/D */
550 .vendor = 0, /* /sys/class/input/input?/id/vendor */
551 .product = 65070, /* /sys/class/input/input?/id/product */
552 .version = 0x100, /* /sys/class/input/input?/id/version */
555 static struct tps6507x_board tps_board = {
556 .tps6507x_pmic_init_data = &tps65070_regulator_data[0],
557 .tps6507x_ts_init_data = &tps6507x_touchscreen_data,
560 static struct i2c_board_info __initdata da850evm_tps65070_info[] = {
562 I2C_BOARD_INFO("tps6507x", 0x48),
563 .platform_data = &tps_board,
567 static int __init pmic_tps65070_init(void)
569 return i2c_register_board_info(1, da850evm_tps65070_info,
570 ARRAY_SIZE(da850evm_tps65070_info));
573 static const short da850_evm_lcdc_pins[] = {
574 DA850_GPIO2_8, DA850_GPIO2_15,
578 static int __init da850_evm_config_emac(void)
580 void __iomem *cfg_chip3_base;
581 int ret;
582 u32 val;
583 struct davinci_soc_info *soc_info = &davinci_soc_info;
584 u8 rmii_en = soc_info->emac_pdata->rmii_en;
586 if (!machine_is_davinci_da850_evm())
587 return 0;
589 cfg_chip3_base = DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP3_REG);
591 val = __raw_readl(cfg_chip3_base);
593 if (rmii_en) {
594 val |= BIT(8);
595 ret = davinci_cfg_reg_list(da850_rmii_pins);
596 pr_info("EMAC: RMII PHY configured, MII PHY will not be"
597 " functional\n");
598 } else {
599 val &= ~BIT(8);
600 ret = davinci_cfg_reg_list(da850_cpgmac_pins);
601 pr_info("EMAC: MII PHY configured, RMII PHY will not be"
602 " functional\n");
605 if (ret)
606 pr_warning("da850_evm_init: cpgmac/rmii mux setup failed: %d\n",
607 ret);
609 /* configure the CFGCHIP3 register for RMII or MII */
610 __raw_writel(val, cfg_chip3_base);
612 ret = davinci_cfg_reg(DA850_GPIO2_6);
613 if (ret)
614 pr_warning("da850_evm_init:GPIO(2,6) mux setup "
615 "failed\n");
617 ret = gpio_request(DA850_MII_MDIO_CLKEN_PIN, "mdio_clk_en");
618 if (ret) {
619 pr_warning("Cannot open GPIO %d\n",
620 DA850_MII_MDIO_CLKEN_PIN);
621 return ret;
624 /* Enable/Disable MII MDIO clock */
625 gpio_direction_output(DA850_MII_MDIO_CLKEN_PIN, rmii_en);
627 soc_info->emac_pdata->phy_mask = DA850_EVM_PHY_MASK;
628 soc_info->emac_pdata->mdio_max_freq = DA850_EVM_MDIO_FREQUENCY;
630 ret = da8xx_register_emac();
631 if (ret)
632 pr_warning("da850_evm_init: emac registration failed: %d\n",
633 ret);
635 return 0;
637 device_initcall(da850_evm_config_emac);
640 * The following EDMA channels/slots are not being used by drivers (for
641 * example: Timer, GPIO, UART events etc) on da850/omap-l138 EVM, hence
642 * they are being reserved for codecs on the DSP side.
644 static const s16 da850_dma0_rsv_chans[][2] = {
645 /* (offset, number) */
646 { 8, 6},
647 {24, 4},
648 {30, 2},
649 {-1, -1}
652 static const s16 da850_dma0_rsv_slots[][2] = {
653 /* (offset, number) */
654 { 8, 6},
655 {24, 4},
656 {30, 50},
657 {-1, -1}
660 static const s16 da850_dma1_rsv_chans[][2] = {
661 /* (offset, number) */
662 { 0, 28},
663 {30, 2},
664 {-1, -1}
667 static const s16 da850_dma1_rsv_slots[][2] = {
668 /* (offset, number) */
669 { 0, 28},
670 {30, 90},
671 {-1, -1}
674 static struct edma_rsv_info da850_edma_cc0_rsv = {
675 .rsv_chans = da850_dma0_rsv_chans,
676 .rsv_slots = da850_dma0_rsv_slots,
679 static struct edma_rsv_info da850_edma_cc1_rsv = {
680 .rsv_chans = da850_dma1_rsv_chans,
681 .rsv_slots = da850_dma1_rsv_slots,
684 static struct edma_rsv_info *da850_edma_rsv[2] = {
685 &da850_edma_cc0_rsv,
686 &da850_edma_cc1_rsv,
689 static __init void da850_evm_init(void)
691 int ret;
693 ret = pmic_tps65070_init();
694 if (ret)
695 pr_warning("da850_evm_init: TPS65070 PMIC init failed: %d\n",
696 ret);
698 ret = da850_register_edma(da850_edma_rsv);
699 if (ret)
700 pr_warning("da850_evm_init: edma registration failed: %d\n",
701 ret);
703 ret = davinci_cfg_reg_list(da850_i2c0_pins);
704 if (ret)
705 pr_warning("da850_evm_init: i2c0 mux setup failed: %d\n",
706 ret);
708 ret = da8xx_register_i2c(0, &da850_evm_i2c_0_pdata);
709 if (ret)
710 pr_warning("da850_evm_init: i2c0 registration failed: %d\n",
711 ret);
714 ret = da8xx_register_watchdog();
715 if (ret)
716 pr_warning("da830_evm_init: watchdog registration failed: %d\n",
717 ret);
719 if (HAS_MMC) {
720 ret = davinci_cfg_reg_list(da850_mmcsd0_pins);
721 if (ret)
722 pr_warning("da850_evm_init: mmcsd0 mux setup failed:"
723 " %d\n", ret);
725 ret = gpio_request(DA850_MMCSD_CD_PIN, "MMC CD\n");
726 if (ret)
727 pr_warning("da850_evm_init: can not open GPIO %d\n",
728 DA850_MMCSD_CD_PIN);
729 gpio_direction_input(DA850_MMCSD_CD_PIN);
731 ret = gpio_request(DA850_MMCSD_WP_PIN, "MMC WP\n");
732 if (ret)
733 pr_warning("da850_evm_init: can not open GPIO %d\n",
734 DA850_MMCSD_WP_PIN);
735 gpio_direction_input(DA850_MMCSD_WP_PIN);
737 ret = da8xx_register_mmcsd0(&da850_mmc_config);
738 if (ret)
739 pr_warning("da850_evm_init: mmcsd0 registration failed:"
740 " %d\n", ret);
743 davinci_serial_init(&da850_evm_uart_config);
745 i2c_register_board_info(1, da850_evm_i2c_devices,
746 ARRAY_SIZE(da850_evm_i2c_devices));
749 * shut down uart 0 and 1; they are not used on the board and
750 * accessing them causes endless "too much work in irq53" messages
751 * with arago fs
753 __raw_writel(0, IO_ADDRESS(DA8XX_UART1_BASE) + 0x30);
754 __raw_writel(0, IO_ADDRESS(DA8XX_UART0_BASE) + 0x30);
756 ret = davinci_cfg_reg_list(da850_mcasp_pins);
757 if (ret)
758 pr_warning("da850_evm_init: mcasp mux setup failed: %d\n",
759 ret);
761 da8xx_register_mcasp(0, &da850_evm_snd_data);
763 ret = davinci_cfg_reg_list(da850_lcdcntl_pins);
764 if (ret)
765 pr_warning("da850_evm_init: lcdcntl mux setup failed: %d\n",
766 ret);
768 /* Handle board specific muxing for LCD here */
769 ret = davinci_cfg_reg_list(da850_evm_lcdc_pins);
770 if (ret)
771 pr_warning("da850_evm_init: evm specific lcd mux setup "
772 "failed: %d\n", ret);
774 ret = da850_lcd_hw_init();
775 if (ret)
776 pr_warning("da850_evm_init: lcd initialization failed: %d\n",
777 ret);
779 sharp_lk043t1dg01_pdata.panel_power_ctrl = da850_panel_power_ctrl,
780 ret = da8xx_register_lcdc(&sharp_lk043t1dg01_pdata);
781 if (ret)
782 pr_warning("da850_evm_init: lcdc registration failed: %d\n",
783 ret);
785 ret = da8xx_register_rtc();
786 if (ret)
787 pr_warning("da850_evm_init: rtc setup failed: %d\n", ret);
789 ret = da850_register_cpufreq();
790 if (ret)
791 pr_warning("da850_evm_init: cpufreq registration failed: %d\n",
792 ret);
794 ret = da8xx_register_cpuidle();
795 if (ret)
796 pr_warning("da850_evm_init: cpuidle registration failed: %d\n",
797 ret);
799 ret = da850_register_pm(&da850_pm_device);
800 if (ret)
801 pr_warning("da850_evm_init: suspend registration failed: %d\n",
802 ret);
805 #ifdef CONFIG_SERIAL_8250_CONSOLE
806 static int __init da850_evm_console_init(void)
808 return add_preferred_console("ttyS", 2, "115200");
810 console_initcall(da850_evm_console_init);
811 #endif
813 static void __init da850_evm_map_io(void)
815 da850_init();
818 MACHINE_START(DAVINCI_DA850_EVM, "DaVinci DA850/OMAP-L138 EVM")
819 .phys_io = IO_PHYS,
820 .io_pg_offst = (__IO_ADDRESS(IO_PHYS) >> 18) & 0xfffc,
821 .boot_params = (DA8XX_DDR_BASE + 0x100),
822 .map_io = da850_evm_map_io,
823 .init_irq = cp_intc_init,
824 .timer = &davinci_timer,
825 .init_machine = da850_evm_init,
826 MACHINE_END