vserver 1.9.3
[linux-2.6.git] / arch / arm / mach-s3c2410 / mach-h1940.c
1 /* linux/arch/arm/mach-s3c2410/mach-h1940.c
2  *
3  * Copyright (c) 2003,2004 Simtec Electronics
4  *   Ben Dooks <ben@simtec.co.uk>
5  *
6  * http://www.handhelds.org/projects/h1940.html
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License version 2 as
10  * published by the Free Software Foundation.
11  *
12  * Modifications:
13  *     16-May-2003 BJD  Created initial version
14  *     16-Aug-2003 BJD  Fixed header files and copyright, added URL
15  *     05-Sep-2003 BJD  Moved to v2.6 kernel
16  *     06-Jan-2003 BJD  Updates for <arch/map.h>
17  *     18-Jan-2003 BJD  Added serial port configuration
18  *     17-Feb-2003 BJD  Copied to mach-ipaq.c
19  *     21-Aug-2004 BJD  Added struct s3c2410_board
20  *     04-Sep-2004 BJD  Changed uart init, renamed ipaq_ -> h1940_
21 */
22
23 #include <linux/kernel.h>
24 #include <linux/types.h>
25 #include <linux/interrupt.h>
26 #include <linux/list.h>
27 #include <linux/timer.h>
28 #include <linux/init.h>
29
30 #include <asm/mach/arch.h>
31 #include <asm/mach/map.h>
32 #include <asm/mach/irq.h>
33
34 #include <asm/hardware.h>
35 #include <asm/hardware/iomd.h>
36 #include <asm/io.h>
37 #include <asm/irq.h>
38 #include <asm/mach-types.h>
39
40 //#include <asm/debug-ll.h>
41 #include <asm/arch/regs-serial.h>
42
43 #include "s3c2410.h"
44 #include "devs.h"
45 #include "cpu.h"
46
47 static struct map_desc h1940_iodesc[] __initdata = {
48         /* nothing here yet */
49 };
50
51 #define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
52 #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
53 #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
54
55 static struct s3c2410_uartcfg h1940_uartcfgs[] = {
56         [0] = {
57                 .hwport      = 0,
58                 .flags       = 0,
59                 .clock       = &s3c2410_pclk,
60                 .ucon        = 0x3c5,
61                 .ulcon       = 0x03,
62                 .ufcon       = 0x51,
63         },
64         [1] = {
65                 .hwport      = 1,
66                 .flags       = 0,
67                 .clock       = &s3c2410_pclk,
68                 .ucon        = 0x245,
69                 .ulcon       = 0x03,
70                 .ufcon       = 0x00,
71         },
72         /* IR port */
73         [2] = {
74                 .hwport      = 2,
75                 .flags       = 0,
76                 .clock       = &s3c2410_pclk,
77                 .ucon        = 0x3c5,
78                 .ulcon       = 0x43,
79                 .ufcon       = 0x51,
80         }
81 };
82
83
84
85
86 static struct platform_device *h1940_devices[] __initdata = {
87         &s3c_device_usb,
88         &s3c_device_lcd,
89         &s3c_device_wdt,
90         &s3c_device_i2c,
91         &s3c_device_iis,
92 };
93
94 static struct s3c2410_board h1940_board __initdata = {
95         .devices       = h1940_devices,
96         .devices_count = ARRAY_SIZE(h1940_devices)
97 };
98
99 void __init h1940_map_io(void)
100 {
101         s3c24xx_init_io(h1940_iodesc, ARRAY_SIZE(h1940_iodesc));
102         s3c2410_init_uarts(h1940_uartcfgs, ARRAY_SIZE(h1940_uartcfgs));
103         s3c2410_set_board(&h1940_board);
104 }
105
106 void __init h1940_init_irq(void)
107 {
108         s3c2410_init_irq();
109
110 }
111
112 void __init h1940_init_time(void)
113 {
114         s3c2410_init_time();
115 }
116
117 MACHINE_START(H1940, "IPAQ-H1940")
118      MAINTAINER("Ben Dooks <ben@fluff.org>")
119      BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, S3C2410_VA_UART)
120      BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100)
121      MAPIO(h1940_map_io)
122      INITIRQ(h1940_init_irq)
123      INITTIME(h1940_init_time)
124 MACHINE_END