blob: 27dd6605e395d42a95989885ec2db906fd4b1084 [file] [log] [blame]
Ben Dooksa21765a2007-02-11 18:31:01 +01001/* linux/arch/arm/mach-s3c2410/mach-smdk2410.c
Linus Torvalds1da177e2005-04-16 15:20:36 -07002 *
3 * linux/arch/arm/mach-s3c2410/mach-smdk2410.c
4 *
5 * Copyright (C) 2004 by FS Forth-Systeme GmbH
6 * All rights reserved.
7 *
Linus Torvalds1da177e2005-04-16 15:20:36 -07008 * @Author: Jonas Dietsche
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of
13 * the License, or (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
23 * MA 02111-1307 USA
24 *
25 * @History:
26 * derived from linux/arch/arm/mach-s3c2410/mach-bast.c, written by
27 * Ben Dooks <ben@simtec.co.uk>
28 *
Linus Torvalds1da177e2005-04-16 15:20:36 -070029 ***********************************************************************/
30
31#include <linux/kernel.h>
32#include <linux/types.h>
33#include <linux/interrupt.h>
34#include <linux/list.h>
35#include <linux/timer.h>
36#include <linux/init.h>
Ben Dooksb6d1f542006-12-17 23:22:26 +010037#include <linux/serial_core.h>
Tushar Behera334a1c72014-02-14 10:32:45 +090038#include <linux/serial_s3c.h>
Russell Kingd052d1b2005-10-29 19:07:23 +010039#include <linux/platform_device.h>
Russell Kingfced80c2008-09-06 12:10:45 +010040#include <linux/io.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070041
42#include <asm/mach/arch.h>
43#include <asm/mach/map.h>
44#include <asm/mach/irq.h>
45
Russell Kinga09e64f2008-08-05 16:14:15 +010046#include <mach/hardware.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070047#include <asm/irq.h>
48#include <asm/mach-types.h>
49
Arnd Bergmann436d42c2012-08-24 15:22:12 +020050#include <linux/platform_data/i2c-s3c2410.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070051
Ben Dooksa2b7ba92008-10-07 22:26:09 +010052#include <plat/devs.h>
53#include <plat/cpu.h>
Romain Naour7f78b6e2013-01-09 18:47:04 -080054#include <plat/samsung-time.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070055
Kukjin Kimb27b0722012-01-03 14:02:03 +010056#include "common.h"
Kukjin Kim4d512a92013-02-08 10:18:48 -080057#include "common-smdk.h"
Kukjin Kimb27b0722012-01-03 14:02:03 +010058
Linus Torvalds1da177e2005-04-16 15:20:36 -070059static struct map_desc smdk2410_iodesc[] __initdata = {
60 /* nothing here yet */
61};
62
63#define UCON S3C2410_UCON_DEFAULT
64#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
65#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
66
Ben Dooks66a9b492006-06-18 23:04:05 +010067static struct s3c2410_uartcfg smdk2410_uartcfgs[] __initdata = {
Linus Torvalds1da177e2005-04-16 15:20:36 -070068 [0] = {
69 .hwport = 0,
70 .flags = 0,
71 .ucon = UCON,
72 .ulcon = ULCON,
73 .ufcon = UFCON,
74 },
75 [1] = {
76 .hwport = 1,
77 .flags = 0,
78 .ucon = UCON,
79 .ulcon = ULCON,
80 .ufcon = UFCON,
81 },
82 [2] = {
83 .hwport = 2,
84 .flags = 0,
85 .ucon = UCON,
86 .ulcon = ULCON,
87 .ufcon = UFCON,
88 }
89};
90
91static struct platform_device *smdk2410_devices[] __initdata = {
Ben Dooksb8132482009-11-23 00:13:39 +000092 &s3c_device_ohci,
Linus Torvalds1da177e2005-04-16 15:20:36 -070093 &s3c_device_lcd,
94 &s3c_device_wdt,
Ben Dooks3e1b7762008-10-31 16:14:40 +000095 &s3c_device_i2c0,
Linus Torvalds1da177e2005-04-16 15:20:36 -070096 &s3c_device_iis,
97};
98
Ben Dooks5fe10ab2005-09-20 17:24:33 +010099static void __init smdk2410_map_io(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700100{
101 s3c24xx_init_io(smdk2410_iodesc, ARRAY_SIZE(smdk2410_iodesc));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700102 s3c24xx_init_uarts(smdk2410_uartcfgs, ARRAY_SIZE(smdk2410_uartcfgs));
Romain Naour7f78b6e2013-01-09 18:47:04 -0800103 samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
Ben Dooks57e51712007-04-20 11:19:16 +0100104}
105
Heiko Stuebner07ee5e72014-05-09 05:49:29 +0900106static void __init smdk2410_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 smdk2410_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(smdk2410_devices, ARRAY_SIZE(smdk2410_devices));
116 smdk_machine_init();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700117}
118
Linus Torvalds1da177e2005-04-16 15:20:36 -0700119MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switch
120 * to SMDK2410 */
Russell Kinge9dea0c2005-07-03 17:38:58 +0100121 /* Maintainer: Jonas Dietsche */
Nicolas Pitre69d50712011-07-05 22:38:17 -0400122 .atag_offset = 0x100,
Russell Kinge9dea0c2005-07-03 17:38:58 +0100123 .map_io = smdk2410_map_io,
Heiko Stuebnerf182aa12013-03-07 12:38:19 +0900124 .init_irq = s3c2410_init_irq,
Ben Dooks57e51712007-04-20 11:19:16 +0100125 .init_machine = smdk2410_init,
Heiko Stuebner07ee5e72014-05-09 05:49:29 +0900126 .init_time = smdk2410_init_time,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700127MACHINE_END