Merge current mainline tree into linux-omap tree
[pandora-kernel.git] / arch / arm / mach-omap2 / board-omap3beagle.c
1 /*
2  * linux/arch/arm/mach-omap2/board-omap3beagle.c
3  *
4  * Copyright (C) 2008 Texas Instruments
5  *
6  * Modified from mach-omap2/board-3430sdp.c
7  *
8  * Initial code: Syed Mohammed Khasim
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13  */
14
15 #include <linux/kernel.h>
16 #include <linux/init.h>
17 #include <linux/platform_device.h>
18 #include <linux/delay.h>
19 #include <linux/err.h>
20 #include <linux/clk.h>
21 #include <linux/io.h>
22 #include <linux/leds.h>
23
24 #include <asm/hardware.h>
25 #include <asm/mach-types.h>
26 #include <asm/mach/arch.h>
27 #include <asm/mach/map.h>
28
29 #include <asm/arch/gpio.h>
30 #include <asm/arch/board.h>
31 #include <asm/arch/usb-musb.h>
32 #include <asm/arch/usb-ehci.h>
33 #include <asm/arch/hsmmc.h>
34 #include <asm/arch/common.h>
35
36 static struct omap_uart_config omap3_beagle_uart_config __initdata = {
37         .enabled_uarts  = ((1 << 0) | (1 << 1) | (1 << 2)),
38 };
39
40 static int __init omap3_beagle_i2c_init(void)
41 {
42         omap_register_i2c_bus(1, 2600, NULL, 0);
43         omap_register_i2c_bus(2, 400, NULL, 0);
44         omap_register_i2c_bus(3, 400, NULL, 0);
45         return 0;
46 }
47
48 static void __init omap3_beagle_init_irq(void)
49 {
50         omap2_init_common_hw();
51         omap_init_irq();
52         omap_gpio_init();
53 }
54
55 static struct omap_mmc_config omap3beagle_mmc_config __initdata = {
56         .mmc [0] = {
57                 .enabled        = 1,
58                 .wire4          = 1,
59         },
60 };
61
62 static struct platform_device omap3_beagle_twl4030rtc_device = {
63         .name           = "twl4030_rtc",
64         .id             = -1,
65 };
66
67 static struct platform_device omap3_beagle_lcd_device = {
68         .name           = "omap3beagle_lcd",
69         .id             = -1,
70 };
71
72 static struct omap_lcd_config omap3_beagle_lcd_config __initdata = {
73         .ctrl_name      = "internal",
74 };
75
76 struct gpio_led gpio_leds[] = {
77         {
78                 .name                   = "beagleboard::led0",
79                 .default_trigger        = "none",
80                 .gpio                   = 149,
81         },
82         {
83                 .name                   = "beagleboard::led1",
84                 .default_trigger        = "none",
85                 .gpio                   = 150,
86         },
87 };
88
89 static struct gpio_led_platform_data gpio_led_info = {
90         .leds           = gpio_leds,
91         .num_leds       = ARRAY_SIZE(gpio_leds),
92 };
93
94 static struct platform_device leds_gpio = {
95         .name   = "leds-gpio",
96         .id     = -1,
97         .dev    = {
98                 .platform_data  = &gpio_led_info,
99         },
100 };
101
102 static struct omap_board_config_kernel omap3_beagle_config[] __initdata = {
103         { OMAP_TAG_UART,        &omap3_beagle_uart_config },
104         { OMAP_TAG_MMC,         &omap3beagle_mmc_config },
105         { OMAP_TAG_LCD,         &omap3_beagle_lcd_config },
106 };
107
108 static struct platform_device *omap3_beagle_devices[] __initdata = {
109         &omap3_beagle_lcd_device,
110 #ifdef CONFIG_RTC_DRV_TWL4030
111         &omap3_beagle_twl4030rtc_device,
112 #endif
113         &leds_gpio,
114 };
115
116 static void __init omap3_beagle_init(void)
117 {
118         platform_add_devices(omap3_beagle_devices, ARRAY_SIZE(omap3_beagle_devices));
119         omap_board_config = omap3_beagle_config;
120         omap_board_config_size = ARRAY_SIZE(omap3_beagle_config);
121         omap_serial_init();
122         hsmmc_init();
123         usb_musb_init();
124         usb_ehci_init();
125 }
126
127 arch_initcall(omap3_beagle_i2c_init);
128
129 static void __init omap3_beagle_map_io(void)
130 {
131         omap2_set_globals_343x();
132         omap2_map_common_io();
133 }
134
135 MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
136         /* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */
137         .phys_io        = 0x48000000,
138         .io_pg_offst    = ((0xd8000000) >> 18) & 0xfffc,
139         .boot_params    = 0x80000100,
140         .map_io         = omap3_beagle_map_io,
141         .init_irq       = omap3_beagle_init_irq,
142         .init_machine   = omap3_beagle_init,
143         .timer          = &omap_timer,
144 MACHINE_END