Pull move-iosapic-to-acpi into release branch
[linux-2.6] / arch / arm / mach-s3c2410 / mach-rx3715.c
1 /* linux/arch/arm/mach-s3c2410/mach-rx3715.c
2  *
3  * Copyright (c) 2003,2004 Simtec Electronics
4  *      Ben Dooks <ben@simtec.co.uk>
5  *
6  * http://www.handhelds.org/projects/rx3715.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-Sep-2004 BJD  Copied from mach-h1940.c
14  *      25-Oct-2004 BJD  Updates for 2.6.10-rc1
15  *      10-Jan-2005 BJD  Removed include of s3c2410.h s3c2440.h
16  *      14-Jan-2005 BJD  Added new clock init
17  *      10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
18  *      14-Mar-2005 BJD  Fixed __iomem warnings
19  *      20-Sep-2005 BJD  Added static to non-exported items
20 */
21
22 #include <linux/kernel.h>
23 #include <linux/types.h>
24 #include <linux/interrupt.h>
25 #include <linux/list.h>
26 #include <linux/timer.h>
27 #include <linux/init.h>
28 #include <linux/tty.h>
29 #include <linux/console.h>
30 #include <linux/serial_core.h>
31 #include <linux/serial.h>
32
33 #include <asm/mach/arch.h>
34 #include <asm/mach/map.h>
35 #include <asm/mach/irq.h>
36
37 #include <asm/hardware.h>
38 #include <asm/hardware/iomd.h>
39 #include <asm/io.h>
40 #include <asm/irq.h>
41 #include <asm/mach-types.h>
42
43 #include <asm/arch/regs-serial.h>
44 #include <asm/arch/regs-gpio.h>
45
46 #include "clock.h"
47 #include "devs.h"
48 #include "cpu.h"
49 #include "pm.h"
50
51 static struct map_desc rx3715_iodesc[] __initdata = {
52         /* dump ISA space somewhere unused */
53
54         { (u32)S3C24XX_VA_ISA_WORD, S3C2410_CS3, SZ_16M, MT_DEVICE },
55         { (u32)S3C24XX_VA_ISA_BYTE, S3C2410_CS3, SZ_16M, MT_DEVICE },
56 };
57
58
59 static struct s3c24xx_uart_clksrc rx3715_serial_clocks[] = {
60         [0] = {
61                 .name           = "fclk",
62                 .divisor        = 0,
63                 .min_baud       = 0,
64                 .max_baud       = 0,
65         }
66 };
67
68 static struct s3c2410_uartcfg rx3715_uartcfgs[] = {
69         [0] = {
70                 .hwport      = 0,
71                 .flags       = 0,
72                 .ucon        = 0x3c5,
73                 .ulcon       = 0x03,
74                 .ufcon       = 0x51,
75                 .clocks      = rx3715_serial_clocks,
76                 .clocks_size = ARRAY_SIZE(rx3715_serial_clocks),
77         },
78         [1] = {
79                 .hwport      = 1,
80                 .flags       = 0,
81                 .ucon        = 0x3c5,
82                 .ulcon       = 0x03,
83                 .ufcon       = 0x00,
84                 .clocks      = rx3715_serial_clocks,
85                 .clocks_size = ARRAY_SIZE(rx3715_serial_clocks),
86         },
87         /* IR port */
88         [2] = {
89                 .hwport      = 2,
90                 .uart_flags  = UPF_CONS_FLOW,
91                 .ucon        = 0x3c5,
92                 .ulcon       = 0x43,
93                 .ufcon       = 0x51,
94                 .clocks      = rx3715_serial_clocks,
95                 .clocks_size = ARRAY_SIZE(rx3715_serial_clocks),
96         }
97 };
98
99 static struct platform_device *rx3715_devices[] __initdata = {
100         &s3c_device_usb,
101         &s3c_device_lcd,
102         &s3c_device_wdt,
103         &s3c_device_i2c,
104         &s3c_device_iis,
105 };
106
107 static struct s3c24xx_board rx3715_board __initdata = {
108         .devices       = rx3715_devices,
109         .devices_count = ARRAY_SIZE(rx3715_devices)
110 };
111
112 static void __init rx3715_map_io(void)
113 {
114         s3c24xx_init_io(rx3715_iodesc, ARRAY_SIZE(rx3715_iodesc));
115         s3c24xx_init_clocks(16934000);
116         s3c24xx_init_uarts(rx3715_uartcfgs, ARRAY_SIZE(rx3715_uartcfgs));
117         s3c24xx_set_board(&rx3715_board);
118 }
119
120 static void __init rx3715_init_irq(void)
121 {
122         s3c24xx_init_irq();
123 }
124
125 #ifdef CONFIG_PM
126 static void __init rx3715_init_machine(void)
127 {
128         s3c2410_pm_init();
129 }
130 #else
131 #define rx3715_init_machine NULL
132 #endif
133
134 MACHINE_START(RX3715, "IPAQ-RX3715")
135         /* Maintainer: Ben Dooks <ben@fluff.org> */
136         .phys_ram       = S3C2410_SDRAM_PA,
137         .phys_io        = S3C2410_PA_UART,
138         .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
139         .boot_params    = S3C2410_SDRAM_PA + 0x100,
140         .map_io         = rx3715_map_io,
141         .init_irq       = rx3715_init_irq,
142         .init_machine   = rx3715_init_machine,
143         .timer          = &s3c24xx_timer,
144 MACHINE_END