blob: 2924afc068a43dd7d19b9b93ec35c113778966b9 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/* linux/arch/arm/mach-s3c2410/mach-h1940.c
2 *
3 * Copyright (c) 2003-2005 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 * 18-Oct-2004 BJD Updated new board structure name
22 * 04-Nov-2004 BJD Change for new serial clock
23 * 04-Jan-2005 BJD Updated uart init call
24 * 10-Jan-2005 BJD Removed include of s3c2410.h
25 * 14-Jan-2005 BJD Added clock init
26 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
27*/
28
29#include <linux/kernel.h>
30#include <linux/types.h>
31#include <linux/interrupt.h>
32#include <linux/list.h>
33#include <linux/timer.h>
34#include <linux/init.h>
35
36#include <asm/mach/arch.h>
37#include <asm/mach/map.h>
38#include <asm/mach/irq.h>
39
40#include <asm/hardware.h>
41#include <asm/hardware/iomd.h>
42#include <asm/io.h>
43#include <asm/irq.h>
44#include <asm/mach-types.h>
45
46//#include <asm/debug-ll.h>
47#include <asm/arch/regs-serial.h>
48
49#include <linux/serial_core.h>
50
51#include "clock.h"
52#include "devs.h"
53#include "cpu.h"
54
55static struct map_desc h1940_iodesc[] __initdata = {
56 /* nothing here yet */
57};
58
59#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
60#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
61#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
62
63static struct s3c2410_uartcfg h1940_uartcfgs[] = {
64 [0] = {
65 .hwport = 0,
66 .flags = 0,
67 .ucon = 0x3c5,
68 .ulcon = 0x03,
69 .ufcon = 0x51,
70 },
71 [1] = {
72 .hwport = 1,
73 .flags = 0,
74 .ucon = 0x245,
75 .ulcon = 0x03,
76 .ufcon = 0x00,
77 },
78 /* IR port */
79 [2] = {
80 .hwport = 2,
81 .flags = 0,
82 .uart_flags = UPF_CONS_FLOW,
83 .ucon = 0x3c5,
84 .ulcon = 0x43,
85 .ufcon = 0x51,
86 }
87};
88
89
90
91
92static struct platform_device *h1940_devices[] __initdata = {
93 &s3c_device_usb,
94 &s3c_device_lcd,
95 &s3c_device_wdt,
96 &s3c_device_i2c,
97 &s3c_device_iis,
98};
99
100static struct s3c24xx_board h1940_board __initdata = {
101 .devices = h1940_devices,
102 .devices_count = ARRAY_SIZE(h1940_devices)
103};
104
105void __init h1940_map_io(void)
106{
107 s3c24xx_init_io(h1940_iodesc, ARRAY_SIZE(h1940_iodesc));
108 s3c24xx_init_clocks(0);
109 s3c24xx_init_uarts(h1940_uartcfgs, ARRAY_SIZE(h1940_uartcfgs));
110 s3c24xx_set_board(&h1940_board);
111}
112
113void __init h1940_init_irq(void)
114{
115 s3c24xx_init_irq();
116
117}
118
119MACHINE_START(H1940, "IPAQ-H1940")
120 MAINTAINER("Ben Dooks <ben@fluff.org>")
121 BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, (u32)S3C24XX_VA_UART)
122 BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100)
123 MAPIO(h1940_map_io)
124 INITIRQ(h1940_init_irq)
125 .timer = &s3c24xx_timer,
126MACHINE_END