aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorHeiko Stuebner <heiko@sntech.de>2013-05-20 12:06:04 -0400
committerKukjin Kim <kgene.kim@samsung.com>2013-05-20 12:06:12 -0400
commit35aca36450e6c3fb3b3fe9ea60a7c4689a219a87 (patch)
tree52d349e2a204db0ffee5bc718be9990ff58ee570 /arch
parentf722406faae2d073cc1d01063d1123c35425939e (diff)
ARM: dts: add devicetree support for s3c2416-smdk2416
Definitions in s3c24xx.dtsi are usable for all s3c24xx SoCs, but some need to be extended with proper compatible properties, as can be seen in s3c2416.dtsi. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/boot/dts/Makefile1
-rw-r--r--arch/arm/boot/dts/s3c2416-pinctrl.dtsi173
-rw-r--r--arch/arm/boot/dts/s3c2416-smdk2416.dts72
-rw-r--r--arch/arm/boot/dts/s3c2416.dtsi79
-rw-r--r--arch/arm/boot/dts/s3c24xx.dtsi92
-rw-r--r--arch/arm/mach-s3c24xx/Kconfig12
-rw-r--r--arch/arm/mach-s3c24xx/Makefile1
-rw-r--r--arch/arm/mach-s3c24xx/mach-s3c2416-dt.c91
8 files changed, 521 insertions, 0 deletions
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index b9f7121e6ecf..d5df15dc7009 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -159,6 +159,7 @@ dtb-$(CONFIG_ARCH_U8500) += snowball.dtb \
159 hrefprev60.dtb \ 159 hrefprev60.dtb \
160 hrefv60plus.dtb \ 160 hrefv60plus.dtb \
161 ccu9540.dtb 161 ccu9540.dtb
162dtb-$(CONFIG_ARCH_S3C24XX) += s3c2416-smdk2416.dtb
162dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \ 163dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \
163 r8a7740-armadillo800eva.dtb \ 164 r8a7740-armadillo800eva.dtb \
164 r8a7778-bockw.dtb \ 165 r8a7778-bockw.dtb \
diff --git a/arch/arm/boot/dts/s3c2416-pinctrl.dtsi b/arch/arm/boot/dts/s3c2416-pinctrl.dtsi
new file mode 100644
index 000000000000..527e3193817f
--- /dev/null
+++ b/arch/arm/boot/dts/s3c2416-pinctrl.dtsi
@@ -0,0 +1,173 @@
1/*
2 * Samsung S3C2416 pinctrl settings
3 *
4 * Copyright (c) 2013 Heiko Stuebner <heiko@sntech.de>
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&pinctrl_0 {
12 /*
13 * Pin banks
14 */
15
16 gpa: gpa {
17 gpio-controller;
18 #gpio-cells = <2>;
19 };
20
21 gpb: gpb {
22 gpio-controller;
23 #gpio-cells = <2>;
24 };
25
26 gpc: gpc {
27 gpio-controller;
28 #gpio-cells = <2>;
29 };
30
31 gpd: gpd {
32 gpio-controller;
33 #gpio-cells = <2>;
34 };
35
36 gpe: gpe {
37 gpio-controller;
38 #gpio-cells = <2>;
39 };
40
41 gpf: gpf {
42 gpio-controller;
43 #gpio-cells = <2>;
44 interrupt-controller;
45 #interrupt-cells = <2>;
46 };
47
48 gpg: gpg {
49 gpio-controller;
50 #gpio-cells = <2>;
51 interrupt-controller;
52 #interrupt-cells = <2>;
53 };
54
55 gph: gph {
56 gpio-controller;
57 #gpio-cells = <2>;
58 };
59
60 gpj: gpj {
61 gpio-controller;
62 #gpio-cells = <2>;
63 };
64
65 gpk: gpk {
66 gpio-controller;
67 #gpio-cells = <2>;
68 };
69
70 gpl: gpl {
71 gpio-controller;
72 #gpio-cells = <2>;
73 };
74
75 gpm: gpm {
76 gpio-controller;
77 #gpio-cells = <2>;
78 };
79
80 /*
81 * Pin groups
82 */
83
84 uart0_data: uart0-data {
85 samsung,pins = "gph-0", "gph-1";
86 samsung,pin-function = <2>;
87 };
88
89 uart0_fctl: uart0-fctl {
90 samsung,pins = "gph-8", "gph-9";
91 samsung,pin-function = <2>;
92 };
93
94 uart1_data: uart1-data {
95 samsung,pins = "gph-2", "gph-3";
96 samsung,pin-function = <2>;
97 };
98
99 uart1_fctl: uart1-fctl {
100 samsung,pins = "gph-10", "gph-11";
101 samsung,pin-function = <2>;
102 };
103
104 uart2_data: uart2-data {
105 samsung,pins = "gph-4", "gph-5";
106 samsung,pin-function = <2>;
107 };
108
109 uart2_fctl: uart2-fctl {
110 samsung,pins = "gph-6", "gph-7";
111 samsung,pin-function = <2>;
112 };
113
114 uart3_data: uart3-data {
115 samsung,pins = "gph-6", "gph-7";
116 samsung,pin-function = <2>;
117 };
118
119 extuart_clk: extuart-clk {
120 samsung,pins = "gph-12";
121 samsung,pin-function = <2>;
122 };
123
124 i2c0_bus: i2c0-bus {
125 samsung,pins = "gpe-14", "gpe-15";
126 samsung,pin-function = <2>;
127 };
128
129 spi0_bus: spi0-bus {
130 samsung,pins = "gpe-11", "gpe-12", "gpe-13";
131 samsung,pin-function = <2>;
132 };
133
134 sd0_clk: sd0-clk {
135 samsung,pins = "gpe-5";
136 samsung,pin-function = <2>;
137 };
138
139 sd0_cmd: sd0-cmd {
140 samsung,pins = "gpe-6";
141 samsung,pin-function = <2>;
142 };
143
144 sd0_bus1: sd0-bus1 {
145 samsung,pins = "gpe-7";
146 samsung,pin-function = <2>;
147 };
148
149 sd0_bus4: sd0-bus4 {
150 samsung,pins = "gpe-8", "gpe-9", "gpe-10";
151 samsung,pin-function = <2>;
152 };
153
154 sd1_cmd: sd1-cmd {
155 samsung,pins = "gpl-8";
156 samsung,pin-function = <2>;
157 };
158
159 sd1_clk: sd1-clk {
160 samsung,pins = "gpl-9";
161 samsung,pin-function = <2>;
162 };
163
164 sd1_bus1: sd1-bus1 {
165 samsung,pins = "gpl-0";
166 samsung,pin-function = <2>;
167 };
168
169 sd1_bus4: sd1-bus4 {
170 samsung,pins = "gpl-1", "gpl-2", "gpl-3";
171 samsung,pin-function = <2>;
172 };
173};
diff --git a/arch/arm/boot/dts/s3c2416-smdk2416.dts b/arch/arm/boot/dts/s3c2416-smdk2416.dts
new file mode 100644
index 000000000000..ad1dd09c10eb
--- /dev/null
+++ b/arch/arm/boot/dts/s3c2416-smdk2416.dts
@@ -0,0 +1,72 @@
1/*
2 * SAMSUNG SMDK2416 board device tree source
3 *
4 * Copyright (c) 2013 Heiko Stuebner <heiko@sntech.de>
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/dts-v1/;
12/include/ "s3c2416.dtsi"
13
14/ {
15 model = "SMDK2416";
16 compatible = "samsung,s3c2416";
17
18 memory {
19 reg = <0x30000000 0x4000000>;
20 };
21
22 serial@50000000 {
23 status = "okay";
24 pinctrl-names = "default";
25 pinctrl-0 = <&uart0_data>, <&uart0_fctl>;
26 };
27
28 serial@50004000 {
29 status = "okay";
30 pinctrl-names = "default";
31 pinctrl-0 = <&uart1_data>, <&uart1_fctl>;
32 };
33
34 serial@50008000 {
35 status = "okay";
36 pinctrl-names = "default";
37 pinctrl-0 = <&uart2_data>;
38 };
39
40 serial@5000C000 {
41 status = "okay";
42 pinctrl-names = "default";
43 pinctrl-0 = <&uart3_data>;
44 };
45
46 watchdog@53000000 {
47 status = "okay";
48 };
49
50 rtc@57000000 {
51 status = "okay";
52 };
53
54 sdhci@4AC00000 {
55 pinctrl-names = "default";
56 pinctrl-0 = <&sd0_clk>, <&sd0_cmd>,
57 <&sd0_bus1>, <&sd0_bus4>;
58 bus-width = <4>;
59 cd-gpios = <&gpf 1 0>;
60 cd-inverted;
61 status = "okay";
62 };
63
64 sdhci@4A800000 {
65 pinctrl-names = "default";
66 pinctrl-0 = <&sd1_clk>, <&sd1_cmd>,
67 <&sd1_bus1>, <&sd1_bus4>;
68 bus-width = <4>;
69 broken-cd;
70 status = "okay";
71 };
72};
diff --git a/arch/arm/boot/dts/s3c2416.dtsi b/arch/arm/boot/dts/s3c2416.dtsi
new file mode 100644
index 000000000000..6809324934a3
--- /dev/null
+++ b/arch/arm/boot/dts/s3c2416.dtsi
@@ -0,0 +1,79 @@
1/*
2 * Samsung's S3C2416 SoC device tree source
3 *
4 * Copyright (c) 2013 Heiko Stuebner <heiko@sntech.de>
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/ "s3c24xx.dtsi"
12/include/ "s3c2416-pinctrl.dtsi"
13
14/ {
15 model = "Samsung S3C2416 SoC";
16 compatible = "samsung,s3c2416";
17
18 cpus {
19 #address-cells = <1>;
20 #size-cells = <0>;
21
22 cpu {
23 compatible = "arm,arm926ejs";
24 };
25 };
26
27 interrupt-controller@4a000000 {
28 compatible = "samsung,s3c2416-irq";
29 };
30
31 pinctrl@56000000 {
32 compatible = "samsung,s3c2416-pinctrl";
33 };
34
35 serial@50000000 {
36 compatible = "samsung,s3c2440-uart";
37 };
38
39 serial@50004000 {
40 compatible = "samsung,s3c2440-uart";
41 };
42
43 serial@50008000 {
44 compatible = "samsung,s3c2440-uart";
45 };
46
47 serial@5000C000 {
48 compatible = "samsung,s3c2440-uart";
49 reg = <0x5000C000 0x4000>;
50 interrupts = <1 18 24 4>, <1 18 25 4>;
51 status = "disabled";
52 };
53
54 sdhci@4AC00000 {
55 compatible = "samsung,s3c6410-sdhci";
56 reg = <0x4AC00000 0x100>;
57 interrupts = <0 0 21 3>;
58 status = "disabled";
59 };
60
61 sdhci@4A800000 {
62 compatible = "samsung,s3c6410-sdhci";
63 reg = <0x4A800000 0x100>;
64 interrupts = <0 0 20 3>;
65 status = "disabled";
66 };
67
68 watchdog@53000000 {
69 interrupts = <1 9 27 3>;
70 };
71
72 rtc@57000000 {
73 compatible = "samsung,s3c2416-rtc";
74 };
75
76 i2c@54000000 {
77 compatible = "samsung,s3c2440-i2c";
78 };
79};
diff --git a/arch/arm/boot/dts/s3c24xx.dtsi b/arch/arm/boot/dts/s3c24xx.dtsi
new file mode 100644
index 000000000000..cab46ff5fb4d
--- /dev/null
+++ b/arch/arm/boot/dts/s3c24xx.dtsi
@@ -0,0 +1,92 @@
1/*
2 * Samsung's S3C24XX family device tree source
3 *
4 * Copyright (c) 2013 Heiko Stuebner <heiko@sntech.de>
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/ "skeleton.dtsi"
12
13/ {
14 compatible = "samsung,s3c24xx";
15 interrupt-parent = <&intc>;
16
17 aliases {
18 pinctrl0 = &pinctrl_0;
19 };
20
21 intc:interrupt-controller@4a000000 {
22 compatible = "samsung,s3c2410-irq";
23 reg = <0x4a000000 0x100>;
24 interrupt-controller;
25 #interrupt-cells = <4>;
26 };
27
28 pinctrl_0: pinctrl@56000000 {
29 reg = <0x56000000 0x1000>;
30
31 wakeup-interrupt-controller {
32 compatible = "samsung,s3c2410-wakeup-eint";
33 interrupts = <0 0 0 3>,
34 <0 0 1 3>,
35 <0 0 2 3>,
36 <0 0 3 3>,
37 <0 0 4 4>,
38 <0 0 5 4>;
39 };
40 };
41
42 timer@51000000 {
43 compatible = "samsung,s3c2410-pwm";
44 reg = <0x51000000 0x1000>;
45 interrupts = <0 0 10 3>, <0 0 11 3>, <0 0 12 3>, <0 0 13 3>, <0 0 14 3>;
46 #pwm-cells = <4>;
47 };
48
49 serial@50000000 {
50 compatible = "samsung,s3c2410-uart";
51 reg = <0x50000000 0x4000>;
52 interrupts = <1 28 0 4>, <1 28 1 4>;
53 status = "disabled";
54 };
55
56 serial@50004000 {
57 compatible = "samsung,s3c2410-uart";
58 reg = <0x50004000 0x4000>;
59 interrupts = <1 23 3 4>, <1 23 4 4>;
60 status = "disabled";
61 };
62
63 serial@50008000 {
64 compatible = "samsung,s3c2410-uart";
65 reg = <0x50008000 0x4000>;
66 interrupts = <1 15 6 4>, <1 15 7 4>;
67 status = "disabled";
68 };
69
70 watchdog@53000000 {
71 compatible = "samsung,s3c2410-wdt";
72 reg = <0x53000000 0x100>;
73 interrupts = <0 0 9 3>;
74 status = "disabled";
75 };
76
77 rtc@57000000 {
78 compatible = "samsung,s3c2410-rtc";
79 reg = <0x57000000 0x100>;
80 interrupts = <0 0 30 3>, <0 0 8 3>;
81 status = "disabled";
82 };
83
84 i2c@54000000 {
85 compatible = "samsung,s3c2410-i2c";
86 reg = <0x54000000 0x100>;
87 interrupts = <0 0 27 3>;
88 #address-cells = <1>;
89 #size-cells = <0>;
90 status = "disabled";
91 };
92};
diff --git a/arch/arm/mach-s3c24xx/Kconfig b/arch/arm/mach-s3c24xx/Kconfig
index f2f7088bfd22..e52d5e42af4e 100644
--- a/arch/arm/mach-s3c24xx/Kconfig
+++ b/arch/arm/mach-s3c24xx/Kconfig
@@ -490,6 +490,18 @@ config MACH_SMDK2416
490 help 490 help
491 Say Y here if you are using an SMDK2416 491 Say Y here if you are using an SMDK2416
492 492
493config MACH_S3C2416_DT
494 bool "Samsung S3C2416 machine using devicetree"
495 select CLKSRC_OF
496 select USE_OF
497 select PINCTRL
498 select PINCTRL_S3C24XX
499 help
500 Machine support for Samsung S3C2416 machines with device tree enabled.
501 Select this if a fdt blob is available for the S3C2416 SoC based board.
502 Note: This is under development and not all peripherals can be supported
503 with this machine file.
504
493endif # CPU_S3C2416 505endif # CPU_S3C2416
494 506
495if CPU_S3C2440 507if CPU_S3C2440
diff --git a/arch/arm/mach-s3c24xx/Makefile b/arch/arm/mach-s3c24xx/Makefile
index 6f46ecfc8396..6de730bada4d 100644
--- a/arch/arm/mach-s3c24xx/Makefile
+++ b/arch/arm/mach-s3c24xx/Makefile
@@ -85,6 +85,7 @@ obj-$(CONFIG_MACH_SMDK2413) += mach-smdk2413.o
85obj-$(CONFIG_MACH_VSTMS) += mach-vstms.o 85obj-$(CONFIG_MACH_VSTMS) += mach-vstms.o
86 86
87obj-$(CONFIG_MACH_SMDK2416) += mach-smdk2416.o 87obj-$(CONFIG_MACH_SMDK2416) += mach-smdk2416.o
88obj-$(CONFIG_MACH_S3C2416_DT) += mach-s3c2416-dt.o
88 89
89obj-$(CONFIG_MACH_ANUBIS) += mach-anubis.o 90obj-$(CONFIG_MACH_ANUBIS) += mach-anubis.o
90obj-$(CONFIG_MACH_AT2440EVB) += mach-at2440evb.o 91obj-$(CONFIG_MACH_AT2440EVB) += mach-at2440evb.o
diff --git a/arch/arm/mach-s3c24xx/mach-s3c2416-dt.c b/arch/arm/mach-s3c24xx/mach-s3c2416-dt.c
new file mode 100644
index 000000000000..f5c9072e1e35
--- /dev/null
+++ b/arch/arm/mach-s3c24xx/mach-s3c2416-dt.c
@@ -0,0 +1,91 @@
1/*
2 * Samsung's S3C2416 flattened device tree enabled machine
3 *
4 * Copyright (c) 2012 Heiko Stuebner <heiko@sntech.de>
5 *
6 * based on mach-exynos/mach-exynos4-dt.c
7 *
8 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
9 * http://www.samsung.com
10 * Copyright (c) 2010-2011 Linaro Ltd.
11 * www.linaro.org
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License version 2 as
15 * published by the Free Software Foundation.
16*/
17
18#include <linux/clocksource.h>
19#include <linux/irqchip.h>
20#include <linux/of_platform.h>
21#include <linux/serial_core.h>
22
23#include <asm/mach/arch.h>
24#include <mach/map.h>
25
26#include <plat/cpu.h>
27#include <plat/pm.h>
28#include <plat/regs-serial.h>
29
30#include "common.h"
31
32/*
33 * The following lookup table is used to override device names when devices
34 * are registered from device tree. This is temporarily added to enable
35 * device tree support addition for the S3C2416 architecture.
36 *
37 * For drivers that require platform data to be provided from the machine
38 * file, a platform data pointer can also be supplied along with the
39 * devices names. Usually, the platform data elements that cannot be parsed
40 * from the device tree by the drivers (example: function pointers) are
41 * supplied. But it should be noted that this is a temporary mechanism and
42 * at some point, the drivers should be capable of parsing all the platform
43 * data from the device tree.
44 */
45static const struct of_dev_auxdata s3c2416_auxdata_lookup[] __initconst = {
46 OF_DEV_AUXDATA("samsung,s3c2440-uart", S3C2410_PA_UART0,
47 "s3c2440-uart.0", NULL),
48 OF_DEV_AUXDATA("samsung,s3c2440-uart", S3C2410_PA_UART1,
49 "s3c2440-uart.1", NULL),
50 OF_DEV_AUXDATA("samsung,s3c2440-uart", S3C2410_PA_UART2,
51 "s3c2440-uart.2", NULL),
52 OF_DEV_AUXDATA("samsung,s3c2440-uart", S3C2443_PA_UART3,
53 "s3c2440-uart.3", NULL),
54 OF_DEV_AUXDATA("samsung,s3c6410-sdhci", S3C_PA_HSMMC0,
55 "s3c-sdhci.0", NULL),
56 OF_DEV_AUXDATA("samsung,s3c6410-sdhci", S3C_PA_HSMMC1,
57 "s3c-sdhci.1", NULL),
58 OF_DEV_AUXDATA("samsung,s3c2440-i2c", S3C_PA_IIC,
59 "s3c2440-i2c.0", NULL),
60 {},
61};
62
63static void __init s3c2416_dt_map_io(void)
64{
65 s3c24xx_init_io(NULL, 0);
66 s3c24xx_init_clocks(12000000);
67}
68
69static void __init s3c2416_dt_machine_init(void)
70{
71 of_platform_populate(NULL, of_default_bus_match_table,
72 s3c2416_auxdata_lookup, NULL);
73
74 s3c_pm_init();
75}
76
77static char const *s3c2416_dt_compat[] __initdata = {
78 "samsung,s3c2416",
79 "samsung,s3c2450",
80 NULL
81};
82
83DT_MACHINE_START(S3C2416_DT, "Samsung S3C2416 (Flattened Device Tree)")
84 /* Maintainer: Heiko Stuebner <heiko@sntech.de> */
85 .dt_compat = s3c2416_dt_compat,
86 .map_io = s3c2416_dt_map_io,
87 .init_irq = irqchip_init,
88 .init_machine = s3c2416_dt_machine_init,
89 .init_time = clocksource_of_init,
90 .restart = s3c2416_restart,
91MACHINE_END