blob: e3cc80792d6c2bafbcb9bb68ce9505434d71c176 [file] [log] [blame]
Daniel Walkera32d2fe2010-02-25 11:38:39 -08001/* Copyright (c) 2008-2009, 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>
Daniel Walkera32d2fe2010-02-25 11:38:39 -080022#include <linux/delay.h>
23
24#include <asm/mach-types.h>
25#include <asm/mach/arch.h>
26#include <asm/io.h>
27#include <asm/setup.h>
28
Daniel Walkera32d2fe2010-02-25 11:38:39 -080029#include <mach/board.h>
Daniel Walkerd1c0d432010-05-05 07:17:31 -070030#include <mach/irqs.h>
31#include <mach/sirc.h>
32#include <mach/gpio.h>
Daniel Walkera32d2fe2010-02-25 11:38:39 -080033
34#include "devices.h"
Daniel Walkera32d2fe2010-02-25 11:38:39 -080035
Daniel Walkerd1c0d432010-05-05 07:17:31 -070036extern struct sys_timer msm_timer;
Daniel Walkera32d2fe2010-02-25 11:38:39 -080037
Daniel Walkerd1c0d432010-05-05 07:17:31 -070038static struct msm_gpio uart3_config_data[] = {
39 { GPIO_CFG(86, 1, GPIO_INPUT, GPIO_PULL_DOWN, GPIO_2MA), "UART2_Rx"},
40 { GPIO_CFG(87, 1, GPIO_OUTPUT, GPIO_PULL_DOWN, GPIO_2MA), "UART2_Tx"},
Daniel Walkera32d2fe2010-02-25 11:38:39 -080041};
42
43static struct platform_device *devices[] __initdata = {
Daniel Walkerd1c0d432010-05-05 07:17:31 -070044 &msm_device_uart3,
Daniel Walkera32d2fe2010-02-25 11:38:39 -080045};
46
Daniel Walkerd1c0d432010-05-05 07:17:31 -070047static void msm8x50_init_uart3(void)
Daniel Walkera32d2fe2010-02-25 11:38:39 -080048{
Daniel Walkerd1c0d432010-05-05 07:17:31 -070049 msm_gpios_request_enable(uart3_config_data,
50 ARRAY_SIZE(uart3_config_data));
Daniel Walkera32d2fe2010-02-25 11:38:39 -080051}
52
53static void __init qsd8x50_map_io(void)
54{
Daniel Walkera32d2fe2010-02-25 11:38:39 -080055 msm_map_qsd8x50_io();
56 msm_clock_init(msm_clocks_8x50, msm_num_clocks_8x50);
57}
58
Daniel Walkerd1c0d432010-05-05 07:17:31 -070059static void __init qsd8x50_init_irq(void)
60{
61 msm_init_irq();
62 msm_init_sirc();
63}
64
65static void __init qsd8x50_init(void)
66{
67 msm8x50_init_uart3();
68 platform_add_devices(devices, ARRAY_SIZE(devices));
69}
70
Daniel Walkera32d2fe2010-02-25 11:38:39 -080071MACHINE_START(QSD8X50_SURF, "QCT QSD8X50 SURF")
72#ifdef CONFIG_MSM_DEBUG_UART
73 .phys_io = MSM_DEBUG_UART_PHYS,
74 .io_pg_offst = ((MSM_DEBUG_UART_BASE) >> 18) & 0xfffc,
75#endif
76 .boot_params = PHYS_OFFSET + 0x100,
77 .map_io = qsd8x50_map_io,
78 .init_irq = qsd8x50_init_irq,
79 .init_machine = qsd8x50_init,
80 .timer = &msm_timer,
81MACHINE_END
82
Daniel Walkerd1c0d432010-05-05 07:17:31 -070083MACHINE_START(QSD8X50A_ST1_5, "QCT QSD8X50A ST1.5")
Daniel Walkera32d2fe2010-02-25 11:38:39 -080084#ifdef CONFIG_MSM_DEBUG_UART
85 .phys_io = MSM_DEBUG_UART_PHYS,
86 .io_pg_offst = ((MSM_DEBUG_UART_BASE) >> 18) & 0xfffc,
87#endif
88 .boot_params = PHYS_OFFSET + 0x100,
89 .map_io = qsd8x50_map_io,
90 .init_irq = qsd8x50_init_irq,
91 .init_machine = qsd8x50_init,
92 .timer = &msm_timer,
93MACHINE_END