Merge branch 'virtio' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux...
[pandora-kernel.git] / arch / arm / mach-msm / board-msm7x30.c
1 /* Copyright (c) 2009-2010, Code Aurora Forum. All rights reserved.
2  *
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License version 2 and
5  * only version 2 as published by the Free Software Foundation.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15  * 02110-1301, USA.
16  */
17
18 #include <linux/kernel.h>
19 #include <linux/irq.h>
20 #include <linux/gpio.h>
21 #include <linux/platform_device.h>
22 #include <linux/delay.h>
23 #include <linux/bootmem.h>
24 #include <linux/io.h>
25 #include <linux/smsc911x.h>
26
27 #include <asm/mach-types.h>
28 #include <asm/mach/arch.h>
29 #include <asm/setup.h>
30
31 #include <mach/gpio.h>
32 #include <mach/board.h>
33 #include <mach/memory.h>
34 #include <mach/msm_iomap.h>
35 #include <mach/dma.h>
36
37 #include <mach/vreg.h>
38 #include "devices.h"
39 #include "proc_comm.h"
40
41 extern struct sys_timer msm_timer;
42
43 #ifdef CONFIG_SERIAL_MSM_CONSOLE
44 static struct msm_gpio uart2_config_data[] = {
45         { GPIO_CFG(49, 2, GPIO_OUTPUT,  GPIO_PULL_DOWN, GPIO_2MA), "UART2_RFR"},
46         { GPIO_CFG(50, 2, GPIO_INPUT,   GPIO_PULL_DOWN, GPIO_2MA), "UART2_CTS"},
47         { GPIO_CFG(51, 2, GPIO_INPUT,   GPIO_PULL_DOWN, GPIO_2MA), "UART2_Rx"},
48         { GPIO_CFG(52, 2, GPIO_OUTPUT,  GPIO_PULL_DOWN, GPIO_2MA), "UART2_Tx"},
49 };
50
51 static void msm7x30_init_uart2(void)
52 {
53         msm_gpios_request_enable(uart2_config_data,
54                         ARRAY_SIZE(uart2_config_data));
55
56 }
57 #endif
58
59 static struct platform_device *devices[] __initdata = {
60 #if defined(CONFIG_SERIAL_MSM) || defined(CONFIG_MSM_SERIAL_DEBUGGER)
61         &msm_device_uart2,
62 #endif
63
64 };
65
66 static void __init msm7x30_init_irq(void)
67 {
68         msm_init_irq();
69 }
70
71 static void __init msm7x30_init(void)
72 {
73         platform_add_devices(devices, ARRAY_SIZE(devices));
74 #ifdef CONFIG_SERIAL_MSM_CONSOLE
75         msm7x30_init_uart2();
76 #endif
77
78 }
79
80 static void __init msm7x30_map_io(void)
81 {
82         msm_map_msm7x30_io();
83         msm_clock_init(msm_clocks_7x30, msm_num_clocks_7x30);
84 }
85
86 MACHINE_START(MSM7X30_SURF, "QCT MSM7X30 SURF")
87 #ifdef CONFIG_MSM_DEBUG_UART
88         .phys_io  = MSM_DEBUG_UART_PHYS,
89         .io_pg_offst = ((MSM_DEBUG_UART_BASE) >> 18) & 0xfffc,
90 #endif
91         .boot_params = PHYS_OFFSET + 0x100,
92         .map_io = msm7x30_map_io,
93         .init_irq = msm7x30_init_irq,
94         .init_machine = msm7x30_init,
95         .timer = &msm_timer,
96 MACHINE_END
97
98 MACHINE_START(MSM7X30_FFA, "QCT MSM7X30 FFA")
99 #ifdef CONFIG_MSM_DEBUG_UART
100         .phys_io  = MSM_DEBUG_UART_PHYS,
101         .io_pg_offst = ((MSM_DEBUG_UART_BASE) >> 18) & 0xfffc,
102 #endif
103         .boot_params = PHYS_OFFSET + 0x100,
104         .map_io = msm7x30_map_io,
105         .init_irq = msm7x30_init_irq,
106         .init_machine = msm7x30_init,
107         .timer = &msm_timer,
108 MACHINE_END
109
110 MACHINE_START(MSM7X30_FLUID, "QCT MSM7X30 FLUID")
111 #ifdef CONFIG_MSM_DEBUG_UART
112         .phys_io  = MSM_DEBUG_UART_PHYS,
113         .io_pg_offst = ((MSM_DEBUG_UART_BASE) >> 18) & 0xfffc,
114 #endif
115         .boot_params = PHYS_OFFSET + 0x100,
116         .map_io = msm7x30_map_io,
117         .init_irq = msm7x30_init_irq,
118         .init_machine = msm7x30_init,
119         .timer = &msm_timer,
120 MACHINE_END