aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabriel Fernandez <gabriel.fernandez@st.com>2013-06-12 10:35:34 -0400
committerLinus Walleij <linus.walleij@stericsson.com>2013-08-06 17:48:50 -0400
commit3d0899e8dab638dd00a7a36b8620ec80bb812fea (patch)
tree32174552af34debe9099d59dc24f58e1fb251a6e
parent49c129519a7a8840767321c38d2eaf84a263529b (diff)
ARM: u8540: Add Pinctrl Device Tree settings for uart0, uart2
This patch adds pinctrl device tree settings for uart0 and uart2 for ccu8540 board. Signed-off-by: Gabriel Fernandez <gabriel.fernandez@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--arch/arm/boot/dts/ccu8540-pinctrl.dtsi81
-rw-r--r--arch/arm/boot/dts/ccu8540.dts11
-rw-r--r--arch/arm/boot/dts/ste-nomadik-pinctrl.dtsi95
-rw-r--r--include/dt-bindings/pinctrl/nomadik.h36
4 files changed, 223 insertions, 0 deletions
diff --git a/arch/arm/boot/dts/ccu8540-pinctrl.dtsi b/arch/arm/boot/dts/ccu8540-pinctrl.dtsi
new file mode 100644
index 000000000000..644b189f8f72
--- /dev/null
+++ b/arch/arm/boot/dts/ccu8540-pinctrl.dtsi
@@ -0,0 +1,81 @@
1/*
2 * Copyright 2012 ST-Ericsson
3 *
4 * The code contained herein is licensed under the GNU General Public
5 * License. You may obtain a copy of the GNU General Public License
6 * Version 2 or later at the following locations:
7 *
8 * http://www.opensource.org/licenses/gpl-license.html
9 * http://www.gnu.org/copyleft/gpl.html
10 */
11#include "ste-nomadik-pinctrl.dtsi"
12
13/ {
14 soc {
15 pinctrl {
16 uart0 {
17 uart0_default_mux: uart0_mux {
18 default_mux {
19 ste,function = "u0";
20 ste,pins = "u0_a_1";
21 };
22 };
23
24 uart0_default_mode: uart0_default {
25 default_cfg1 {
26 ste,pins = "GPIO0", "GPIO2";
27 ste,config = <&in_pu>;
28 };
29
30 default_cfg2 {
31 ste,pins = "GPIO1", "GPIO3";
32 ste,config = <&out_hi>;
33 };
34 };
35
36 uart0_sleep_mode: uart0_sleep {
37 sleep_cfg1 {
38 ste,pins = "GPIO0", "GPIO2";
39 ste,config = <&slpm_in_pu>;
40 };
41
42 sleep_cfg2 {
43 ste,pins = "GPIO1", "GPIO3";
44 ste,config = <&slpm_out_hi>;
45 };
46 };
47 };
48
49 uart2 {
50 uart2_default_mode: uart2_default {
51 default_mux {
52 ste,function = "u2";
53 ste,pins = "u2txrx_a_1";
54 };
55
56 default_cfg1 {
57 ste,pins = "GPIO120";
58 ste,config = <&in_pu>;
59 };
60
61 default_cfg2 {
62 ste,pins = "GPIO121";
63 ste,config = <&out_hi>;
64 };
65 };
66
67 uart2_sleep_mode: uart2_sleep {
68 sleep_cfg1 {
69 ste,pins = "GPIO120";
70 ste,config = <&slpm_in_pu>;
71 };
72
73 sleep_cfg2 {
74 ste,pins = "GPIO121";
75 ste,config = <&slpm_out_hi>;
76 };
77 };
78 };
79 };
80 };
81};
diff --git a/arch/arm/boot/dts/ccu8540.dts b/arch/arm/boot/dts/ccu8540.dts
index 48ff03441f5a..3065fe4f60e5 100644
--- a/arch/arm/boot/dts/ccu8540.dts
+++ b/arch/arm/boot/dts/ccu8540.dts
@@ -11,6 +11,7 @@
11 11
12/dts-v1/; 12/dts-v1/;
13#include "dbx5x0.dtsi" 13#include "dbx5x0.dtsi"
14#include "ccu8540-pinctrl.dtsi"
14 15
15/ { 16/ {
16 model = "ST-Ericsson U8540 platform with Device Tree"; 17 model = "ST-Ericsson U8540 platform with Device Tree";
@@ -21,12 +22,19 @@
21 }; 22 };
22 23
23 soc { 24 soc {
25 pinctrl {
26 compatible = "stericsson,db8540-pinctrl";
27 };
28
24 prcmu@80157000 { 29 prcmu@80157000 {
25 reg = <0x80157000 0x2000>, <0x801b0000 0x8000>, <0x801b8000 0x3000>; 30 reg = <0x80157000 0x2000>, <0x801b0000 0x8000>, <0x801b8000 0x3000>;
26 reg-names = "prcmu", "prcmu-tcpm", "prcmu-tcdm"; 31 reg-names = "prcmu", "prcmu-tcpm", "prcmu-tcdm";
27 }; 32 };
28 33
29 uart@80120000 { 34 uart@80120000 {
35 pinctrl-names = "default", "sleep";
36 pinctrl-0 = <&uart0_default_mux>, <&uart0_default_mode>;
37 pinctrl-1 = <&uart0_sleep_mode>;
30 status = "okay"; 38 status = "okay";
31 }; 39 };
32 40
@@ -35,6 +43,9 @@
35 }; 43 };
36 44
37 uart@80007000 { 45 uart@80007000 {
46 pinctrl-names = "default", "sleep";
47 pinctrl-0 = <&uart2_default_mode>;
48 pinctrl-1 = <&uart2_sleep_mode>;
38 status = "okay"; 49 status = "okay";
39 }; 50 };
40 }; 51 };
diff --git a/arch/arm/boot/dts/ste-nomadik-pinctrl.dtsi b/arch/arm/boot/dts/ste-nomadik-pinctrl.dtsi
new file mode 100644
index 000000000000..efddee9403c4
--- /dev/null
+++ b/arch/arm/boot/dts/ste-nomadik-pinctrl.dtsi
@@ -0,0 +1,95 @@
1/*
2 * Copyright 2012 ST-Ericsson
3 *
4 * The code contained herein is licensed under the GNU General Public
5 * License. You may obtain a copy of the GNU General Public License
6 * Version 2 or later at the following locations:
7 *
8 * http://www.opensource.org/licenses/gpl-license.html
9 * http://www.gnu.org/copyleft/gpl.html
10 */
11#include <dt-bindings/pinctrl/nomadik.h>
12
13/ {
14 in_nopull: in_nopull {
15 ste,input = <INPUT_NOPULL>;
16 };
17
18 in_pu: input_pull_up {
19 ste,input = <INPUT_PULLUP>;
20 };
21
22 in_pd: input_pull_down {
23 ste,input = <INPUT_PULLDOWN>;
24 };
25
26 out_hi: output_high {
27 ste,output = <OUTPUT_HIGH>;
28 };
29
30 out_lo: output_low {
31 ste,output = <OUTPUT_LOW>;
32 };
33
34 gpio_out_lo: gpio_output_low {
35 ste,gpio = <GPIOMODE_ENABLED>;
36 ste,output = <OUTPUT_LOW>;
37 };
38
39 slpm_in_pu: slpm_in_pu {
40 ste,sleep = <SLPM_ENABLED>;
41 ste,sleep-input = <SLPM_INPUT_PULLUP>;
42 ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
43 };
44
45 slpm_in_wkup_pdis: slpm_in_wkup_pdis {
46 ste,sleep = <SLPM_ENABLED>;
47 ste,sleep-input = <SLPM_DIR_INPUT>;
48 ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
49 ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
50 };
51
52 slpm_out_lo: slpm_out_lo {
53 ste,sleep = <SLPM_ENABLED>;
54 ste,sleep-output = <SLPM_OUTPUT_LOW>;
55 ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
56 };
57
58 slpm_out_hi: slpm_out_hi {
59 ste,sleep = <SLPM_ENABLED>;
60 ste,sleep-output = <SLPM_OUTPUT_HIGH>;
61 ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
62 };
63
64 slpm_out_hi_wkup_pdis: slpm_out_hi_wkup_pdis {
65 ste,sleep = <SLPM_ENABLED>;
66 ste,sleep-output = <SLPM_OUTPUT_HIGH>;
67 ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
68 ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
69 };
70
71 slpm_out_wkup_pdis: slpm_out_wkup_pdis {
72 ste,sleep = <SLPM_ENABLED>;
73 ste,sleep-output = <SLPM_DIR_OUTPUT>;
74 ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
75 ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
76 };
77
78 in_wkup_pdis: in_wkup_pdis {
79 ste,sleep-input = <SLPM_DIR_INPUT>;
80 ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
81 ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
82 };
83
84 out_hi_wkup_pdis: out_hi_wkup_pdis {
85 ste,sleep-output = <SLPM_OUTPUT_HIGH>;
86 ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
87 ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
88 };
89
90 out_wkup_pdis: out_wkup_pdis {
91 ste,sleep-output = <SLPM_DIR_OUTPUT>;
92 ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
93 ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
94 };
95};
diff --git a/include/dt-bindings/pinctrl/nomadik.h b/include/dt-bindings/pinctrl/nomadik.h
new file mode 100644
index 000000000000..638fb321a1cb
--- /dev/null
+++ b/include/dt-bindings/pinctrl/nomadik.h
@@ -0,0 +1,36 @@
1/*
2 * nomadik.h
3 *
4 * Copyright (C) ST-Ericsson SA 2013
5 * Author: Gabriel Fernandez <gabriel.fernandez@st.com> for ST-Ericsson.
6 * License terms: GNU General Public License (GPL), version 2
7 */
8
9#define INPUT_NOPULL 0
10#define INPUT_PULLUP 1
11#define INPUT_PULLDOWN 2
12
13#define OUTPUT_LOW 0
14#define OUTPUT_HIGH 1
15#define DIR_OUTPUT 2
16
17#define SLPM_DISABLED 0
18#define SLPM_ENABLED 1
19
20#define SLPM_INPUT_NOPULL 0
21#define SLPM_INPUT_PULLUP 1
22#define SLPM_INPUT_PULLDOWN 2
23#define SLPM_DIR_INPUT 3
24
25#define SLPM_OUTPUT_LOW 0
26#define SLPM_OUTPUT_HIGH 1
27#define SLPM_DIR_OUTPUT 2
28
29#define SLPM_WAKEUP_DISABLE 0
30#define SLPM_WAKEUP_ENABLE 1
31
32#define GPIOMODE_DISABLED 0
33#define GPIOMODE_ENABLED 1
34
35#define SLPM_PDIS_DISABLED 0
36#define SLPM_PDIS_ENABLED 1