blob: 0411e9adb54d9b208682d849859a5dd16c97f08d [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/* linux/arch/arm/mach-s3c2410/mach-n30.c
2 *
3 * Copyright (c) 2003-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Copyright (c) 2005 Christer Weinigel <christer@weinigel.se>
7 *
8 * There is a wiki with more information about the n30 port at
9 * http://handhelds.org/moin/moin.cgi/AcerN30Documentation .
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14*/
15
16#include <linux/kernel.h>
17#include <linux/types.h>
18#include <linux/interrupt.h>
19#include <linux/list.h>
20#include <linux/timer.h>
21#include <linux/init.h>
22#include <linux/delay.h>
Ben Dooksb6d1f542006-12-17 23:22:26 +010023#include <linux/serial_core.h>
Russell Kingd052d1b2005-10-29 19:07:23 +010024#include <linux/platform_device.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070025#include <linux/kthread.h>
26
27#include <asm/mach/arch.h>
28#include <asm/mach/map.h>
29#include <asm/mach/irq.h>
30
31#include <asm/hardware.h>
32#include <asm/hardware/iomd.h>
33#include <asm/io.h>
34#include <asm/irq.h>
35#include <asm/mach-types.h>
36
37#include <asm/arch/regs-serial.h>
38#include <asm/arch/regs-gpio.h>
39#include <asm/arch/iic.h>
40
Linus Torvalds1da177e2005-04-16 15:20:36 -070041#include "s3c2410.h"
42#include "clock.h"
43#include "devs.h"
44#include "cpu.h"
45
46static struct map_desc n30_iodesc[] __initdata = {
47 /* nothing here yet */
48};
49
50static struct s3c2410_uartcfg n30_uartcfgs[] = {
51 /* Normal serial port */
52 [0] = {
53 .hwport = 0,
54 .flags = 0,
55 .ucon = 0x2c5,
56 .ulcon = 0x03,
57 .ufcon = 0x51,
58 },
59 /* IR port */
60 [1] = {
61 .hwport = 1,
62 .flags = 0,
63 .uart_flags = UPF_CONS_FLOW,
64 .ucon = 0x2c5,
65 .ulcon = 0x43,
66 .ufcon = 0x51,
67 },
68 /* The BlueTooth controller is connected to port 2 */
69 [2] = {
70 .hwport = 2,
71 .flags = 0,
72 .ucon = 0x2c5,
73 .ulcon = 0x03,
74 .ufcon = 0x51,
75 },
76};
77
78static struct platform_device *n30_devices[] __initdata = {
79 &s3c_device_usb,
80 &s3c_device_lcd,
81 &s3c_device_wdt,
82 &s3c_device_i2c,
83 &s3c_device_iis,
84 &s3c_device_usbgadget,
85};
86
87static struct s3c2410_platform_i2c n30_i2ccfg = {
88 .flags = 0,
89 .slave_addr = 0x10,
90 .bus_freq = 10*1000,
91 .max_freq = 10*1000,
92};
93
94static struct s3c24xx_board n30_board __initdata = {
95 .devices = n30_devices,
96 .devices_count = ARRAY_SIZE(n30_devices)
97};
98
Ben Dooks5fe10ab2005-09-20 17:24:33 +010099static void __init n30_map_io(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700100{
101 s3c24xx_init_io(n30_iodesc, ARRAY_SIZE(n30_iodesc));
102 s3c24xx_init_clocks(0);
103 s3c24xx_init_uarts(n30_uartcfgs, ARRAY_SIZE(n30_uartcfgs));
104 s3c24xx_set_board(&n30_board);
105}
106
Ben Dooks5fe10ab2005-09-20 17:24:33 +0100107static void __init n30_init_irq(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700108{
109 s3c24xx_init_irq();
110}
111
Ben Dooks027da012005-09-05 20:47:53 +0100112/* GPB3 is the line that controls the pull-up for the USB D+ line */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700113
Ben Dooks5fe10ab2005-09-20 17:24:33 +0100114static void __init n30_init(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700115{
116 s3c_device_i2c.dev.platform_data = &n30_i2ccfg;
117
Ben Dooks027da012005-09-05 20:47:53 +0100118 /* Turn off suspend on both USB ports, and switch the
119 * selectable USB port to USB device mode. */
120
121 s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST |
122 S3C2410_MISCCR_USBSUSPND0 |
123 S3C2410_MISCCR_USBSUSPND1, 0x0);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700124}
125
126MACHINE_START(N30, "Acer-N30")
Ben Dooks027da012005-09-05 20:47:53 +0100127 /* Maintainer: Christer Weinigel <christer@weinigel.se>,
128 Ben Dooks <ben-linux@fluff.org>
129 */
Russell Kinge9dea0c2005-07-03 17:38:58 +0100130 .phys_io = S3C2410_PA_UART,
131 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
132 .boot_params = S3C2410_SDRAM_PA + 0x100,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700133 .timer = &s3c24xx_timer,
134 .init_machine = n30_init,
135 .init_irq = n30_init_irq,
136 .map_io = n30_map_io,
137MACHINE_END
138
139/*
140 Local variables:
141 compile-command: "make ARCH=arm CROSS_COMPILE=/usr/local/arm/3.3.2/bin/arm-linux- -k -C ../../.."
142 c-basic-offset: 8
143 End:
144*/