Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* 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 Dooks | b6d1f54 | 2006-12-17 23:22:26 +0100 | [diff] [blame] | 23 | #include <linux/serial_core.h> |
Russell King | d052d1b | 2005-10-29 19:07:23 +0100 | [diff] [blame] | 24 | #include <linux/platform_device.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | #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> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | #include <asm/io.h> |
| 33 | #include <asm/irq.h> |
| 34 | #include <asm/mach-types.h> |
| 35 | |
Ben Dooks | 531b617 | 2007-07-22 16:05:25 +0100 | [diff] [blame] | 36 | #include <asm/plat-s3c/regs-serial.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | #include <asm/arch/regs-gpio.h> |
Ben Dooks | 531b617 | 2007-07-22 16:05:25 +0100 | [diff] [blame] | 38 | #include <asm/plat-s3c/iic.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | |
Ben Dooks | a21765a | 2007-02-11 18:31:01 +0100 | [diff] [blame] | 40 | #include <asm/plat-s3c24xx/s3c2410.h> |
| 41 | #include <asm/plat-s3c24xx/clock.h> |
| 42 | #include <asm/plat-s3c24xx/devs.h> |
| 43 | #include <asm/plat-s3c24xx/cpu.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | |
| 45 | static struct map_desc n30_iodesc[] __initdata = { |
| 46 | /* nothing here yet */ |
| 47 | }; |
| 48 | |
| 49 | static struct s3c2410_uartcfg n30_uartcfgs[] = { |
| 50 | /* Normal serial port */ |
| 51 | [0] = { |
| 52 | .hwport = 0, |
| 53 | .flags = 0, |
| 54 | .ucon = 0x2c5, |
| 55 | .ulcon = 0x03, |
| 56 | .ufcon = 0x51, |
| 57 | }, |
| 58 | /* IR port */ |
| 59 | [1] = { |
| 60 | .hwport = 1, |
| 61 | .flags = 0, |
| 62 | .uart_flags = UPF_CONS_FLOW, |
| 63 | .ucon = 0x2c5, |
| 64 | .ulcon = 0x43, |
| 65 | .ufcon = 0x51, |
| 66 | }, |
| 67 | /* The BlueTooth controller is connected to port 2 */ |
| 68 | [2] = { |
| 69 | .hwport = 2, |
| 70 | .flags = 0, |
| 71 | .ucon = 0x2c5, |
| 72 | .ulcon = 0x03, |
| 73 | .ufcon = 0x51, |
| 74 | }, |
| 75 | }; |
| 76 | |
| 77 | static struct platform_device *n30_devices[] __initdata = { |
| 78 | &s3c_device_usb, |
| 79 | &s3c_device_lcd, |
| 80 | &s3c_device_wdt, |
| 81 | &s3c_device_i2c, |
| 82 | &s3c_device_iis, |
| 83 | &s3c_device_usbgadget, |
| 84 | }; |
| 85 | |
| 86 | static struct s3c2410_platform_i2c n30_i2ccfg = { |
| 87 | .flags = 0, |
| 88 | .slave_addr = 0x10, |
| 89 | .bus_freq = 10*1000, |
| 90 | .max_freq = 10*1000, |
| 91 | }; |
| 92 | |
Ben Dooks | 5fe10ab | 2005-09-20 17:24:33 +0100 | [diff] [blame] | 93 | static void __init n30_map_io(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 94 | { |
| 95 | s3c24xx_init_io(n30_iodesc, ARRAY_SIZE(n30_iodesc)); |
| 96 | s3c24xx_init_clocks(0); |
| 97 | s3c24xx_init_uarts(n30_uartcfgs, ARRAY_SIZE(n30_uartcfgs)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 98 | } |
| 99 | |
Ben Dooks | 5fe10ab | 2005-09-20 17:24:33 +0100 | [diff] [blame] | 100 | static void __init n30_init_irq(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 101 | { |
| 102 | s3c24xx_init_irq(); |
| 103 | } |
| 104 | |
Ben Dooks | 027da01 | 2005-09-05 20:47:53 +0100 | [diff] [blame] | 105 | /* GPB3 is the line that controls the pull-up for the USB D+ line */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 106 | |
Ben Dooks | 5fe10ab | 2005-09-20 17:24:33 +0100 | [diff] [blame] | 107 | static void __init n30_init(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 108 | { |
| 109 | s3c_device_i2c.dev.platform_data = &n30_i2ccfg; |
| 110 | |
Ben Dooks | 027da01 | 2005-09-05 20:47:53 +0100 | [diff] [blame] | 111 | /* Turn off suspend on both USB ports, and switch the |
| 112 | * selectable USB port to USB device mode. */ |
| 113 | |
| 114 | s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST | |
| 115 | S3C2410_MISCCR_USBSUSPND0 | |
| 116 | S3C2410_MISCCR_USBSUSPND1, 0x0); |
Ben Dooks | 57e5171 | 2007-04-20 11:19:16 +0100 | [diff] [blame] | 117 | |
| 118 | platform_add_devices(n30_devices, ARRAY_SIZE(n30_devices)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 119 | } |
| 120 | |
| 121 | MACHINE_START(N30, "Acer-N30") |
Ben Dooks | 027da01 | 2005-09-05 20:47:53 +0100 | [diff] [blame] | 122 | /* Maintainer: Christer Weinigel <christer@weinigel.se>, |
| 123 | Ben Dooks <ben-linux@fluff.org> |
| 124 | */ |
Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 125 | .phys_io = S3C2410_PA_UART, |
| 126 | .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc, |
| 127 | .boot_params = S3C2410_SDRAM_PA + 0x100, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 128 | .timer = &s3c24xx_timer, |
| 129 | .init_machine = n30_init, |
| 130 | .init_irq = n30_init_irq, |
| 131 | .map_io = n30_map_io, |
| 132 | MACHINE_END |
| 133 | |
| 134 | /* |
| 135 | Local variables: |
| 136 | compile-command: "make ARCH=arm CROSS_COMPILE=/usr/local/arm/3.3.2/bin/arm-linux- -k -C ../../.." |
| 137 | c-basic-offset: 8 |
| 138 | End: |
| 139 | */ |