blob: 345a484b93cc5be58553ee4af6e570bdb3cbec11 [file] [log] [blame]
Kukjin Kim0afdff52013-01-02 10:32:55 -08001/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002 *
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.
Linus Torvalds1da177e2005-04-16 15:20:36 -07009 */
10
11#include <linux/kernel.h>
12#include <linux/types.h>
13#include <linux/interrupt.h>
14#include <linux/list.h>
15#include <linux/timer.h>
16#include <linux/init.h>
Ben Dooksb6d1f542006-12-17 23:22:26 +010017#include <linux/serial_core.h>
Tushar Behera334a1c72014-02-14 10:32:45 +090018#include <linux/serial_s3c.h>
Russell Kingd052d1b2005-10-29 19:07:23 +010019#include <linux/platform_device.h>
Russell Kingfced80c2008-09-06 12:10:45 +010020#include <linux/io.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070021
Kukjin Kim0afdff52013-01-02 10:32:55 -080022#include <linux/platform_data/i2c-s3c2410.h>
23
24#include <asm/irq.h>
25#include <asm/mach-types.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070026#include <asm/mach/arch.h>
27#include <asm/mach/map.h>
28#include <asm/mach/irq.h>
29
Russell Kinga09e64f2008-08-05 16:14:15 +010030#include <mach/hardware.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010031#include <mach/regs-gpio.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070032
Ben Dooksa2b7ba92008-10-07 22:26:09 +010033#include <plat/cpu.h>
Kukjin Kim0afdff52013-01-02 10:32:55 -080034#include <plat/devs.h>
Romain Naour7f78b6e2013-01-09 18:47:04 -080035#include <plat/samsung-time.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070036
Kukjin Kimb27b0722012-01-03 14:02:03 +010037#include "common.h"
Kukjin Kim0afdff52013-01-02 10:32:55 -080038#include "otom.h"
Kukjin Kimb27b0722012-01-03 14:02:03 +010039
Linus Torvalds1da177e2005-04-16 15:20:36 -070040static struct map_desc otom11_iodesc[] __initdata = {
41 /* Device area */
42 { (u32)OTOM_VA_CS8900A_BASE, OTOM_PA_CS8900A_BASE, SZ_16M, MT_DEVICE },
43};
44
45#define UCON S3C2410_UCON_DEFAULT
46#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
47#define UFCON S3C2410_UFCON_RXTRIG12 | S3C2410_UFCON_FIFOMODE
48
Ben Dooks66a9b492006-06-18 23:04:05 +010049static struct s3c2410_uartcfg otom11_uartcfgs[] __initdata = {
Linus Torvalds1da177e2005-04-16 15:20:36 -070050 [0] = {
51 .hwport = 0,
52 .flags = 0,
53 .ucon = UCON,
54 .ulcon = ULCON,
55 .ufcon = UFCON,
56 },
57 [1] = {
58 .hwport = 1,
59 .flags = 0,
60 .ucon = UCON,
61 .ulcon = ULCON,
62 .ufcon = UFCON,
63 },
64 /* port 2 is not actually used */
65 [2] = {
66 .hwport = 2,
67 .flags = 0,
68 .ucon = UCON,
69 .ulcon = ULCON,
70 .ufcon = UFCON,
71 }
72};
73
74/* NOR Flash on NexVision OTOM board */
75
76static struct resource otom_nor_resource[] = {
Tushar Beherae21be382012-05-12 16:12:24 +090077 [0] = DEFINE_RES_MEM(S3C2410_CS0, SZ_4M),
Linus Torvalds1da177e2005-04-16 15:20:36 -070078};
79
80static struct platform_device otom_device_nor = {
81 .name = "mtd-flash",
82 .id = -1,
83 .num_resources = ARRAY_SIZE(otom_nor_resource),
84 .resource = otom_nor_resource,
85};
86
87/* Standard OTOM devices */
88
89static struct platform_device *otom11_devices[] __initdata = {
Ben Dooksb8132482009-11-23 00:13:39 +000090 &s3c_device_ohci,
Linus Torvalds1da177e2005-04-16 15:20:36 -070091 &s3c_device_lcd,
92 &s3c_device_wdt,
Ben Dooks3e1b7762008-10-31 16:14:40 +000093 &s3c_device_i2c0,
Linus Torvalds1da177e2005-04-16 15:20:36 -070094 &s3c_device_iis,
95 &s3c_device_rtc,
96 &otom_device_nor,
97};
98
Ben Dooks5fe10ab2005-09-20 17:24:33 +010099static void __init otom11_map_io(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700100{
101 s3c24xx_init_io(otom11_iodesc, ARRAY_SIZE(otom11_iodesc));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700102 s3c24xx_init_uarts(otom11_uartcfgs, ARRAY_SIZE(otom11_uartcfgs));
Romain Naour7f78b6e2013-01-09 18:47:04 -0800103 samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700104}
105
Heiko Stuebner07ee5e72014-05-09 05:49:29 +0900106static void __init otom11_init_time(void)
107{
108 s3c2410_init_clocks(12000000);
109 samsung_timer_init();
110}
111
Ben Dooks57e51712007-04-20 11:19:16 +0100112static void __init otom11_init(void)
113{
Ben Dooks3e1b7762008-10-31 16:14:40 +0000114 s3c_i2c0_set_platdata(NULL);
Ben Dooks57e51712007-04-20 11:19:16 +0100115 platform_add_devices(otom11_devices, ARRAY_SIZE(otom11_devices));
116}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700117
118MACHINE_START(OTOM, "Nex Vision - Otom 1.1")
Russell Kinge9dea0c2005-07-03 17:38:58 +0100119 /* Maintainer: Guillaume GOURAT <guillaume.gourat@nexvision.tv> */
Nicolas Pitre69d50712011-07-05 22:38:17 -0400120 .atag_offset = 0x100,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700121 .map_io = otom11_map_io,
Ben Dooks57e51712007-04-20 11:19:16 +0100122 .init_machine = otom11_init,
Heiko Stuebnerf182aa12013-03-07 12:38:19 +0900123 .init_irq = s3c2410_init_irq,
Heiko Stuebner07ee5e72014-05-09 05:49:29 +0900124 .init_time = otom11_init_time,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700125MACHINE_END