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/power_supply.h>
25 #include <mach/hardware.h>
26 #include <asm/mach-types.h>
27 #include <asm/mach/arch.h>
28 #include <asm/mach/map.h>
29 #include <asm/mach/flash.h>
30 #include <asm/setup.h>
31 #ifdef CONFIG_CACHE_L2X0
32 #include <asm/hardware/cache-l2x0.h>
35 #include <mach/vreg.h>
37 #include <mach/gpio.h>
38 #include <mach/board.h>
39 #include <mach/msm_iomap.h>
41 #include <linux/mtd/nand.h>
42 #include <linux/mtd/partitions.h>
48 static struct resource smc91x_resources[] = {
52 .flags = IORESOURCE_MEM,
55 .start = MSM_GPIO_TO_INT(132),
56 .end = MSM_GPIO_TO_INT(132),
57 .flags = IORESOURCE_IRQ,
61 static struct platform_device smc91x_device = {
64 .num_resources = ARRAY_SIZE(smc91x_resources),
65 .resource = smc91x_resources,
68 static struct platform_device *devices[] __initdata = {
76 extern struct sys_timer msm_timer;
78 static void __init msm7x2x_init_irq(void)
83 static void __init msm7x2x_init(void)
85 if (socinfo_init() < 0)
88 if (machine_is_msm7x25_ffa() || machine_is_msm7x27_ffa()) {
89 smc91x_resources[0].start = 0x98000300;
90 smc91x_resources[0].end = 0x980003ff;
91 smc91x_resources[1].start = MSM_GPIO_TO_INT(85);
92 smc91x_resources[1].end = MSM_GPIO_TO_INT(85);
93 if (gpio_tlmm_config(GPIO_CFG(85, 0,
99 "%s: Err: Config GPIO-85 INT\n",
104 platform_add_devices(devices, ARRAY_SIZE(devices));
107 static void __init msm7x2x_map_io(void)
110 /* Technically dependent on the SoC but using machine_is
111 * macros since socinfo is not available this early and there
112 * are plans to restructure the code which will eliminate the
115 if (machine_is_msm7x27_surf() || machine_is_msm7x27_ffa())
116 msm_clock_init(msm_clocks_7x27, msm_num_clocks_7x27);
118 if (machine_is_msm7x25_surf() || machine_is_msm7x25_ffa())
119 msm_clock_init(msm_clocks_7x25, msm_num_clocks_7x25);
121 #ifdef CONFIG_CACHE_L2X0
122 if (machine_is_msm7x27_surf() || machine_is_msm7x27_ffa()) {
123 /* 7x27 has 256KB L2 cache:
124 64Kb/Way and 4-Way Associativity;
125 R/W latency: 3 cycles;
126 evmon/parity/share disabled. */
127 l2x0_init(MSM_L2CC_BASE, 0x00068012, 0xfe000000);
132 MACHINE_START(MSM7X27_SURF, "QCT MSM7x27 SURF")
133 #ifdef CONFIG_MSM_DEBUG_UART
135 .boot_params = PHYS_OFFSET + 0x100,
136 .map_io = msm7x2x_map_io,
137 .init_irq = msm7x2x_init_irq,
138 .init_machine = msm7x2x_init,
142 MACHINE_START(MSM7X27_FFA, "QCT MSM7x27 FFA")
143 #ifdef CONFIG_MSM_DEBUG_UART
145 .boot_params = PHYS_OFFSET + 0x100,
146 .map_io = msm7x2x_map_io,
147 .init_irq = msm7x2x_init_irq,
148 .init_machine = msm7x2x_init,
152 MACHINE_START(MSM7X25_SURF, "QCT MSM7x25 SURF")
153 #ifdef CONFIG_MSM_DEBUG_UART
155 .boot_params = PHYS_OFFSET + 0x100,
156 .map_io = msm7x2x_map_io,
157 .init_irq = msm7x2x_init_irq,
158 .init_machine = msm7x2x_init,
162 MACHINE_START(MSM7X25_FFA, "QCT MSM7x25 FFA")
163 #ifdef CONFIG_MSM_DEBUG_UART
165 .boot_params = PHYS_OFFSET + 0x100,
166 .map_io = msm7x2x_map_io,
167 .init_irq = msm7x2x_init_irq,
168 .init_machine = msm7x2x_init,