2 * Copyright (C) 2007 Google, Inc.
3 * Copyright (c) 2008-2009, Code Aurora Forum. All rights reserved.
4 * Author: Brian Swetland <swetland@google.com>
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
17 #include <linux/kernel.h>
18 #include <linux/init.h>
19 #include <linux/platform_device.h>
20 #include <linux/input.h>
22 #include <linux/delay.h>
23 #include <linux/bootmem.h>
24 #include <linux/power_supply.h>
26 #include <mach/hardware.h>
27 #include <asm/mach-types.h>
28 #include <asm/mach/arch.h>
29 #include <asm/mach/map.h>
30 #include <asm/mach/flash.h>
31 #include <asm/setup.h>
32 #ifdef CONFIG_CACHE_L2X0
33 #include <asm/hardware/cache-l2x0.h>
36 #include <mach/vreg.h>
38 #include <mach/gpio.h>
39 #include <mach/board.h>
40 #include <mach/msm_iomap.h>
42 #include <linux/mtd/nand.h>
43 #include <linux/mtd/partitions.h>
49 static struct resource smc91x_resources[] = {
53 .flags = IORESOURCE_MEM,
56 .start = MSM_GPIO_TO_INT(132),
57 .end = MSM_GPIO_TO_INT(132),
58 .flags = IORESOURCE_IRQ,
62 static struct platform_device smc91x_device = {
65 .num_resources = ARRAY_SIZE(smc91x_resources),
66 .resource = smc91x_resources,
69 static struct platform_device *devices[] __initdata = {
77 extern struct sys_timer msm_timer;
79 static void __init msm7x2x_init_irq(void)
84 static void __init msm7x2x_init(void)
86 if (socinfo_init() < 0)
89 if (machine_is_msm7x25_ffa() || machine_is_msm7x27_ffa()) {
90 smc91x_resources[0].start = 0x98000300;
91 smc91x_resources[0].end = 0x980003ff;
92 smc91x_resources[1].start = MSM_GPIO_TO_INT(85);
93 smc91x_resources[1].end = MSM_GPIO_TO_INT(85);
94 if (gpio_tlmm_config(GPIO_CFG(85, 0,
100 "%s: Err: Config GPIO-85 INT\n",
105 platform_add_devices(devices, ARRAY_SIZE(devices));
108 static void __init msm7x2x_map_io(void)
111 /* Technically dependent on the SoC but using machine_is
112 * macros since socinfo is not available this early and there
113 * are plans to restructure the code which will eliminate the
116 if (machine_is_msm7x27_surf() || machine_is_msm7x27_ffa())
117 msm_clock_init(msm_clocks_7x27, msm_num_clocks_7x27);
119 if (machine_is_msm7x25_surf() || machine_is_msm7x25_ffa())
120 msm_clock_init(msm_clocks_7x25, msm_num_clocks_7x25);
122 #ifdef CONFIG_CACHE_L2X0
123 if (machine_is_msm7x27_surf() || machine_is_msm7x27_ffa()) {
124 /* 7x27 has 256KB L2 cache:
125 64Kb/Way and 4-Way Associativity;
126 R/W latency: 3 cycles;
127 evmon/parity/share disabled. */
128 l2x0_init(MSM_L2CC_BASE, 0x00068012, 0xfe000000);
133 MACHINE_START(MSM7X27_SURF, "QCT MSM7x27 SURF")
134 #ifdef CONFIG_MSM_DEBUG_UART
135 .phys_io = MSM_DEBUG_UART_PHYS,
136 .io_pg_offst = ((MSM_DEBUG_UART_BASE) >> 18) & 0xfffc,
138 .boot_params = PHYS_OFFSET + 0x100,
139 .map_io = msm7x2x_map_io,
140 .init_irq = msm7x2x_init_irq,
141 .init_machine = msm7x2x_init,
145 MACHINE_START(MSM7X27_FFA, "QCT MSM7x27 FFA")
146 #ifdef CONFIG_MSM_DEBUG_UART
147 .phys_io = MSM_DEBUG_UART_PHYS,
148 .io_pg_offst = ((MSM_DEBUG_UART_BASE) >> 18) & 0xfffc,
150 .boot_params = PHYS_OFFSET + 0x100,
151 .map_io = msm7x2x_map_io,
152 .init_irq = msm7x2x_init_irq,
153 .init_machine = msm7x2x_init,
157 MACHINE_START(MSM7X25_SURF, "QCT MSM7x25 SURF")
158 #ifdef CONFIG_MSM_DEBUG_UART
159 .phys_io = MSM_DEBUG_UART_PHYS,
160 .io_pg_offst = ((MSM_DEBUG_UART_BASE) >> 18) & 0xfffc,
162 .boot_params = PHYS_OFFSET + 0x100,
163 .map_io = msm7x2x_map_io,
164 .init_irq = msm7x2x_init_irq,
165 .init_machine = msm7x2x_init,
169 MACHINE_START(MSM7X25_FFA, "QCT MSM7x25 FFA")
170 #ifdef CONFIG_MSM_DEBUG_UART
171 .phys_io = MSM_DEBUG_UART_PHYS,
172 .io_pg_offst = ((MSM_DEBUG_UART_BASE) >> 18) & 0xfffc,
174 .boot_params = PHYS_OFFSET + 0x100,
175 .map_io = msm7x2x_map_io,
176 .init_irq = msm7x2x_init_irq,
177 .init_machine = msm7x2x_init,