blob: 6ce542e2e21ca485cc803b38f12154a8bc7d835a [file] [log] [blame]
Brian Swetland9e73c842007-11-26 04:12:13 -08001/* linux/arch/arm/mach-msm/board-halibut.c
2 *
3 * Copyright (C) 2007 Google, Inc.
4 * Author: Brian Swetland <swetland@google.com>
5 *
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.
9 *
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.
14 *
15 */
16
17#include <linux/kernel.h>
18#include <linux/init.h>
19#include <linux/platform_device.h>
20#include <linux/input.h>
Russell Kingfced80c2008-09-06 12:10:45 +010021#include <linux/io.h>
22#include <linux/delay.h>
Brian Swetland9e73c842007-11-26 04:12:13 -080023
Russell Kinga09e64f2008-08-05 16:14:15 +010024#include <mach/hardware.h>
Brian Swetland9e73c842007-11-26 04:12:13 -080025#include <asm/mach-types.h>
26#include <asm/mach/arch.h>
27#include <asm/mach/map.h>
28#include <asm/mach/flash.h>
Arve Hjønnevåg6bd631e2008-10-29 21:45:46 -070029#include <asm/setup.h>
Brian Swetland9e73c842007-11-26 04:12:13 -080030
Russell King9ce8bb52009-01-27 22:44:12 +000031#include <mach/irqs.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010032#include <mach/board.h>
33#include <mach/msm_iomap.h>
Brian Swetland9e73c842007-11-26 04:12:13 -080034
Brian Swetland9e73c842007-11-26 04:12:13 -080035#include <linux/mtd/nand.h>
36#include <linux/mtd/partitions.h>
37
Brian Swetlandbcc0f6a2008-09-10 14:00:53 -070038#include "devices.h"
Stephen Boyd4312a7e2012-09-05 12:28:52 -070039#include "common.h"
Brian Swetlandbcc0f6a2008-09-10 14:00:53 -070040
Brian Swetland9e73c842007-11-26 04:12:13 -080041static struct resource smc91x_resources[] = {
42 [0] = {
43 .start = 0x9C004300,
44 .end = 0x9C004400,
45 .flags = IORESOURCE_MEM,
46 },
47 [1] = {
48 .start = MSM_GPIO_TO_INT(49),
49 .end = MSM_GPIO_TO_INT(49),
50 .flags = IORESOURCE_IRQ,
51 },
52};
53
54static struct platform_device smc91x_device = {
55 .name = "smc91x",
56 .id = 0,
57 .num_resources = ARRAY_SIZE(smc91x_resources),
58 .resource = smc91x_resources,
59};
60
Brian Swetland9e73c842007-11-26 04:12:13 -080061static struct platform_device *devices[] __initdata = {
Brian Swetlandbcc0f6a2008-09-10 14:00:53 -070062 &msm_device_uart3,
63 &msm_device_smd,
64 &msm_device_nand,
65 &msm_device_hsusb,
66 &msm_device_i2c,
Brian Swetland9e73c842007-11-26 04:12:13 -080067 &smc91x_device,
68};
69
Rob Herringb12e9ba2012-02-13 13:27:24 -060070static void __init halibut_init_early(void)
71{
72 arch_ioremap_caller = __msm_ioremap_caller;
73}
74
Brian Swetland9e73c842007-11-26 04:12:13 -080075static void __init halibut_init_irq(void)
76{
77 msm_init_irq();
78}
79
80static void __init halibut_init(void)
81{
82 platform_add_devices(devices, ARRAY_SIZE(devices));
Brian Swetland9e73c842007-11-26 04:12:13 -080083}
84
Russell King0744a3e2010-12-20 10:37:50 +000085static void __init halibut_fixup(struct tag *tags, char **cmdline,
86 struct meminfo *mi)
Arve Hjønnevåg6bd631e2008-10-29 21:45:46 -070087{
Arve Hjønnevåg6bd631e2008-10-29 21:45:46 -070088}
89
Brian Swetland9e73c842007-11-26 04:12:13 -080090static void __init halibut_map_io(void)
91{
92 msm_map_common_io();
Daniel Walker5e96da52010-05-12 13:43:28 -070093 msm_clock_init(msm_clocks_7x01a, msm_num_clocks_7x01a);
Brian Swetland9e73c842007-11-26 04:12:13 -080094}
95
Shawn Guoc633c532012-05-02 15:53:20 +080096static void __init halibut_init_late(void)
97{
98 smd_debugfs_init();
99}
100
Brian Swetland9e73c842007-11-26 04:12:13 -0800101MACHINE_START(HALIBUT, "Halibut Board (QCT SURF7200A)")
Nicolas Pitref631dd42011-07-05 22:38:14 -0400102 .atag_offset = 0x100,
Arve Hjønnevåg6bd631e2008-10-29 21:45:46 -0700103 .fixup = halibut_fixup,
Brian Swetland9e73c842007-11-26 04:12:13 -0800104 .map_io = halibut_map_io,
Rob Herringb12e9ba2012-02-13 13:27:24 -0600105 .init_early = halibut_init_early,
Brian Swetland9e73c842007-11-26 04:12:13 -0800106 .init_irq = halibut_init_irq,
107 .init_machine = halibut_init,
Shawn Guoc633c532012-05-02 15:53:20 +0800108 .init_late = halibut_init_late,
Stephen Boyd4312a7e2012-09-05 12:28:52 -0700109 .timer = &msm7x01_timer,
Brian Swetland9e73c842007-11-26 04:12:13 -0800110MACHINE_END