blob: bdbbddb803d542bea0d38639c857de5c797f455e [file] [log] [blame]
Ben Dooks431107e2010-01-26 10:11:04 +09001/* linux/arch/arm/mach-s3c64xx/mach-smdk6400.c
Ben Dooks2ab408e2009-03-24 16:09:06 +00002 *
3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10*/
11
12#include <linux/kernel.h>
13#include <linux/types.h>
14#include <linux/interrupt.h>
15#include <linux/list.h>
16#include <linux/timer.h>
17#include <linux/init.h>
18#include <linux/serial_core.h>
19#include <linux/platform_device.h>
20#include <linux/i2c.h>
21#include <linux/io.h>
22
23#include <asm/mach-types.h>
24
25#include <asm/mach/arch.h>
26#include <asm/mach/map.h>
27#include <asm/mach/irq.h>
28
29#include <mach/hardware.h>
30#include <mach/map.h>
31
32#include <plat/regs-serial.h>
33
Ben Dooks2ab408e2009-03-24 16:09:06 +000034#include <plat/clock.h>
35#include <plat/devs.h>
36#include <plat/cpu.h>
Arnd Bergmann436d42c2012-08-24 15:22:12 +020037#include <linux/platform_data/i2c-s3c2410.h>
Linus Walleij41c35482013-12-06 12:46:27 +010038#include <linux/platform_data/gpio-samsung-s3c64xx.h>
Romain Naour04a49b72013-01-09 18:47:04 -080039#include <plat/samsung-time.h>
Ben Dooks2ab408e2009-03-24 16:09:06 +000040
Kukjin Kimb024043b2011-12-22 23:27:42 +010041#include "common.h"
42
Ben Dooks2ab408e2009-03-24 16:09:06 +000043#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
44#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
45#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
46
47static struct s3c2410_uartcfg smdk6400_uartcfgs[] __initdata = {
48 [0] = {
49 .hwport = 0,
50 .flags = 0,
51 .ucon = 0x3c5,
52 .ulcon = 0x03,
53 .ufcon = 0x51,
54 },
55 [1] = {
56 .hwport = 1,
57 .flags = 0,
58 .ucon = 0x3c5,
59 .ulcon = 0x03,
60 .ufcon = 0x51,
61 },
62};
63
64static struct map_desc smdk6400_iodesc[] = {};
65
66static void __init smdk6400_map_io(void)
67{
68 s3c64xx_init_io(smdk6400_iodesc, ARRAY_SIZE(smdk6400_iodesc));
Tomasz Figab69f4602013-08-26 02:00:38 +090069 s3c64xx_set_xtal_freq(12000000);
Ben Dooks2ab408e2009-03-24 16:09:06 +000070 s3c24xx_init_uarts(smdk6400_uartcfgs, ARRAY_SIZE(smdk6400_uartcfgs));
Romain Naour04a49b72013-01-09 18:47:04 -080071 samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
Ben Dooks2ab408e2009-03-24 16:09:06 +000072}
73
74static struct platform_device *smdk6400_devices[] __initdata = {
75 &s3c_device_hsmmc1,
76 &s3c_device_i2c0,
77};
78
79static struct i2c_board_info i2c_devs[] __initdata = {
Ben Dooks19e3f482009-04-23 17:26:15 +010080 { I2C_BOARD_INFO("wm8753", 0x1A), },
Ben Dooks2ab408e2009-03-24 16:09:06 +000081 { I2C_BOARD_INFO("24c08", 0x50), },
82};
83
84static void __init smdk6400_machine_init(void)
85{
86 i2c_register_board_info(0, i2c_devs, ARRAY_SIZE(i2c_devs));
87 platform_add_devices(smdk6400_devices, ARRAY_SIZE(smdk6400_devices));
88}
89
90MACHINE_START(SMDK6400, "SMDK6400")
Ben Dooksafdd2252010-05-07 09:24:05 +090091 /* Maintainer: Ben Dooks <ben-linux@fluff.org> */
Nicolas Pitre170a5902011-07-05 22:38:17 -040092 .atag_offset = 0x100,
Ben Dooks2ab408e2009-03-24 16:09:06 +000093
94 .init_irq = s3c6400_init_irq,
Ben Dooks2ab408e2009-03-24 16:09:06 +000095 .map_io = smdk6400_map_io,
96 .init_machine = smdk6400_machine_init,
Shawn Guocc8f2522012-04-26 21:08:52 +080097 .init_late = s3c64xx_init_late,
Romain Naour04a49b72013-01-09 18:47:04 -080098 .init_time = samsung_timer_init,
Kukjin Kimff84ded2012-01-03 14:03:30 +010099 .restart = s3c64xx_restart,
Ben Dooks2ab408e2009-03-24 16:09:06 +0000100MACHINE_END