1 /* linux/arch/arm/mach-msm/board-sapphire.c
2 * Copyright (C) 2007-2009 HTC Corporation.
3 * Author: Thomas Tsai <thomas_tsai@htc.com>
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 #include <linux/gpio.h>
15 #include <linux/kernel.h>
16 #include <linux/init.h>
17 #include <linux/platform_device.h>
18 #include <linux/input.h>
19 #include <linux/interrupt.h>
20 #include <linux/irq.h>
21 #include <linux/device.h>
23 #include <linux/delay.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 <mach/system.h>
31 #include <mach/vreg.h>
32 #include <mach/board.h>
35 #include <asm/delay.h>
36 #include <asm/setup.h>
38 #include <linux/mtd/nand.h>
39 #include <linux/mtd/partitions.h>
41 #include "gpio_chip.h"
42 #include "board-sapphire.h"
43 #include "proc_comm.h"
46 void msm_init_irq(void);
47 void msm_init_gpio(void);
49 static struct platform_device *devices[] __initdata = {
57 extern struct sys_timer msm_timer;
59 static void __init sapphire_init_irq(void)
64 static void __init sapphire_init(void)
66 platform_add_devices(devices, ARRAY_SIZE(devices));
69 static struct map_desc sapphire_io_desc[] __initdata = {
71 .virtual = SAPPHIRE_CPLD_BASE,
72 .pfn = __phys_to_pfn(SAPPHIRE_CPLD_START),
73 .length = SAPPHIRE_CPLD_SIZE,
74 .type = MT_DEVICE_NONSHARED
78 static void __init sapphire_fixup(struct tag *tags, char **cmdline,
81 int smi_sz = parse_tag_smi((const struct tag *)tags);
84 mi->bank[0].start = PHYS_OFFSET;
85 mi->bank[0].node = PHYS_TO_NID(PHYS_OFFSET);
87 mi->bank[0].size = (84*1024*1024);
88 } else if (smi_sz == 64) {
89 mi->bank[0].size = (101*1024*1024);
91 /* Give a default value when not get smi size */
93 mi->bank[0].size = (101*1024*1024);
97 static void __init sapphire_map_io(void)
100 iotable_init(sapphire_io_desc, ARRAY_SIZE(sapphire_io_desc));
104 static void __init sapphire_init_late(void)
109 MACHINE_START(SAPPHIRE, "sapphire")
110 /* Maintainer: Brian Swetland <swetland@google.com> */
111 .atag_offset = 0x100,
112 .fixup = sapphire_fixup,
113 .map_io = sapphire_map_io,
114 .init_irq = sapphire_init_irq,
115 .init_machine = sapphire_init,
116 .init_late = sapphire_init_late,