blob: 06062c8e337c53e9321cd2a2d958d532500fb67f [file] [log] [blame]
Changhwan Younb1d69cc2010-07-16 12:18:36 +09001/* linux/arch/arm/mach-s5pv310/mach-smdkv310.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
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#include <linux/serial_core.h>
12
13#include <asm/mach/arch.h>
14#include <asm/mach-types.h>
15#include <asm/hardware/cache-l2x0.h>
16
17#include <plat/regs-serial.h>
18#include <plat/s5pv310.h>
19#include <plat/cpu.h>
Changhwan Youncdff6e62010-09-20 15:25:51 +090020#include <plat/devs.h>
Changhwan Younb1d69cc2010-07-16 12:18:36 +090021
22#include <mach/map.h>
23
24/* Following are default values for UCON, ULCON and UFCON UART registers */
25#define SMDKV310_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
26 S3C2410_UCON_RXILEVEL | \
27 S3C2410_UCON_TXIRQMODE | \
28 S3C2410_UCON_RXIRQMODE | \
29 S3C2410_UCON_RXFIFO_TOI | \
30 S3C2443_UCON_RXERR_IRQEN)
31
32#define SMDKV310_ULCON_DEFAULT S3C2410_LCON_CS8
33
34#define SMDKV310_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
35 S5PV210_UFCON_TXTRIG4 | \
36 S5PV210_UFCON_RXTRIG4)
37
38static struct s3c2410_uartcfg smdkv310_uartcfgs[] __initdata = {
39 [0] = {
40 .hwport = 0,
41 .flags = 0,
42 .ucon = SMDKV310_UCON_DEFAULT,
43 .ulcon = SMDKV310_ULCON_DEFAULT,
44 .ufcon = SMDKV310_UFCON_DEFAULT,
45 },
46 [1] = {
47 .hwport = 1,
48 .flags = 0,
49 .ucon = SMDKV310_UCON_DEFAULT,
50 .ulcon = SMDKV310_ULCON_DEFAULT,
51 .ufcon = SMDKV310_UFCON_DEFAULT,
52 },
53 [2] = {
54 .hwport = 2,
55 .flags = 0,
56 .ucon = SMDKV310_UCON_DEFAULT,
57 .ulcon = SMDKV310_ULCON_DEFAULT,
58 .ufcon = SMDKV310_UFCON_DEFAULT,
59 },
60 [3] = {
61 .hwport = 3,
62 .flags = 0,
63 .ucon = SMDKV310_UCON_DEFAULT,
64 .ulcon = SMDKV310_ULCON_DEFAULT,
65 .ufcon = SMDKV310_UFCON_DEFAULT,
66 },
67};
68
Changhwan Youncdff6e62010-09-20 15:25:51 +090069static struct platform_device *smdkv310_devices[] __initdata = {
70 &s3c_device_rtc,
71};
72
Changhwan Younb1d69cc2010-07-16 12:18:36 +090073static void __init smdkv310_map_io(void)
74{
75 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
76 s3c24xx_init_clocks(24000000);
77 s3c24xx_init_uarts(smdkv310_uartcfgs, ARRAY_SIZE(smdkv310_uartcfgs));
78}
79
80static void __init smdkv310_machine_init(void)
81{
82#ifdef CONFIG_CACHE_L2X0
83 l2x0_init(S5P_VA_L2CC, 1 << 28, 0xffffffff);
84#endif
Changhwan Youncdff6e62010-09-20 15:25:51 +090085
86 platform_add_devices(smdkv310_devices, ARRAY_SIZE(smdkv310_devices));
Changhwan Younb1d69cc2010-07-16 12:18:36 +090087}
88
89MACHINE_START(SMDKV310, "SMDKV310")
90 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
91 /* Maintainer: Changhwan Youn <chaos.youn@samsung.com> */
92 .phys_io = S3C_PA_UART & 0xfff00000,
93 .io_pg_offst = (((u32)S3C_VA_UART) >> 18) & 0xfffc,
94 .boot_params = S5P_PA_SDRAM + 0x100,
95 .init_irq = s5pv310_init_irq,
96 .map_io = smdkv310_map_io,
97 .init_machine = smdkv310_machine_init,
98 .timer = &s5pv310_timer,
99MACHINE_END