Commit | Line | Data |
---|---|---|
28a196fe KK |
1 | // 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/ | |
2ab408e8 BD |
6 | |
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> | |
334a1c70 | 14 | #include <linux/serial_s3c.h> |
2ab408e8 BD |
15 | #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 | ||
c78a41fc | 25 | #include "irqs.h" |
c6ff132d | 26 | #include "map.h" |
2ab408e8 | 27 | |
c6ff132d AB |
28 | #include "devs.h" |
29 | #include "cpu.h" | |
436d42c6 | 30 | #include <linux/platform_data/i2c-s3c2410.h> |
c6ff132d | 31 | #include "gpio-samsung.h" |
2ab408e8 | 32 | |
71b9114d | 33 | #include "s3c64xx.h" |
b024043b | 34 | |
2ab408e8 BD |
35 | #define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK |
36 | #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB | |
37 | #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE | |
38 | ||
39 | static struct s3c2410_uartcfg smdk6400_uartcfgs[] __initdata = { | |
40 | [0] = { | |
41 | .hwport = 0, | |
42 | .flags = 0, | |
43 | .ucon = 0x3c5, | |
44 | .ulcon = 0x03, | |
45 | .ufcon = 0x51, | |
46 | }, | |
47 | [1] = { | |
48 | .hwport = 1, | |
49 | .flags = 0, | |
50 | .ucon = 0x3c5, | |
51 | .ulcon = 0x03, | |
52 | .ufcon = 0x51, | |
53 | }, | |
54 | }; | |
55 | ||
56 | static struct map_desc smdk6400_iodesc[] = {}; | |
57 | ||
58 | static void __init smdk6400_map_io(void) | |
59 | { | |
60 | s3c64xx_init_io(smdk6400_iodesc, ARRAY_SIZE(smdk6400_iodesc)); | |
b69f460d | 61 | s3c64xx_set_xtal_freq(12000000); |
2ab408e8 | 62 | s3c24xx_init_uarts(smdk6400_uartcfgs, ARRAY_SIZE(smdk6400_uartcfgs)); |
a1342f6a | 63 | s3c64xx_set_timer_source(S3C64XX_PWM3, S3C64XX_PWM4); |
2ab408e8 BD |
64 | } |
65 | ||
66 | static struct platform_device *smdk6400_devices[] __initdata = { | |
67 | &s3c_device_hsmmc1, | |
68 | &s3c_device_i2c0, | |
69 | }; | |
70 | ||
71 | static struct i2c_board_info i2c_devs[] __initdata = { | |
19e3f485 | 72 | { I2C_BOARD_INFO("wm8753", 0x1A), }, |
2ab408e8 BD |
73 | { I2C_BOARD_INFO("24c08", 0x50), }, |
74 | }; | |
75 | ||
76 | static void __init smdk6400_machine_init(void) | |
77 | { | |
78 | i2c_register_board_info(0, i2c_devs, ARRAY_SIZE(i2c_devs)); | |
79 | platform_add_devices(smdk6400_devices, ARRAY_SIZE(smdk6400_devices)); | |
80 | } | |
81 | ||
82 | MACHINE_START(SMDK6400, "SMDK6400") | |
afdd225d | 83 | /* Maintainer: Ben Dooks <ben-linux@fluff.org> */ |
170a5908 | 84 | .atag_offset = 0x100, |
ba279044 | 85 | .nr_irqs = S3C64XX_NR_IRQS, |
2ab408e8 BD |
86 | .init_irq = s3c6400_init_irq, |
87 | .map_io = smdk6400_map_io, | |
88 | .init_machine = smdk6400_machine_init, | |
a1342f6a | 89 | .init_time = s3c64xx_timer_init, |
2ab408e8 | 90 | MACHINE_END |