blob: 97b8191d9d385951efbc387550e3c9e606e96b81 [file] [log] [blame]
Daniel Walker614ad982010-02-24 15:44:51 -08001/* linux/arch/arm/mach-msm/board-sapphire.c
2 * Copyright (C) 2007-2009 HTC Corporation.
3 * Author: Thomas Tsai <thomas_tsai@htc.com>
4 *
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.
8 *
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.
13*/
Russell King2f8163b2011-07-26 10:53:52 +010014#include <linux/gpio.h>
Daniel Walker614ad982010-02-24 15:44:51 -080015#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>
Kay Sieversedbaa602011-12-21 16:26:03 -080021#include <linux/device.h>
Daniel Walker614ad982010-02-24 15:44:51 -080022
23#include <linux/delay.h>
24
Daniel Walker614ad982010-02-24 15:44:51 -080025#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/system.h>
31#include <mach/system.h>
32#include <mach/vreg.h>
33#include <mach/board.h>
34
35#include <asm/io.h>
36#include <asm/delay.h>
37#include <asm/setup.h>
38
39#include <linux/mtd/nand.h>
40#include <linux/mtd/partitions.h>
41
42#include "gpio_chip.h"
43#include "board-sapphire.h"
44#include "proc_comm.h"
45#include "devices.h"
46
47void msm_init_irq(void);
48void msm_init_gpio(void);
49
50static struct platform_device *devices[] __initdata = {
51 &msm_device_smd,
52 &msm_device_dmov,
53 &msm_device_nand,
54 &msm_device_uart1,
55 &msm_device_uart3,
56};
57
58extern struct sys_timer msm_timer;
59
60static void __init sapphire_init_irq(void)
61{
62 msm_init_irq();
63}
64
65static void __init sapphire_init(void)
66{
67 platform_add_devices(devices, ARRAY_SIZE(devices));
68}
69
70static struct map_desc sapphire_io_desc[] __initdata = {
71 {
72 .virtual = SAPPHIRE_CPLD_BASE,
73 .pfn = __phys_to_pfn(SAPPHIRE_CPLD_START),
74 .length = SAPPHIRE_CPLD_SIZE,
75 .type = MT_DEVICE_NONSHARED
76 }
77};
78
Russell King0744a3e2010-12-20 10:37:50 +000079static void __init sapphire_fixup(struct tag *tags, char **cmdline,
80 struct meminfo *mi)
Daniel Walker614ad982010-02-24 15:44:51 -080081{
82 int smi_sz = parse_tag_smi((const struct tag *)tags);
83
84 mi->nr_banks = 1;
85 mi->bank[0].start = PHYS_OFFSET;
86 mi->bank[0].node = PHYS_TO_NID(PHYS_OFFSET);
87 if (smi_sz == 32) {
88 mi->bank[0].size = (84*1024*1024);
89 } else if (smi_sz == 64) {
90 mi->bank[0].size = (101*1024*1024);
91 } else {
92 /* Give a default value when not get smi size */
93 smi_sz = 64;
94 mi->bank[0].size = (101*1024*1024);
95 }
96}
97
98static void __init sapphire_map_io(void)
99{
100 msm_map_common_io();
101 iotable_init(sapphire_io_desc, ARRAY_SIZE(sapphire_io_desc));
102 msm_clock_init();
103}
104
105MACHINE_START(SAPPHIRE, "sapphire")
106/* Maintainer: Brian Swetland <swetland@google.com> */
Nicolas Pitref631dd42011-07-05 22:38:14 -0400107 .atag_offset = 0x100,
Daniel Walker614ad982010-02-24 15:44:51 -0800108 .fixup = sapphire_fixup,
109 .map_io = sapphire_map_io,
110 .init_irq = sapphire_init_irq,
111 .init_machine = sapphire_init,
112 .timer = &msm_timer,
113MACHINE_END