Pull hp-pci-root into test branch
[linux-2.6] / arch / arm / mach-s3c2410 / mach-vstms.c
1 /* linux/arch/arm/mach-s3c2410/mach-vstms.c
2  *
3  * (C) 2006 Thomas Gleixner <tglx@linutronix.de>
4  *
5  * Derived from mach-smdk2413.c - (C) 2006 Simtec Electronics
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 2 as
9  * published by the Free Software Foundation.
10  */
11
12 #include <linux/kernel.h>
13 #include <linux/types.h>
14 #include <linux/interrupt.h>
15 #include <linux/list.h>
16 #include <linux/timer.h>
17 #include <linux/init.h>
18 #include <linux/serial_core.h>
19 #include <linux/platform_device.h>
20
21 #include <linux/mtd/mtd.h>
22 #include <linux/mtd/nand.h>
23 #include <linux/mtd/nand_ecc.h>
24 #include <linux/mtd/partitions.h>
25
26 #include <asm/mach/arch.h>
27 #include <asm/mach/map.h>
28 #include <asm/mach/irq.h>
29
30 #include <asm/hardware.h>
31 #include <asm/hardware/iomd.h>
32 #include <asm/setup.h>
33 #include <asm/io.h>
34 #include <asm/irq.h>
35 #include <asm/mach-types.h>
36
37 #include <asm/arch/regs-serial.h>
38 #include <asm/arch/regs-gpio.h>
39 #include <asm/arch/regs-lcd.h>
40
41 #include <asm/arch/idle.h>
42 #include <asm/arch/fb.h>
43
44 #include <asm/arch/nand.h>
45
46 #include "s3c2410.h"
47 #include "s3c2412.h"
48 #include "clock.h"
49 #include "devs.h"
50 #include "cpu.h"
51
52
53 static struct map_desc vstms_iodesc[] __initdata = {
54 };
55
56 static struct s3c2410_uartcfg vstms_uartcfgs[] __initdata = {
57         [0] = {
58                 .hwport      = 0,
59                 .flags       = 0,
60                 .ucon        = 0x3c5,
61                 .ulcon       = 0x03,
62                 .ufcon       = 0x51,
63         },
64         [1] = {
65                 .hwport      = 1,
66                 .flags       = 0,
67                 .ucon        = 0x3c5,
68                 .ulcon       = 0x03,
69                 .ufcon       = 0x51,
70         },
71         [2] = {
72                 .hwport      = 2,
73                 .flags       = 0,
74                 .ucon        = 0x3c5,
75                 .ulcon       = 0x03,
76                 .ufcon       = 0x51,
77         }
78 };
79
80 static struct mtd_partition vstms_nand_part[] = {
81         [0] = {
82                 .name   = "Boot Agent",
83                 .size   = 0x7C000,
84                 .offset = 0,
85         },
86         [1] = {
87                 .name   = "UBoot Config",
88                 .offset = 0x7C000,
89                 .size   = 0x4000,
90         },
91         [2] = {
92                 .name   = "Kernel",
93                 .offset = 0x80000,
94                 .size   = 0x200000,
95         },
96         [3] = {
97                 .name   = "RFS",
98                 .offset = 0x280000,
99                 .size   = 0x3d80000,
100         },
101 };
102
103 static struct s3c2410_nand_set vstms_nand_sets[] = {
104         [0] = {
105                 .name           = "NAND",
106                 .nr_chips       = 1,
107                 .nr_partitions  = ARRAY_SIZE(vstms_nand_part),
108                 .partitions     = vstms_nand_part,
109         },
110 };
111
112 /* choose a set of timings which should suit most 512Mbit
113  * chips and beyond.
114 */
115
116 static struct s3c2410_platform_nand vstms_nand_info = {
117         .tacls          = 20,
118         .twrph0         = 60,
119         .twrph1         = 20,
120         .nr_sets        = ARRAY_SIZE(vstms_nand_sets),
121         .sets           = vstms_nand_sets,
122 };
123
124 static struct platform_device *vstms_devices[] __initdata = {
125         &s3c_device_usb,
126         &s3c_device_wdt,
127         &s3c_device_i2c,
128         &s3c_device_iis,
129         &s3c_device_rtc,
130         &s3c_device_nand,
131 };
132
133 static struct s3c24xx_board vstms_board __initdata = {
134         .devices       = vstms_devices,
135         .devices_count = ARRAY_SIZE(vstms_devices)
136 };
137
138 static void __init vstms_fixup(struct machine_desc *desc,
139                                   struct tag *tags, char **cmdline,
140                                   struct meminfo *mi)
141 {
142         if (tags != phys_to_virt(S3C2410_SDRAM_PA + 0x100)) {
143                 mi->nr_banks=1;
144                 mi->bank[0].start = 0x30000000;
145                 mi->bank[0].size = SZ_64M;
146                 mi->bank[0].node = 0;
147         }
148 }
149
150 static void __init vstms_map_io(void)
151 {
152         s3c_device_nand.dev.platform_data = &vstms_nand_info;
153
154         s3c24xx_init_io(vstms_iodesc, ARRAY_SIZE(vstms_iodesc));
155         s3c24xx_init_clocks(12000000);
156         s3c24xx_init_uarts(vstms_uartcfgs, ARRAY_SIZE(vstms_uartcfgs));
157         s3c24xx_set_board(&vstms_board);
158 }
159
160 MACHINE_START(VSTMS, "VSTMS")
161         .phys_io        = S3C2410_PA_UART,
162         .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
163         .boot_params    = S3C2410_SDRAM_PA + 0x100,
164
165         .fixup          = vstms_fixup,
166         .init_irq       = s3c24xx_init_irq,
167         .map_io         = vstms_map_io,
168         .timer          = &s3c24xx_timer,
169 MACHINE_END