]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blame - arch/arm/mach-s3c24xx/mach-otom.c
ARM: s3c24xx: stop including mach/hardware.h from mach/io.h
[mirror_ubuntu-jammy-kernel.git] / arch / arm / mach-s3c24xx / mach-otom.c
CommitLineData
84b21701
KK
1// SPDX-License-Identifier: GPL-2.0
2//
3// Copyright (c) 2004 Nex Vision
4// Guillaume GOURAT <guillaume.gourat@nexvision.fr>
1da177e4
LT
5
6#include <linux/kernel.h>
7#include <linux/types.h>
8#include <linux/interrupt.h>
9#include <linux/list.h>
10#include <linux/timer.h>
11#include <linux/init.h>
b6d1f542 12#include <linux/serial_core.h>
334a1c70 13#include <linux/serial_s3c.h>
d052d1be 14#include <linux/platform_device.h>
fced80c7 15#include <linux/io.h>
1da177e4 16
0afdff5d
KK
17#include <linux/platform_data/i2c-s3c2410.h>
18
19#include <asm/irq.h>
20#include <asm/mach-types.h>
1da177e4
LT
21#include <asm/mach/arch.h>
22#include <asm/mach/map.h>
23#include <asm/mach/irq.h>
24
a09e64fb 25#include <mach/regs-gpio.h>
673085f4
AB
26#include <mach/gpio-samsung.h>
27#include <plat/gpio-cfg.h>
1da177e4 28
a2b7ba9c 29#include <plat/cpu.h>
0afdff5d 30#include <plat/devs.h>
1da177e4 31
b27b0727 32#include "common.h"
0afdff5d 33#include "otom.h"
b27b0727 34
1da177e4
LT
35static struct map_desc otom11_iodesc[] __initdata = {
36 /* Device area */
37 { (u32)OTOM_VA_CS8900A_BASE, OTOM_PA_CS8900A_BASE, SZ_16M, MT_DEVICE },
38};
39
40#define UCON S3C2410_UCON_DEFAULT
41#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
42#define UFCON S3C2410_UFCON_RXTRIG12 | S3C2410_UFCON_FIFOMODE
43
66a9b49a 44static struct s3c2410_uartcfg otom11_uartcfgs[] __initdata = {
1da177e4
LT
45 [0] = {
46 .hwport = 0,
47 .flags = 0,
48 .ucon = UCON,
49 .ulcon = ULCON,
50 .ufcon = UFCON,
51 },
52 [1] = {
53 .hwport = 1,
54 .flags = 0,
55 .ucon = UCON,
56 .ulcon = ULCON,
57 .ufcon = UFCON,
58 },
59 /* port 2 is not actually used */
60 [2] = {
61 .hwport = 2,
62 .flags = 0,
63 .ucon = UCON,
64 .ulcon = ULCON,
65 .ufcon = UFCON,
66 }
67};
68
69/* NOR Flash on NexVision OTOM board */
70
71static struct resource otom_nor_resource[] = {
e21be38a 72 [0] = DEFINE_RES_MEM(S3C2410_CS0, SZ_4M),
1da177e4
LT
73};
74
75static struct platform_device otom_device_nor = {
76 .name = "mtd-flash",
77 .id = -1,
78 .num_resources = ARRAY_SIZE(otom_nor_resource),
79 .resource = otom_nor_resource,
80};
81
82/* Standard OTOM devices */
83
84static struct platform_device *otom11_devices[] __initdata = {
b813248c 85 &s3c_device_ohci,
1da177e4
LT
86 &s3c_device_lcd,
87 &s3c_device_wdt,
3e1b776c 88 &s3c_device_i2c0,
1da177e4
LT
89 &s3c_device_iis,
90 &s3c_device_rtc,
91 &otom_device_nor,
92};
93
5fe10ab1 94static void __init otom11_map_io(void)
1da177e4
LT
95{
96 s3c24xx_init_io(otom11_iodesc, ARRAY_SIZE(otom11_iodesc));
1da177e4 97 s3c24xx_init_uarts(otom11_uartcfgs, ARRAY_SIZE(otom11_uartcfgs));
7f78b6eb 98 samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
1da177e4
LT
99}
100
07ee5e7c
HS
101static void __init otom11_init_time(void)
102{
103 s3c2410_init_clocks(12000000);
104 samsung_timer_init();
105}
106
57e5171c
BD
107static void __init otom11_init(void)
108{
3e1b776c 109 s3c_i2c0_set_platdata(NULL);
673085f4
AB
110
111 /* Configure the I2S pins (GPE0...GPE4) in correct mode */
112 s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2),
113 S3C_GPIO_PULL_NONE);
57e5171c
BD
114 platform_add_devices(otom11_devices, ARRAY_SIZE(otom11_devices));
115}
1da177e4
LT
116
117MACHINE_START(OTOM, "Nex Vision - Otom 1.1")
e9dea0c6 118 /* Maintainer: Guillaume GOURAT <guillaume.gourat@nexvision.tv> */
69d50710 119 .atag_offset = 0x100,
1da177e4 120 .map_io = otom11_map_io,
57e5171c 121 .init_machine = otom11_init,
f182aa1d 122 .init_irq = s3c2410_init_irq,
07ee5e7c 123 .init_time = otom11_init_time,
1da177e4 124MACHINE_END