d0e3178f8fe98d4246c375c0ba6b973a45ba0d5c
[safe/jmp/linux-2.6] / arch / arm / mach-davinci / board-da850-evm.c
1 /*
2  * TI DA850/OMAP-L138 EVM board
3  *
4  * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
5  *
6  * Derived from: arch/arm/mach-davinci/board-da830-evm.c
7  * Original Copyrights follow:
8  *
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.
13  */
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/gpio.h>
21 #include <linux/platform_device.h>
22 #include <linux/mtd/mtd.h>
23 #include <linux/mtd/nand.h>
24 #include <linux/mtd/partitions.h>
25 #include <linux/mtd/physmap.h>
26 #include <linux/regulator/machine.h>
27
28 #include <asm/mach-types.h>
29 #include <asm/mach/arch.h>
30
31 #include <mach/cp_intc.h>
32 #include <mach/da8xx.h>
33 #include <mach/nand.h>
34 #include <mach/mux.h>
35
36 #define DA850_EVM_PHY_MASK              0x1
37 #define DA850_EVM_MDIO_FREQUENCY        2200000 /* PHY bus frequency */
38
39 #define DA850_LCD_PWR_PIN               GPIO_TO_PIN(2, 8)
40 #define DA850_LCD_BL_PIN                GPIO_TO_PIN(2, 15)
41
42 #define DA850_MMCSD_CD_PIN              GPIO_TO_PIN(4, 0)
43 #define DA850_MMCSD_WP_PIN              GPIO_TO_PIN(4, 1)
44
45 #define DA850_MII_MDIO_CLKEN_PIN        GPIO_TO_PIN(2, 6)
46
47 static struct mtd_partition da850_evm_norflash_partition[] = {
48         {
49                 .name           = "NOR filesystem",
50                 .offset         = 0,
51                 .size           = MTDPART_SIZ_FULL,
52                 .mask_flags     = 0,
53         },
54 };
55
56 static struct physmap_flash_data da850_evm_norflash_data = {
57         .width          = 2,
58         .parts          = da850_evm_norflash_partition,
59         .nr_parts       = ARRAY_SIZE(da850_evm_norflash_partition),
60 };
61
62 static struct resource da850_evm_norflash_resource[] = {
63         {
64                 .start  = DA8XX_AEMIF_CS2_BASE,
65                 .end    = DA8XX_AEMIF_CS2_BASE + SZ_32M - 1,
66                 .flags  = IORESOURCE_MEM,
67         },
68 };
69
70 static struct platform_device da850_evm_norflash_device = {
71         .name           = "physmap-flash",
72         .id             = 0,
73         .dev            = {
74                 .platform_data  = &da850_evm_norflash_data,
75         },
76         .num_resources  = 1,
77         .resource       = da850_evm_norflash_resource,
78 };
79
80 /* DA850/OMAP-L138 EVM includes a 512 MByte large-page NAND flash
81  * (128K blocks). It may be used instead of the (default) SPI flash
82  * to boot, using TI's tools to install the secondary boot loader
83  * (UBL) and U-Boot.
84  */
85 struct mtd_partition da850_evm_nandflash_partition[] = {
86         {
87                 .name           = "u-boot env",
88                 .offset         = 0,
89                 .size           = SZ_128K,
90                 .mask_flags     = MTD_WRITEABLE,
91          },
92         {
93                 .name           = "UBL",
94                 .offset         = MTDPART_OFS_APPEND,
95                 .size           = SZ_128K,
96                 .mask_flags     = MTD_WRITEABLE,
97         },
98         {
99                 .name           = "u-boot",
100                 .offset         = MTDPART_OFS_APPEND,
101                 .size           = 4 * SZ_128K,
102                 .mask_flags     = MTD_WRITEABLE,
103         },
104         {
105                 .name           = "kernel",
106                 .offset         = 0x200000,
107                 .size           = SZ_2M,
108                 .mask_flags     = 0,
109         },
110         {
111                 .name           = "filesystem",
112                 .offset         = MTDPART_OFS_APPEND,
113                 .size           = MTDPART_SIZ_FULL,
114                 .mask_flags     = 0,
115         },
116 };
117
118 static struct davinci_nand_pdata da850_evm_nandflash_data = {
119         .parts          = da850_evm_nandflash_partition,
120         .nr_parts       = ARRAY_SIZE(da850_evm_nandflash_partition),
121         .ecc_mode       = NAND_ECC_HW,
122         .options        = NAND_USE_FLASH_BBT,
123 };
124
125 static struct resource da850_evm_nandflash_resource[] = {
126         {
127                 .start  = DA8XX_AEMIF_CS3_BASE,
128                 .end    = DA8XX_AEMIF_CS3_BASE + SZ_512K + 2 * SZ_1K - 1,
129                 .flags  = IORESOURCE_MEM,
130         },
131         {
132                 .start  = DA8XX_AEMIF_CTL_BASE,
133                 .end    = DA8XX_AEMIF_CTL_BASE + SZ_32K - 1,
134                 .flags  = IORESOURCE_MEM,
135         },
136 };
137
138 static struct platform_device da850_evm_nandflash_device = {
139         .name           = "davinci_nand",
140         .id             = 1,
141         .dev            = {
142                 .platform_data  = &da850_evm_nandflash_data,
143         },
144         .num_resources  = ARRAY_SIZE(da850_evm_nandflash_resource),
145         .resource       = da850_evm_nandflash_resource,
146 };
147
148 static u32 ui_card_detected;
149 static void da850_evm_setup_nor_nand(void);
150
151 #ifdef CONFIG_DA850_UI_RMII
152 static inline void da850_evm_setup_emac_rmii(int rmii_sel)
153 {
154         struct davinci_soc_info *soc_info = &davinci_soc_info;
155
156         soc_info->emac_pdata->rmii_en = 1;
157         gpio_set_value(rmii_sel, 0);
158 }
159 #else
160 static inline void da850_evm_setup_emac_rmii(int rmii_sel) { }
161 #endif
162
163 static int da850_evm_ui_expander_setup(struct i2c_client *client, unsigned gpio,
164                                                 unsigned ngpio, void *c)
165 {
166         int sel_a, sel_b, sel_c, ret;
167
168         sel_a = gpio + 7;
169         sel_b = gpio + 6;
170         sel_c = gpio + 5;
171
172         ret = gpio_request(sel_a, "sel_a");
173         if (ret) {
174                 pr_warning("Cannot open UI expander pin %d\n", sel_a);
175                 goto exp_setup_sela_fail;
176         }
177
178         ret = gpio_request(sel_b, "sel_b");
179         if (ret) {
180                 pr_warning("Cannot open UI expander pin %d\n", sel_b);
181                 goto exp_setup_selb_fail;
182         }
183
184         ret = gpio_request(sel_c, "sel_c");
185         if (ret) {
186                 pr_warning("Cannot open UI expander pin %d\n", sel_c);
187                 goto exp_setup_selc_fail;
188         }
189
190         /* deselect all functionalities */
191         gpio_direction_output(sel_a, 1);
192         gpio_direction_output(sel_b, 1);
193         gpio_direction_output(sel_c, 1);
194
195         ui_card_detected = 1;
196         pr_info("DA850/OMAP-L138 EVM UI card detected\n");
197
198         da850_evm_setup_nor_nand();
199
200         da850_evm_setup_emac_rmii(sel_a);
201
202         return 0;
203
204 exp_setup_selc_fail:
205         gpio_free(sel_b);
206 exp_setup_selb_fail:
207         gpio_free(sel_a);
208 exp_setup_sela_fail:
209         return ret;
210 }
211
212 static int da850_evm_ui_expander_teardown(struct i2c_client *client,
213                                         unsigned gpio, unsigned ngpio, void *c)
214 {
215         /* deselect all functionalities */
216         gpio_set_value(gpio + 5, 1);
217         gpio_set_value(gpio + 6, 1);
218         gpio_set_value(gpio + 7, 1);
219
220         gpio_free(gpio + 5);
221         gpio_free(gpio + 6);
222         gpio_free(gpio + 7);
223
224         return 0;
225 }
226
227 static struct pca953x_platform_data da850_evm_ui_expander_info = {
228         .gpio_base      = DAVINCI_N_GPIO,
229         .setup          = da850_evm_ui_expander_setup,
230         .teardown       = da850_evm_ui_expander_teardown,
231 };
232
233 static struct i2c_board_info __initdata da850_evm_i2c_devices[] = {
234         {
235                 I2C_BOARD_INFO("tlv320aic3x", 0x18),
236         },
237         {
238                 I2C_BOARD_INFO("tca6416", 0x20),
239                 .platform_data = &da850_evm_ui_expander_info,
240         },
241 };
242
243 static struct davinci_i2c_platform_data da850_evm_i2c_0_pdata = {
244         .bus_freq       = 100,  /* kHz */
245         .bus_delay      = 0,    /* usec */
246 };
247
248 static struct davinci_uart_config da850_evm_uart_config __initdata = {
249         .enabled_uarts = 0x7,
250 };
251
252 static struct platform_device *da850_evm_devices[] __initdata = {
253         &da850_evm_nandflash_device,
254         &da850_evm_norflash_device,
255 };
256
257 /* davinci da850 evm audio machine driver */
258 static u8 da850_iis_serializer_direction[] = {
259         INACTIVE_MODE,  INACTIVE_MODE,  INACTIVE_MODE,  INACTIVE_MODE,
260         INACTIVE_MODE,  INACTIVE_MODE,  INACTIVE_MODE,  INACTIVE_MODE,
261         INACTIVE_MODE,  INACTIVE_MODE,  INACTIVE_MODE,  TX_MODE,
262         RX_MODE,        INACTIVE_MODE,  INACTIVE_MODE,  INACTIVE_MODE,
263 };
264
265 static struct snd_platform_data da850_evm_snd_data = {
266         .tx_dma_offset  = 0x2000,
267         .rx_dma_offset  = 0x2000,
268         .op_mode        = DAVINCI_MCASP_IIS_MODE,
269         .num_serializer = ARRAY_SIZE(da850_iis_serializer_direction),
270         .tdm_slots      = 2,
271         .serial_dir     = da850_iis_serializer_direction,
272         .eventq_no      = EVENTQ_1,
273         .version        = MCASP_VERSION_2,
274         .txnumevt       = 1,
275         .rxnumevt       = 1,
276 };
277
278 static int da850_evm_mmc_get_ro(int index)
279 {
280         return gpio_get_value(DA850_MMCSD_WP_PIN);
281 }
282
283 static int da850_evm_mmc_get_cd(int index)
284 {
285         return !gpio_get_value(DA850_MMCSD_CD_PIN);
286 }
287
288 static struct davinci_mmc_config da850_mmc_config = {
289         .get_ro         = da850_evm_mmc_get_ro,
290         .get_cd         = da850_evm_mmc_get_cd,
291         .wires          = 4,
292         .version        = MMC_CTLR_VERSION_2,
293 };
294
295 static int da850_lcd_hw_init(void)
296 {
297         int status;
298
299         status = gpio_request(DA850_LCD_BL_PIN, "lcd bl\n");
300         if (status < 0)
301                 return status;
302
303         status = gpio_request(DA850_LCD_PWR_PIN, "lcd pwr\n");
304         if (status < 0) {
305                 gpio_free(DA850_LCD_BL_PIN);
306                 return status;
307         }
308
309         gpio_direction_output(DA850_LCD_BL_PIN, 0);
310         gpio_direction_output(DA850_LCD_PWR_PIN, 0);
311
312         /* disable lcd backlight */
313         gpio_set_value(DA850_LCD_BL_PIN, 0);
314
315         /* disable lcd power */
316         gpio_set_value(DA850_LCD_PWR_PIN, 0);
317
318         /* enable lcd power */
319         gpio_set_value(DA850_LCD_PWR_PIN, 1);
320
321         /* enable lcd backlight */
322         gpio_set_value(DA850_LCD_BL_PIN, 1);
323
324         return 0;
325 }
326
327 #define DA8XX_AEMIF_CE2CFG_OFFSET       0x10
328 #define DA8XX_AEMIF_ASIZE_16BIT         0x1
329
330 static void __init da850_evm_init_nor(void)
331 {
332         void __iomem *aemif_addr;
333
334         aemif_addr = ioremap(DA8XX_AEMIF_CTL_BASE, SZ_32K);
335
336         /* Configure data bus width of CS2 to 16 bit */
337         writel(readl(aemif_addr + DA8XX_AEMIF_CE2CFG_OFFSET) |
338                 DA8XX_AEMIF_ASIZE_16BIT,
339                 aemif_addr + DA8XX_AEMIF_CE2CFG_OFFSET);
340
341         iounmap(aemif_addr);
342 }
343
344 /* TPS65070 voltage regulator support */
345
346 /* 3.3V */
347 struct regulator_consumer_supply tps65070_dcdc1_consumers[] = {
348         {
349                 .supply = "usb0_vdda33",
350         },
351         {
352                 .supply = "usb1_vdda33",
353         },
354 };
355
356 /* 3.3V or 1.8V */
357 struct regulator_consumer_supply tps65070_dcdc2_consumers[] = {
358         {
359                 .supply = "dvdd3318_a",
360         },
361         {
362                 .supply = "dvdd3318_b",
363         },
364         {
365                 .supply = "dvdd3318_c",
366         },
367 };
368
369 /* 1.2V */
370 struct regulator_consumer_supply tps65070_dcdc3_consumers[] = {
371         {
372                 .supply = "cvdd",
373         },
374 };
375
376 /* 1.8V LDO */
377 struct regulator_consumer_supply tps65070_ldo1_consumers[] = {
378         {
379                 .supply = "sata_vddr",
380         },
381         {
382                 .supply = "usb0_vdda18",
383         },
384         {
385                 .supply = "usb1_vdda18",
386         },
387         {
388                 .supply = "ddr_dvdd18",
389         },
390 };
391
392 /* 1.2V LDO */
393 struct regulator_consumer_supply tps65070_ldo2_consumers[] = {
394         {
395                 .supply = "sata_vdd",
396         },
397         {
398                 .supply = "pll0_vdda",
399         },
400         {
401                 .supply = "pll1_vdda",
402         },
403         {
404                 .supply = "usbs_cvdd",
405         },
406         {
407                 .supply = "vddarnwa1",
408         },
409 };
410
411 struct regulator_init_data tps65070_regulator_data[] = {
412         /* dcdc1 */
413         {
414                 .constraints = {
415                         .min_uV = 3150000,
416                         .max_uV = 3450000,
417                         .valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE |
418                                 REGULATOR_CHANGE_STATUS),
419                         .boot_on = 1,
420                 },
421                 .num_consumer_supplies = ARRAY_SIZE(tps65070_dcdc1_consumers),
422                 .consumer_supplies = tps65070_dcdc1_consumers,
423         },
424
425         /* dcdc2 */
426         {
427                 .constraints = {
428                         .min_uV = 1710000,
429                         .max_uV = 3450000,
430                         .valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE |
431                                 REGULATOR_CHANGE_STATUS),
432                         .boot_on = 1,
433                 },
434                 .num_consumer_supplies = ARRAY_SIZE(tps65070_dcdc2_consumers),
435                 .consumer_supplies = tps65070_dcdc2_consumers,
436         },
437
438         /* dcdc3 */
439         {
440                 .constraints = {
441                         .min_uV = 950000,
442                         .max_uV = 1320000,
443                         .valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE |
444                                 REGULATOR_CHANGE_STATUS),
445                         .boot_on = 1,
446                 },
447                 .num_consumer_supplies = ARRAY_SIZE(tps65070_dcdc3_consumers),
448                 .consumer_supplies = tps65070_dcdc3_consumers,
449         },
450
451         /* ldo1 */
452         {
453                 .constraints = {
454                         .min_uV = 1710000,
455                         .max_uV = 1890000,
456                         .valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE |
457                                 REGULATOR_CHANGE_STATUS),
458                         .boot_on = 1,
459                 },
460                 .num_consumer_supplies = ARRAY_SIZE(tps65070_ldo1_consumers),
461                 .consumer_supplies = tps65070_ldo1_consumers,
462         },
463
464         /* ldo2 */
465         {
466                 .constraints = {
467                         .min_uV = 1140000,
468                         .max_uV = 1320000,
469                         .valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE |
470                                 REGULATOR_CHANGE_STATUS),
471                         .boot_on = 1,
472                 },
473                 .num_consumer_supplies = ARRAY_SIZE(tps65070_ldo2_consumers),
474                 .consumer_supplies = tps65070_ldo2_consumers,
475         },
476 };
477
478 static struct i2c_board_info __initdata da850evm_tps65070_info[] = {
479         {
480                 I2C_BOARD_INFO("tps6507x", 0x48),
481                 .platform_data = &tps65070_regulator_data[0],
482         },
483 };
484
485 static int __init pmic_tps65070_init(void)
486 {
487         return i2c_register_board_info(1, da850evm_tps65070_info,
488                                         ARRAY_SIZE(da850evm_tps65070_info));
489 }
490
491 #if defined(CONFIG_MMC_DAVINCI) || \
492     defined(CONFIG_MMC_DAVINCI_MODULE)
493 #define HAS_MMC 1
494 #else
495 #define HAS_MMC 0
496 #endif
497
498 static void da850_evm_setup_nor_nand(void)
499 {
500         int ret = 0;
501
502         if (ui_card_detected & !HAS_MMC) {
503                 ret = da8xx_pinmux_setup(da850_nand_pins);
504                 if (ret)
505                         pr_warning("da850_evm_init: nand mux setup failed: "
506                                         "%d\n", ret);
507
508                 ret = da8xx_pinmux_setup(da850_nor_pins);
509                 if (ret)
510                         pr_warning("da850_evm_init: nor mux setup failed: %d\n",
511                                 ret);
512
513                 da850_evm_init_nor();
514
515                 platform_add_devices(da850_evm_devices,
516                                         ARRAY_SIZE(da850_evm_devices));
517         }
518 }
519
520 static const short da850_evm_lcdc_pins[] = {
521         DA850_GPIO2_8, DA850_GPIO2_15,
522         -1
523 };
524
525 static int __init da850_evm_config_emac(void)
526 {
527         void __iomem *cfg_chip3_base;
528         int ret;
529         u32 val;
530         struct davinci_soc_info *soc_info = &davinci_soc_info;
531         u8 rmii_en = soc_info->emac_pdata->rmii_en;
532
533         if (!machine_is_davinci_da850_evm())
534                 return 0;
535
536         cfg_chip3_base = DA8XX_SYSCFG_VIRT(DA8XX_CFGCHIP3_REG);
537
538         val = __raw_readl(cfg_chip3_base);
539
540         if (rmii_en) {
541                 val |= BIT(8);
542                 ret = da8xx_pinmux_setup(da850_rmii_pins);
543                 pr_info("EMAC: RMII PHY configured, MII PHY will not be"
544                                                         " functional\n");
545         } else {
546                 val &= ~BIT(8);
547                 ret = da8xx_pinmux_setup(da850_cpgmac_pins);
548                 pr_info("EMAC: MII PHY configured, RMII PHY will not be"
549                                                         " functional\n");
550         }
551
552         if (ret)
553                 pr_warning("da850_evm_init: cpgmac/rmii mux setup failed: %d\n",
554                                 ret);
555
556         /* configure the CFGCHIP3 register for RMII or MII */
557         __raw_writel(val, cfg_chip3_base);
558
559         ret = davinci_cfg_reg(DA850_GPIO2_6);
560         if (ret)
561                 pr_warning("da850_evm_init:GPIO(2,6) mux setup "
562                                                         "failed\n");
563
564         ret = gpio_request(DA850_MII_MDIO_CLKEN_PIN, "mdio_clk_en");
565         if (ret) {
566                 pr_warning("Cannot open GPIO %d\n",
567                                         DA850_MII_MDIO_CLKEN_PIN);
568                 return ret;
569         }
570
571         /* Enable/Disable MII MDIO clock */
572         gpio_direction_output(DA850_MII_MDIO_CLKEN_PIN, rmii_en);
573
574         soc_info->emac_pdata->phy_mask = DA850_EVM_PHY_MASK;
575         soc_info->emac_pdata->mdio_max_freq = DA850_EVM_MDIO_FREQUENCY;
576
577         ret = da8xx_register_emac();
578         if (ret)
579                 pr_warning("da850_evm_init: emac registration failed: %d\n",
580                                 ret);
581
582         return 0;
583 }
584 device_initcall(da850_evm_config_emac);
585
586 static __init void da850_evm_init(void)
587 {
588         int ret;
589
590         ret = pmic_tps65070_init();
591         if (ret)
592                 pr_warning("da850_evm_init: TPS65070 PMIC init failed: %d\n",
593                                 ret);
594
595         ret = da8xx_register_edma();
596         if (ret)
597                 pr_warning("da850_evm_init: edma registration failed: %d\n",
598                                 ret);
599
600         ret = da8xx_pinmux_setup(da850_i2c0_pins);
601         if (ret)
602                 pr_warning("da850_evm_init: i2c0 mux setup failed: %d\n",
603                                 ret);
604
605         ret = da8xx_register_i2c(0, &da850_evm_i2c_0_pdata);
606         if (ret)
607                 pr_warning("da850_evm_init: i2c0 registration failed: %d\n",
608                                 ret);
609
610
611         ret = da8xx_register_watchdog();
612         if (ret)
613                 pr_warning("da830_evm_init: watchdog registration failed: %d\n",
614                                 ret);
615
616         if (HAS_MMC) {
617                 ret = da8xx_pinmux_setup(da850_mmcsd0_pins);
618                 if (ret)
619                         pr_warning("da850_evm_init: mmcsd0 mux setup failed:"
620                                         " %d\n", ret);
621
622                 ret = gpio_request(DA850_MMCSD_CD_PIN, "MMC CD\n");
623                 if (ret)
624                         pr_warning("da850_evm_init: can not open GPIO %d\n",
625                                         DA850_MMCSD_CD_PIN);
626                 gpio_direction_input(DA850_MMCSD_CD_PIN);
627
628                 ret = gpio_request(DA850_MMCSD_WP_PIN, "MMC WP\n");
629                 if (ret)
630                         pr_warning("da850_evm_init: can not open GPIO %d\n",
631                                         DA850_MMCSD_WP_PIN);
632                 gpio_direction_input(DA850_MMCSD_WP_PIN);
633
634                 ret = da8xx_register_mmcsd0(&da850_mmc_config);
635                 if (ret)
636                         pr_warning("da850_evm_init: mmcsd0 registration failed:"
637                                         " %d\n", ret);
638         }
639
640         davinci_serial_init(&da850_evm_uart_config);
641
642         i2c_register_board_info(1, da850_evm_i2c_devices,
643                         ARRAY_SIZE(da850_evm_i2c_devices));
644
645         /*
646          * shut down uart 0 and 1; they are not used on the board and
647          * accessing them causes endless "too much work in irq53" messages
648          * with arago fs
649          */
650         __raw_writel(0, IO_ADDRESS(DA8XX_UART1_BASE) + 0x30);
651         __raw_writel(0, IO_ADDRESS(DA8XX_UART0_BASE) + 0x30);
652
653         ret = da8xx_pinmux_setup(da850_mcasp_pins);
654         if (ret)
655                 pr_warning("da850_evm_init: mcasp mux setup failed: %d\n",
656                                 ret);
657
658         da8xx_register_mcasp(0, &da850_evm_snd_data);
659
660         ret = da8xx_pinmux_setup(da850_lcdcntl_pins);
661         if (ret)
662                 pr_warning("da850_evm_init: lcdcntl mux setup failed: %d\n",
663                                 ret);
664
665         /* Handle board specific muxing for LCD here */
666         ret = da8xx_pinmux_setup(da850_evm_lcdc_pins);
667         if (ret)
668                 pr_warning("da850_evm_init: evm specific lcd mux setup "
669                                 "failed: %d\n", ret);
670
671         ret = da850_lcd_hw_init();
672         if (ret)
673                 pr_warning("da850_evm_init: lcd initialization failed: %d\n",
674                                 ret);
675
676         ret = da8xx_register_lcdc(&sharp_lk043t1dg01_pdata);
677         if (ret)
678                 pr_warning("da850_evm_init: lcdc registration failed: %d\n",
679                                 ret);
680
681         ret = da8xx_register_rtc();
682         if (ret)
683                 pr_warning("da850_evm_init: rtc setup failed: %d\n", ret);
684
685         ret = da850_register_cpufreq();
686         if (ret)
687                 pr_warning("da850_evm_init: cpufreq registration failed: %d\n",
688                                 ret);
689 }
690
691 #ifdef CONFIG_SERIAL_8250_CONSOLE
692 static int __init da850_evm_console_init(void)
693 {
694         return add_preferred_console("ttyS", 2, "115200");
695 }
696 console_initcall(da850_evm_console_init);
697 #endif
698
699 static __init void da850_evm_irq_init(void)
700 {
701         struct davinci_soc_info *soc_info = &davinci_soc_info;
702
703         cp_intc_init((void __iomem *)DA8XX_CP_INTC_VIRT, DA850_N_CP_INTC_IRQ,
704                         soc_info->intc_irq_prios);
705 }
706
707 static void __init da850_evm_map_io(void)
708 {
709         da850_init();
710 }
711
712 MACHINE_START(DAVINCI_DA850_EVM, "DaVinci DA850/OMAP-L138 EVM")
713         .phys_io        = IO_PHYS,
714         .io_pg_offst    = (__IO_ADDRESS(IO_PHYS) >> 18) & 0xfffc,
715         .boot_params    = (DA8XX_DDR_BASE + 0x100),
716         .map_io         = da850_evm_map_io,
717         .init_irq       = da850_evm_irq_init,
718         .timer          = &davinci_timer,
719         .init_machine   = da850_evm_init,
720 MACHINE_END