Merge branch 'async-scsi-resume' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux.git] / arch / arm / mach-s3c24xx / mach-otom.c
1 /*
2  *
3  * Copyright (c) 2004 Nex Vision
4  *   Guillaume GOURAT <guillaume.gourat@nexvision.fr>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  */
10
11 #include <linux/kernel.h>
12 #include <linux/types.h>
13 #include <linux/interrupt.h>
14 #include <linux/list.h>
15 #include <linux/timer.h>
16 #include <linux/init.h>
17 #include <linux/serial_core.h>
18 #include <linux/serial_s3c.h>
19 #include <linux/platform_device.h>
20 #include <linux/io.h>
21
22 #include <linux/platform_data/i2c-s3c2410.h>
23
24 #include <asm/irq.h>
25 #include <asm/mach-types.h>
26 #include <asm/mach/arch.h>
27 #include <asm/mach/map.h>
28 #include <asm/mach/irq.h>
29
30 #include <mach/hardware.h>
31 #include <mach/regs-gpio.h>
32
33 #include <plat/clock.h>
34 #include <plat/cpu.h>
35 #include <plat/devs.h>
36 #include <plat/samsung-time.h>
37
38 #include "common.h"
39 #include "otom.h"
40
41 static struct map_desc otom11_iodesc[] __initdata = {
42   /* Device area */
43         { (u32)OTOM_VA_CS8900A_BASE, OTOM_PA_CS8900A_BASE, SZ_16M, MT_DEVICE },
44 };
45
46 #define UCON S3C2410_UCON_DEFAULT
47 #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
48 #define UFCON S3C2410_UFCON_RXTRIG12 | S3C2410_UFCON_FIFOMODE
49
50 static struct s3c2410_uartcfg otom11_uartcfgs[] __initdata = {
51         [0] = {
52                 .hwport      = 0,
53                 .flags       = 0,
54                 .ucon        = UCON,
55                 .ulcon       = ULCON,
56                 .ufcon       = UFCON,
57         },
58         [1] = {
59                 .hwport      = 1,
60                 .flags       = 0,
61                 .ucon        = UCON,
62                 .ulcon       = ULCON,
63                 .ufcon       = UFCON,
64         },
65         /* port 2 is not actually used */
66         [2] = {
67                 .hwport      = 2,
68                 .flags       = 0,
69                 .ucon        = UCON,
70                 .ulcon       = ULCON,
71                 .ufcon       = UFCON,
72         }
73 };
74
75 /* NOR Flash on NexVision OTOM board */
76
77 static struct resource otom_nor_resource[] = {
78         [0] = DEFINE_RES_MEM(S3C2410_CS0, SZ_4M),
79 };
80
81 static struct platform_device otom_device_nor = {
82         .name           = "mtd-flash",
83         .id             = -1,
84         .num_resources  = ARRAY_SIZE(otom_nor_resource),
85         .resource       = otom_nor_resource,
86 };
87
88 /* Standard OTOM devices */
89
90 static struct platform_device *otom11_devices[] __initdata = {
91         &s3c_device_ohci,
92         &s3c_device_lcd,
93         &s3c_device_wdt,
94         &s3c_device_i2c0,
95         &s3c_device_iis,
96         &s3c_device_rtc,
97         &otom_device_nor,
98 };
99
100 static void __init otom11_map_io(void)
101 {
102         s3c24xx_init_io(otom11_iodesc, ARRAY_SIZE(otom11_iodesc));
103         s3c24xx_init_clocks(0);
104         s3c24xx_init_uarts(otom11_uartcfgs, ARRAY_SIZE(otom11_uartcfgs));
105         samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
106 }
107
108 static void __init otom11_init(void)
109 {
110         s3c_i2c0_set_platdata(NULL);
111         platform_add_devices(otom11_devices, ARRAY_SIZE(otom11_devices));
112 }
113
114 MACHINE_START(OTOM, "Nex Vision - Otom 1.1")
115         /* Maintainer: Guillaume GOURAT <guillaume.gourat@nexvision.tv> */
116         .atag_offset    = 0x100,
117         .map_io         = otom11_map_io,
118         .init_machine   = otom11_init,
119         .init_irq       = s3c2410_init_irq,
120         .init_time      = samsung_timer_init,
121         .restart        = s3c2410_restart,
122 MACHINE_END