blob: bac1f3c38a3b897c8be6ad33b72dc39ee94be7f3 [file] [log] [blame]
Daniel Walker8d747cd2010-02-25 11:37:43 -08001/* 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>
Daniel Walker8d747cd2010-02-25 11:37:43 -080033#include <mach/memory.h>
34#include <mach/msm_iomap.h>
Daniel Walker8d747cd2010-02-25 11:37:43 -080035#include <mach/dma.h>
36
37#include <mach/vreg.h>
Daniel Walker8d747cd2010-02-25 11:37:43 -080038#include "devices.h"
Daniel Walker90e37c52010-05-12 14:24:15 -070039#include "proc_comm.h"
Daniel Walker8d747cd2010-02-25 11:37:43 -080040
Daniel Walker90e37c52010-05-12 14:24:15 -070041extern struct sys_timer msm_timer;
42
43#ifdef CONFIG_SERIAL_MSM_CONSOLE
44static 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"},
Daniel Walker8d747cd2010-02-25 11:37:43 -080049};
50
Daniel Walker90e37c52010-05-12 14:24:15 -070051static void msm7x30_init_uart2(void)
Daniel Walker8d747cd2010-02-25 11:37:43 -080052{
Daniel Walker90e37c52010-05-12 14:24:15 -070053 msm_gpios_request_enable(uart2_config_data,
54 ARRAY_SIZE(uart2_config_data));
Daniel Walker8d747cd2010-02-25 11:37:43 -080055
Daniel Walker8d747cd2010-02-25 11:37:43 -080056}
Daniel Walker90e37c52010-05-12 14:24:15 -070057#endif
Daniel Walker8d747cd2010-02-25 11:37:43 -080058
59static struct platform_device *devices[] __initdata = {
Daniel Walker90e37c52010-05-12 14:24:15 -070060#if defined(CONFIG_SERIAL_MSM) || defined(CONFIG_MSM_SERIAL_DEBUGGER)
61 &msm_device_uart2,
62#endif
63
Daniel Walker8d747cd2010-02-25 11:37:43 -080064};
65
66static void __init msm7x30_init_irq(void)
67{
68 msm_init_irq();
69}
70
Daniel Walker8d747cd2010-02-25 11:37:43 -080071static void __init msm7x30_init(void)
72{
Daniel Walker8d747cd2010-02-25 11:37:43 -080073 platform_add_devices(devices, ARRAY_SIZE(devices));
Daniel Walker90e37c52010-05-12 14:24:15 -070074#ifdef CONFIG_SERIAL_MSM_CONSOLE
75 msm7x30_init_uart2();
76#endif
77
Daniel Walker8d747cd2010-02-25 11:37:43 -080078}
79
80static void __init msm7x30_map_io(void)
81{
Daniel Walker8d747cd2010-02-25 11:37:43 -080082 msm_map_msm7x30_io();
Daniel Walker8d747cd2010-02-25 11:37:43 -080083 msm_clock_init(msm_clocks_7x30, msm_num_clocks_7x30);
84}
85
86MACHINE_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,
96MACHINE_END
97
98MACHINE_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,
108MACHINE_END
109
110MACHINE_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,
120MACHINE_END