blob: cbd16843c7d14a3fb325372d4beaae3321efe4cb [file] [log] [blame]
Krzysztof Kozlowski28a196f2017-12-25 20:54:33 +01001// SPDX-License-Identifier: GPL-2.0
2//
3// Copyright 2008 Simtec Electronics
4// Ben Dooks <ben@simtec.co.uk>
5// http://armlinux.simtec.co.uk/
Ben Dooks2ab408e2009-03-24 16:09:06 +00006
7#include <linux/kernel.h>
8#include <linux/types.h>
9#include <linux/interrupt.h>
10#include <linux/list.h>
11#include <linux/timer.h>
12#include <linux/init.h>
13#include <linux/serial_core.h>
Tushar Behera334a1c72014-02-14 10:32:45 +090014#include <linux/serial_s3c.h>
Ben Dooks2ab408e2009-03-24 16:09:06 +000015#include <linux/platform_device.h>
16#include <linux/i2c.h>
17#include <linux/io.h>
18
19#include <asm/mach-types.h>
20
21#include <asm/mach/arch.h>
22#include <asm/mach/map.h>
23#include <asm/mach/irq.h>
24
Arnd Bergmannba279042015-02-27 22:06:58 +010025#include <mach/irqs.h>
Ben Dooks2ab408e2009-03-24 16:09:06 +000026#include <mach/hardware.h>
27#include <mach/map.h>
28
Ben Dooks2ab408e2009-03-24 16:09:06 +000029#include <plat/devs.h>
30#include <plat/cpu.h>
Arnd Bergmann436d42c2012-08-24 15:22:12 +020031#include <linux/platform_data/i2c-s3c2410.h>
Linus Walleijb0161ca2014-01-14 14:24:24 +010032#include <mach/gpio-samsung.h>
Romain Naour04a49b72013-01-09 18:47:04 -080033#include <plat/samsung-time.h>
Ben Dooks2ab408e2009-03-24 16:09:06 +000034
Kukjin Kimb024043b2011-12-22 23:27:42 +010035#include "common.h"
36
Ben Dooks2ab408e2009-03-24 16:09:06 +000037#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
38#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
39#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
40
41static struct s3c2410_uartcfg smdk6400_uartcfgs[] __initdata = {
42 [0] = {
43 .hwport = 0,
44 .flags = 0,
45 .ucon = 0x3c5,
46 .ulcon = 0x03,
47 .ufcon = 0x51,
48 },
49 [1] = {
50 .hwport = 1,
51 .flags = 0,
52 .ucon = 0x3c5,
53 .ulcon = 0x03,
54 .ufcon = 0x51,
55 },
56};
57
58static struct map_desc smdk6400_iodesc[] = {};
59
60static void __init smdk6400_map_io(void)
61{
62 s3c64xx_init_io(smdk6400_iodesc, ARRAY_SIZE(smdk6400_iodesc));
Tomasz Figab69f4602013-08-26 02:00:38 +090063 s3c64xx_set_xtal_freq(12000000);
Ben Dooks2ab408e2009-03-24 16:09:06 +000064 s3c24xx_init_uarts(smdk6400_uartcfgs, ARRAY_SIZE(smdk6400_uartcfgs));
Romain Naour04a49b72013-01-09 18:47:04 -080065 samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
Ben Dooks2ab408e2009-03-24 16:09:06 +000066}
67
68static struct platform_device *smdk6400_devices[] __initdata = {
69 &s3c_device_hsmmc1,
70 &s3c_device_i2c0,
71};
72
73static struct i2c_board_info i2c_devs[] __initdata = {
Ben Dooks19e3f482009-04-23 17:26:15 +010074 { I2C_BOARD_INFO("wm8753", 0x1A), },
Ben Dooks2ab408e2009-03-24 16:09:06 +000075 { I2C_BOARD_INFO("24c08", 0x50), },
76};
77
78static void __init smdk6400_machine_init(void)
79{
80 i2c_register_board_info(0, i2c_devs, ARRAY_SIZE(i2c_devs));
81 platform_add_devices(smdk6400_devices, ARRAY_SIZE(smdk6400_devices));
82}
83
84MACHINE_START(SMDK6400, "SMDK6400")
Ben Dooksafdd2252010-05-07 09:24:05 +090085 /* Maintainer: Ben Dooks <ben-linux@fluff.org> */
Nicolas Pitre170a5902011-07-05 22:38:17 -040086 .atag_offset = 0x100,
Arnd Bergmannba279042015-02-27 22:06:58 +010087 .nr_irqs = S3C64XX_NR_IRQS,
Ben Dooks2ab408e2009-03-24 16:09:06 +000088 .init_irq = s3c6400_init_irq,
Ben Dooks2ab408e2009-03-24 16:09:06 +000089 .map_io = smdk6400_map_io,
90 .init_machine = smdk6400_machine_init,
Romain Naour04a49b72013-01-09 18:47:04 -080091 .init_time = samsung_timer_init,
Kukjin Kimff84ded2012-01-03 14:03:30 +010092 .restart = s3c64xx_restart,
Ben Dooks2ab408e2009-03-24 16:09:06 +000093MACHINE_END