blob: b0623976b884b65a3d4d98af070976046c1b0ba5 [file] [log] [blame]
Kukjin Kimc05b48a2010-08-06 20:12:06 +09001/* linux/arch/arm/mach-s5pv310/mach-smdkc210.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>
Kukjin Kimc05b48a2010-08-06 20:12:06 +090021
22#include <mach/map.h>
23
24/* Following are default values for UCON, ULCON and UFCON UART registers */
25#define SMDKC210_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 SMDKC210_ULCON_DEFAULT S3C2410_LCON_CS8
33
34#define SMDKC210_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
35 S5PV210_UFCON_TXTRIG4 | \
36 S5PV210_UFCON_RXTRIG4)
37
38static struct s3c2410_uartcfg smdkc210_uartcfgs[] __initdata = {
39 [0] = {
40 .hwport = 0,
41 .flags = 0,
42 .ucon = SMDKC210_UCON_DEFAULT,
43 .ulcon = SMDKC210_ULCON_DEFAULT,
44 .ufcon = SMDKC210_UFCON_DEFAULT,
45 },
46 [1] = {
47 .hwport = 1,
48 .flags = 0,
49 .ucon = SMDKC210_UCON_DEFAULT,
50 .ulcon = SMDKC210_ULCON_DEFAULT,
51 .ufcon = SMDKC210_UFCON_DEFAULT,
52 },
53 [2] = {
54 .hwport = 2,
55 .flags = 0,
56 .ucon = SMDKC210_UCON_DEFAULT,
57 .ulcon = SMDKC210_ULCON_DEFAULT,
58 .ufcon = SMDKC210_UFCON_DEFAULT,
59 },
60 [3] = {
61 .hwport = 3,
62 .flags = 0,
63 .ucon = SMDKC210_UCON_DEFAULT,
64 .ulcon = SMDKC210_ULCON_DEFAULT,
65 .ufcon = SMDKC210_UFCON_DEFAULT,
66 },
67};
68
Changhwan Youncdff6e62010-09-20 15:25:51 +090069static struct platform_device *smdkc210_devices[] __initdata = {
70 &s3c_device_rtc,
Jemings Ko8d75c912010-09-20 15:33:04 +090071 &s3c_device_wdt,
Changhwan Youncdff6e62010-09-20 15:25:51 +090072};
73
Kukjin Kimc05b48a2010-08-06 20:12:06 +090074static void __init smdkc210_map_io(void)
75{
76 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
77 s3c24xx_init_clocks(24000000);
78 s3c24xx_init_uarts(smdkc210_uartcfgs, ARRAY_SIZE(smdkc210_uartcfgs));
79}
80
81static void __init smdkc210_machine_init(void)
82{
83#ifdef CONFIG_CACHE_L2X0
84 l2x0_init(S5P_VA_L2CC, 1 << 28, 0xffffffff);
85#endif
Changhwan Youncdff6e62010-09-20 15:25:51 +090086
87 platform_add_devices(smdkc210_devices, ARRAY_SIZE(smdkc210_devices));
Kukjin Kimc05b48a2010-08-06 20:12:06 +090088}
89
90MACHINE_START(SMDKC210, "SMDKC210")
91 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
92 .boot_params = S5P_PA_SDRAM + 0x100,
93 .init_irq = s5pv310_init_irq,
94 .map_io = smdkc210_map_io,
95 .init_machine = smdkc210_machine_init,
96 .timer = &s5pv310_timer,
97MACHINE_END