blob: 0260ed5ab946c1a2c36576f1668c0070642a92a2 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/* 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
Ben Dooks5fe10ab2005-09-20 17:24:33 +010019 * 20-Sep-2005 BJD Added static to non-exported items
Ben Dookse838ffc2005-11-01 19:44:28 +000020 * 31-Oct-2005 BJD Added LCD setup for framebuffer
Linus Torvalds1da177e2005-04-16 15:20:36 -070021*/
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#include <linux/tty.h>
30#include <linux/console.h>
Russell Kingd052d1b2005-10-29 19:07:23 +010031#include <linux/platform_device.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070032#include <linux/serial_core.h>
33#include <linux/serial.h>
34
35#include <asm/mach/arch.h>
36#include <asm/mach/map.h>
37#include <asm/mach/irq.h>
38
39#include <asm/hardware.h>
40#include <asm/hardware/iomd.h>
41#include <asm/io.h>
42#include <asm/irq.h>
43#include <asm/mach-types.h>
44
45#include <asm/arch/regs-serial.h>
46#include <asm/arch/regs-gpio.h>
Ben Dookse838ffc2005-11-01 19:44:28 +000047#include <asm/arch/regs-lcd.h>
48
49#include <asm/arch/fb.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070050
51#include "clock.h"
52#include "devs.h"
53#include "cpu.h"
54#include "pm.h"
55
56static struct map_desc rx3715_iodesc[] __initdata = {
57 /* dump ISA space somewhere unused */
58
Ben Dooksff6ffa82005-11-09 14:05:31 +000059 {
60 .virtual = (u32)S3C24XX_VA_ISA_WORD,
61 .pfn = __phys_to_pfn(S3C2410_CS3),
62 .length = SZ_1M,
63 .type = MT_DEVICE,
64 }, {
65 .virtual = (u32)S3C24XX_VA_ISA_BYTE,
66 .pfn = __phys_to_pfn(S3C2410_CS3),
67 .length = SZ_1M,
68 .type = MT_DEVICE,
69 },
Linus Torvalds1da177e2005-04-16 15:20:36 -070070};
71
72
73static struct s3c24xx_uart_clksrc rx3715_serial_clocks[] = {
74 [0] = {
75 .name = "fclk",
76 .divisor = 0,
77 .min_baud = 0,
78 .max_baud = 0,
79 }
80};
81
82static struct s3c2410_uartcfg rx3715_uartcfgs[] = {
83 [0] = {
84 .hwport = 0,
85 .flags = 0,
86 .ucon = 0x3c5,
87 .ulcon = 0x03,
88 .ufcon = 0x51,
89 .clocks = rx3715_serial_clocks,
90 .clocks_size = ARRAY_SIZE(rx3715_serial_clocks),
91 },
92 [1] = {
93 .hwport = 1,
94 .flags = 0,
95 .ucon = 0x3c5,
96 .ulcon = 0x03,
97 .ufcon = 0x00,
98 .clocks = rx3715_serial_clocks,
99 .clocks_size = ARRAY_SIZE(rx3715_serial_clocks),
100 },
101 /* IR port */
102 [2] = {
103 .hwport = 2,
104 .uart_flags = UPF_CONS_FLOW,
105 .ucon = 0x3c5,
106 .ulcon = 0x43,
107 .ufcon = 0x51,
108 .clocks = rx3715_serial_clocks,
109 .clocks_size = ARRAY_SIZE(rx3715_serial_clocks),
110 }
111};
112
Ben Dookse838ffc2005-11-01 19:44:28 +0000113/* framebuffer lcd controller information */
114
115static struct s3c2410fb_mach_info rx3715_lcdcfg __initdata = {
116 .regs = {
117 .lcdcon1 = S3C2410_LCDCON1_TFT16BPP | \
118 S3C2410_LCDCON1_TFT | \
119 S3C2410_LCDCON1_CLKVAL(0x0C),
120
121 .lcdcon2 = S3C2410_LCDCON2_VBPD(5) | \
122 S3C2410_LCDCON2_LINEVAL(319) | \
123 S3C2410_LCDCON2_VFPD(6) | \
124 S3C2410_LCDCON2_VSPW(2),
125
126 .lcdcon3 = S3C2410_LCDCON3_HBPD(35) | \
127 S3C2410_LCDCON3_HOZVAL(239) | \
128 S3C2410_LCDCON3_HFPD(35),
129
130 .lcdcon4 = S3C2410_LCDCON4_MVAL(0) | \
131 S3C2410_LCDCON4_HSPW(7),
132
133 .lcdcon5 = S3C2410_LCDCON5_INVVLINE |
134 S3C2410_LCDCON5_FRM565 |
135 S3C2410_LCDCON5_HWSWP,
136 },
137
138 .lpcsel = 0xf82,
139
140 .gpccon = 0xaa955699,
141 .gpccon_mask = 0xffc003cc,
142 .gpcup = 0x0000ffff,
143 .gpcup_mask = 0xffffffff,
144
145 .gpdcon = 0xaa95aaa1,
146 .gpdcon_mask = 0xffc0fff0,
147 .gpdup = 0x0000faff,
148 .gpdup_mask = 0xffffffff,
149
150 .fixed_syncs = 1,
151 .width = 240,
152 .height = 320,
153
154 .xres = {
155 .min = 240,
156 .max = 240,
157 .defval = 240,
158 },
159
160 .yres = {
161 .max = 320,
162 .min = 320,
163 .defval = 320,
164 },
165
166 .bpp = {
167 .min = 16,
168 .max = 16,
169 .defval = 16,
170 },
171};
172
Linus Torvalds1da177e2005-04-16 15:20:36 -0700173static struct platform_device *rx3715_devices[] __initdata = {
174 &s3c_device_usb,
175 &s3c_device_lcd,
176 &s3c_device_wdt,
177 &s3c_device_i2c,
178 &s3c_device_iis,
179};
180
181static struct s3c24xx_board rx3715_board __initdata = {
182 .devices = rx3715_devices,
183 .devices_count = ARRAY_SIZE(rx3715_devices)
184};
185
Ben Dooks5fe10ab2005-09-20 17:24:33 +0100186static void __init rx3715_map_io(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700187{
188 s3c24xx_init_io(rx3715_iodesc, ARRAY_SIZE(rx3715_iodesc));
189 s3c24xx_init_clocks(16934000);
190 s3c24xx_init_uarts(rx3715_uartcfgs, ARRAY_SIZE(rx3715_uartcfgs));
191 s3c24xx_set_board(&rx3715_board);
192}
193
Ben Dooks5fe10ab2005-09-20 17:24:33 +0100194static void __init rx3715_init_irq(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700195{
196 s3c24xx_init_irq();
197}
198
Linus Torvalds1da177e2005-04-16 15:20:36 -0700199static void __init rx3715_init_machine(void)
200{
201 s3c2410_pm_init();
Ben Dookse838ffc2005-11-01 19:44:28 +0000202 s3c24xx_fb_set_platdata(&rx3715_lcdcfg);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700203}
Ben Dookse838ffc2005-11-01 19:44:28 +0000204
Linus Torvalds1da177e2005-04-16 15:20:36 -0700205
206MACHINE_START(RX3715, "IPAQ-RX3715")
Russell Kinge9dea0c2005-07-03 17:38:58 +0100207 /* Maintainer: Ben Dooks <ben@fluff.org> */
Russell Kinge9dea0c2005-07-03 17:38:58 +0100208 .phys_io = S3C2410_PA_UART,
209 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
210 .boot_params = S3C2410_SDRAM_PA + 0x100,
211 .map_io = rx3715_map_io,
212 .init_irq = rx3715_init_irq,
213 .init_machine = rx3715_init_machine,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700214 .timer = &s3c24xx_timer,
215MACHINE_END