Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* linux/arch/arm/mach-s3c2410/mach-otom.c |
| 2 | * |
| 3 | * Copyright (c) 2004 Nex Vision |
| 4 | * Guillaume GOURAT <guillaume.gourat@nexvision.fr> |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License version 2 as |
| 8 | * published by the Free Software Foundation. |
| 9 | * |
| 10 | */ |
| 11 | |
| 12 | #include <linux/kernel.h> |
| 13 | #include <linux/types.h> |
| 14 | #include <linux/interrupt.h> |
| 15 | #include <linux/list.h> |
| 16 | #include <linux/timer.h> |
| 17 | #include <linux/init.h> |
Ben Dooks | b6d1f54 | 2006-12-17 23:22:26 +0100 | [diff] [blame] | 18 | #include <linux/serial_core.h> |
Russell King | d052d1b | 2005-10-29 19:07:23 +0100 | [diff] [blame] | 19 | #include <linux/platform_device.h> |
Russell King | fced80c | 2008-09-06 12:10:45 +0100 | [diff] [blame] | 20 | #include <linux/io.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | |
| 22 | #include <asm/mach/arch.h> |
| 23 | #include <asm/mach/map.h> |
| 24 | #include <asm/mach/irq.h> |
| 25 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 26 | #include <mach/otom-map.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 28 | #include <mach/hardware.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | #include <asm/irq.h> |
| 30 | #include <asm/mach-types.h> |
| 31 | |
Ben Dooks | a2b7ba9 | 2008-10-07 22:26:09 +0100 | [diff] [blame] | 32 | #include <plat/regs-serial.h> |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 33 | #include <mach/regs-gpio.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | |
Ben Dooks | a2b7ba9 | 2008-10-07 22:26:09 +0100 | [diff] [blame] | 35 | #include <plat/s3c2410.h> |
Ben Dooks | d5120ae | 2008-10-07 23:09:51 +0100 | [diff] [blame] | 36 | #include <plat/clock.h> |
Ben Dooks | a2b7ba9 | 2008-10-07 22:26:09 +0100 | [diff] [blame] | 37 | #include <plat/devs.h> |
Ben Dooks | 3e1b776 | 2008-10-31 16:14:40 +0000 | [diff] [blame] | 38 | #include <plat/iic.h> |
Ben Dooks | a2b7ba9 | 2008-10-07 22:26:09 +0100 | [diff] [blame] | 39 | #include <plat/cpu.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | |
Kukjin Kim | b27b072 | 2012-01-03 14:02:03 +0100 | [diff] [blame] | 41 | #include "common.h" |
| 42 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 43 | static struct map_desc otom11_iodesc[] __initdata = { |
| 44 | /* Device area */ |
| 45 | { (u32)OTOM_VA_CS8900A_BASE, OTOM_PA_CS8900A_BASE, SZ_16M, MT_DEVICE }, |
| 46 | }; |
| 47 | |
| 48 | #define UCON S3C2410_UCON_DEFAULT |
| 49 | #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB |
| 50 | #define UFCON S3C2410_UFCON_RXTRIG12 | S3C2410_UFCON_FIFOMODE |
| 51 | |
Ben Dooks | 66a9b49 | 2006-06-18 23:04:05 +0100 | [diff] [blame] | 52 | static struct s3c2410_uartcfg otom11_uartcfgs[] __initdata = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | [0] = { |
| 54 | .hwport = 0, |
| 55 | .flags = 0, |
| 56 | .ucon = UCON, |
| 57 | .ulcon = ULCON, |
| 58 | .ufcon = UFCON, |
| 59 | }, |
| 60 | [1] = { |
| 61 | .hwport = 1, |
| 62 | .flags = 0, |
| 63 | .ucon = UCON, |
| 64 | .ulcon = ULCON, |
| 65 | .ufcon = UFCON, |
| 66 | }, |
| 67 | /* port 2 is not actually used */ |
| 68 | [2] = { |
| 69 | .hwport = 2, |
| 70 | .flags = 0, |
| 71 | .ucon = UCON, |
| 72 | .ulcon = ULCON, |
| 73 | .ufcon = UFCON, |
| 74 | } |
| 75 | }; |
| 76 | |
| 77 | /* NOR Flash on NexVision OTOM board */ |
| 78 | |
| 79 | static struct resource otom_nor_resource[] = { |
Tushar Behera | e21be38 | 2012-05-12 16:12:24 +0900 | [diff] [blame] | 80 | [0] = DEFINE_RES_MEM(S3C2410_CS0, SZ_4M), |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 81 | }; |
| 82 | |
| 83 | static struct platform_device otom_device_nor = { |
| 84 | .name = "mtd-flash", |
| 85 | .id = -1, |
| 86 | .num_resources = ARRAY_SIZE(otom_nor_resource), |
| 87 | .resource = otom_nor_resource, |
| 88 | }; |
| 89 | |
| 90 | /* Standard OTOM devices */ |
| 91 | |
| 92 | static struct platform_device *otom11_devices[] __initdata = { |
Ben Dooks | b813248 | 2009-11-23 00:13:39 +0000 | [diff] [blame] | 93 | &s3c_device_ohci, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 94 | &s3c_device_lcd, |
| 95 | &s3c_device_wdt, |
Ben Dooks | 3e1b776 | 2008-10-31 16:14:40 +0000 | [diff] [blame] | 96 | &s3c_device_i2c0, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 97 | &s3c_device_iis, |
| 98 | &s3c_device_rtc, |
| 99 | &otom_device_nor, |
| 100 | }; |
| 101 | |
Ben Dooks | 5fe10ab | 2005-09-20 17:24:33 +0100 | [diff] [blame] | 102 | static void __init otom11_map_io(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 103 | { |
| 104 | s3c24xx_init_io(otom11_iodesc, ARRAY_SIZE(otom11_iodesc)); |
| 105 | s3c24xx_init_clocks(0); |
| 106 | s3c24xx_init_uarts(otom11_uartcfgs, ARRAY_SIZE(otom11_uartcfgs)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 107 | } |
| 108 | |
Ben Dooks | 57e5171 | 2007-04-20 11:19:16 +0100 | [diff] [blame] | 109 | static void __init otom11_init(void) |
| 110 | { |
Ben Dooks | 3e1b776 | 2008-10-31 16:14:40 +0000 | [diff] [blame] | 111 | s3c_i2c0_set_platdata(NULL); |
Ben Dooks | 57e5171 | 2007-04-20 11:19:16 +0100 | [diff] [blame] | 112 | platform_add_devices(otom11_devices, ARRAY_SIZE(otom11_devices)); |
| 113 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 114 | |
| 115 | MACHINE_START(OTOM, "Nex Vision - Otom 1.1") |
Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 116 | /* Maintainer: Guillaume GOURAT <guillaume.gourat@nexvision.tv> */ |
Nicolas Pitre | 69d5071 | 2011-07-05 22:38:17 -0400 | [diff] [blame] | 117 | .atag_offset = 0x100, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 118 | .map_io = otom11_map_io, |
Ben Dooks | 57e5171 | 2007-04-20 11:19:16 +0100 | [diff] [blame] | 119 | .init_machine = otom11_init, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 120 | .init_irq = s3c24xx_init_irq, |
| 121 | .timer = &s3c24xx_timer, |
Kukjin Kim | b27b072 | 2012-01-03 14:02:03 +0100 | [diff] [blame] | 122 | .restart = s3c2410_restart, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 123 | MACHINE_END |