aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2012-07-07 09:21:38 -0400
committerShawn Guo <shawn.guo@linaro.org>2012-07-10 23:49:41 -0400
commit8fa62e11283faa203b360c4ebdbd186b2c8dd844 (patch)
treecbf888b1a2371d063ec55190c6facd1964869460
parent3dba2596730709fdec65491455a66a7df1ca67db (diff)
ARM: mxs: convert m28evk board to device tree
Signed-off-by: Marek Vasut <marex@denx.de> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
-rw-r--r--arch/arm/boot/dts/imx28.dtsi11
-rw-r--r--arch/arm/boot/dts/m28evk.dts210
-rw-r--r--arch/arm/mach-mxs/mach-mxs.c41
3 files changed, 258 insertions, 4 deletions
diff --git a/arch/arm/boot/dts/imx28.dtsi b/arch/arm/boot/dts/imx28.dtsi
index 02e778b30fc8..895a07264210 100644
--- a/arch/arm/boot/dts/imx28.dtsi
+++ b/arch/arm/boot/dts/imx28.dtsi
@@ -232,6 +232,17 @@
232 fsl,pull-up = <0>; 232 fsl,pull-up = <0>;
233 }; 233 };
234 234
235 auart0_2pins_a: auart0-2pins@0 {
236 reg = <0>;
237 fsl,pinmux-ids = <
238 0x3000 /* MX28_PAD_AUART0_RX__AUART0_RX */
239 0x3010 /* MX28_PAD_AUART0_TX__AUART0_TX */
240 >;
241 fsl,drive-strength = <0>;
242 fsl,voltage = <1>;
243 fsl,pull-up = <0>;
244 };
245
235 auart3_pins_a: auart3@0 { 246 auart3_pins_a: auart3@0 {
236 reg = <0>; 247 reg = <0>;
237 fsl,pinmux-ids = < 248 fsl,pinmux-ids = <
diff --git a/arch/arm/boot/dts/m28evk.dts b/arch/arm/boot/dts/m28evk.dts
new file mode 100644
index 000000000000..183a3fd2d859
--- /dev/null
+++ b/arch/arm/boot/dts/m28evk.dts
@@ -0,0 +1,210 @@
1/*
2 * Copyright (C) 2012 Marek Vasut <marex@denx.de>
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
12/dts-v1/;
13/include/ "imx28.dtsi"
14
15/ {
16 model = "DENX M28EVK";
17 compatible = "denx,m28evk", "fsl,imx28";
18
19 memory {
20 reg = <0x40000000 0x08000000>;
21 };
22
23 apb@80000000 {
24 apbh@80000000 {
25 gpmi-nand@8000c000 {
26 pinctrl-names = "default";
27 pinctrl-0 = <&gpmi_pins_a &gpmi_status_cfg>;
28 status = "okay";
29
30 partition@0 {
31 label = "bootloader";
32 reg = <0x00000000 0x00300000>;
33 read-only;
34 };
35
36 partition@1 {
37 label = "environment";
38 reg = <0x00300000 0x00080000>;
39 };
40
41 partition@2 {
42 label = "redundant-environment";
43 reg = <0x00380000 0x00080000>;
44 };
45
46 partition@3 {
47 label = "kernel";
48 reg = <0x00400000 0x00400000>;
49 };
50
51 partition@4 {
52 label = "filesystem";
53 reg = <0x00800000 0x0f800000>;
54 };
55 };
56
57 ssp0: ssp@80010000 {
58 compatible = "fsl,imx28-mmc";
59 pinctrl-names = "default";
60 pinctrl-0 = <&mmc0_8bit_pins_a
61 &mmc0_cd_cfg
62 &mmc0_sck_cfg>;
63 bus-width = <8>;
64 wp-gpios = <&gpio3 10 1>;
65 status = "okay";
66 };
67
68 pinctrl@80018000 {
69 pinctrl-names = "default";
70 pinctrl-0 = <&hog_pins_a>;
71
72 hog_pins_a: hog-gpios@0 {
73 reg = <0>;
74 fsl,pinmux-ids = <
75 0x30a3 /* MX28_PAD_AUART2_CTS__GPIO_3_10 */
76 0x30b3 /* MX28_PAD_AUART2_RTS__GPIO_3_11 */
77 >;
78 fsl,drive-strength = <0>;
79 fsl,voltage = <1>;
80 fsl,pull-up = <0>;
81 };
82
83 lcdif_pins_m28: lcdif-m28@0 {
84 reg = <0>;
85 fsl,pinmux-ids = <
86 0x11e0 /* MX28_PAD_LCD_DOTCLK__LCD_DOTCLK */
87 0x11f0 /* MX28_PAD_LCD_ENABLE__LCD_ENABLE */
88 >;
89 fsl,drive-strength = <0>;
90 fsl,voltage = <1>;
91 fsl,pull-up = <0>;
92 };
93 };
94
95 lcdif@80030000 {
96 pinctrl-names = "default";
97 pinctrl-0 = <&lcdif_24bit_pins_a
98 &lcdif_pins_m28>;
99 status = "okay";
100 };
101
102 can0: can@80032000 {
103 pinctrl-names = "default";
104 pinctrl-0 = <&can0_pins_a>;
105 status = "okay";
106 };
107
108 can1: can@80034000 {
109 pinctrl-names = "default";
110 pinctrl-0 = <&can1_pins_a>;
111 status = "okay";
112 };
113 };
114
115 apbx@80040000 {
116 saif0: saif@80042000 {
117 pinctrl-names = "default";
118 pinctrl-0 = <&saif0_pins_a>;
119 status = "okay";
120 };
121
122 saif1: saif@80046000 {
123 pinctrl-names = "default";
124 pinctrl-0 = <&saif1_pins_a>;
125 fsl,saif-master = <&saif0>;
126 status = "okay";
127 };
128
129 i2c0: i2c@80058000 {
130 pinctrl-names = "default";
131 pinctrl-0 = <&i2c0_pins_a>;
132 status = "okay";
133
134 sgtl5000: codec@0a {
135 compatible = "fsl,sgtl5000";
136 reg = <0x0a>;
137 VDDA-supply = <&reg_3p3v>;
138 VDDIO-supply = <&reg_3p3v>;
139
140 };
141
142 eeprom: eeprom@51 {
143 compatible = "atmel,24c128";
144 reg = <0x51>;
145 pagesize = <32>;
146 };
147
148 rtc: rtc@68 {
149 compatible = "stm,mt41t62";
150 reg = <0x68>;
151 };
152 };
153
154 duart: serial@80074000 {
155 pinctrl-names = "default";
156 pinctrl-0 = <&duart_pins_a>;
157 status = "okay";
158 };
159
160 auart0: serial@8006a000 {
161 pinctrl-names = "default";
162 pinctrl-0 = <&auart0_2pins_a>;
163 status = "okay";
164 };
165
166 auart3: serial@80070000 {
167 pinctrl-names = "default";
168 pinctrl-0 = <&auart3_pins_a>;
169 status = "okay";
170 };
171 };
172 };
173
174 ahb@80080000 {
175 mac0: ethernet@800f0000 {
176 phy-mode = "rmii";
177 pinctrl-names = "default";
178 pinctrl-0 = <&mac0_pins_a>;
179 phy-reset-gpios = <&gpio3 11 0>;
180 status = "okay";
181 };
182
183 mac1: ethernet@800f4000 {
184 phy-mode = "rmii";
185 pinctrl-names = "default";
186 pinctrl-0 = <&mac1_pins_a>;
187 status = "okay";
188 };
189 };
190
191 regulators {
192 compatible = "simple-bus";
193
194 reg_3p3v: 3p3v {
195 compatible = "regulator-fixed";
196 regulator-name = "3P3V";
197 regulator-min-microvolt = <3300000>;
198 regulator-max-microvolt = <3300000>;
199 regulator-always-on;
200 };
201 };
202
203 sound {
204 compatible = "denx,m28evk-sgtl5000",
205 "fsl,mxs-audio-sgtl5000";
206 model = "m28evk-sgtl5000";
207 saif-controllers = <&saif0 &saif1>;
208 audio-codec = <&sgtl5000>;
209 };
210};
diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c
index 7bbb961cc52d..d3fc8ba9d759 100644
--- a/arch/arm/mach-mxs/mach-mxs.c
+++ b/arch/arm/mach-mxs/mach-mxs.c
@@ -59,6 +59,23 @@ static struct fb_videomode mx28evk_video_modes[] = {
59 }, 59 },
60}; 60};
61 61
62static struct fb_videomode m28evk_video_modes[] = {
63 {
64 .name = "Ampire AM-800480R2TMQW-T01H",
65 .refresh = 60,
66 .xres = 800,
67 .yres = 480,
68 .pixclock = 30066, /* picosecond (33.26 MHz) */
69 .left_margin = 0,
70 .right_margin = 256,
71 .upper_margin = 0,
72 .lower_margin = 45,
73 .hsync_len = 1,
74 .vsync_len = 1,
75 .sync = FB_SYNC_DATA_ENABLE_HIGH_ACT,
76 },
77};
78
62static struct mxsfb_platform_data mxsfb_pdata __initdata; 79static struct mxsfb_platform_data mxsfb_pdata __initdata;
63 80
64static struct of_dev_auxdata mxs_auxdata_lookup[] __initdata = { 81static struct of_dev_auxdata mxs_auxdata_lookup[] __initdata = {
@@ -186,15 +203,17 @@ static void __init imx23_evk_init(void)
186 mxsfb_pdata.ld_intf_width = STMLCDIF_24BIT; 203 mxsfb_pdata.ld_intf_width = STMLCDIF_24BIT;
187} 204}
188 205
189static void __init imx28_evk_init(void) 206static inline void enable_clk_enet_out(void)
190{ 207{
191 struct clk *clk; 208 struct clk *clk = clk_get_sys("enet_out", NULL);
192 209
193 /* Enable fec phy clock */
194 clk = clk_get_sys("enet_out", NULL);
195 if (!IS_ERR(clk)) 210 if (!IS_ERR(clk))
196 clk_prepare_enable(clk); 211 clk_prepare_enable(clk);
212}
197 213
214static void __init imx28_evk_init(void)
215{
216 enable_clk_enet_out();
198 update_fec_mac_prop(OUI_FSL); 217 update_fec_mac_prop(OUI_FSL);
199 218
200 mxsfb_pdata.mode_list = mx28evk_video_modes; 219 mxsfb_pdata.mode_list = mx28evk_video_modes;
@@ -203,12 +222,25 @@ static void __init imx28_evk_init(void)
203 mxsfb_pdata.ld_intf_width = STMLCDIF_24BIT; 222 mxsfb_pdata.ld_intf_width = STMLCDIF_24BIT;
204} 223}
205 224
225static void __init m28evk_init(void)
226{
227 enable_clk_enet_out();
228 update_fec_mac_prop(OUI_DENX);
229
230 mxsfb_pdata.mode_list = m28evk_video_modes;
231 mxsfb_pdata.mode_count = ARRAY_SIZE(m28evk_video_modes);
232 mxsfb_pdata.default_bpp = 16;
233 mxsfb_pdata.ld_intf_width = STMLCDIF_18BIT;
234}
235
206static void __init mxs_machine_init(void) 236static void __init mxs_machine_init(void)
207{ 237{
208 if (of_machine_is_compatible("fsl,imx28-evk")) 238 if (of_machine_is_compatible("fsl,imx28-evk"))
209 imx28_evk_init(); 239 imx28_evk_init();
210 else if (of_machine_is_compatible("fsl,imx23-evk")) 240 else if (of_machine_is_compatible("fsl,imx23-evk"))
211 imx23_evk_init(); 241 imx23_evk_init();
242 else if (of_machine_is_compatible("denx,m28evk"))
243 m28evk_init();
212 244
213 of_platform_populate(NULL, of_default_bus_match_table, 245 of_platform_populate(NULL, of_default_bus_match_table,
214 mxs_auxdata_lookup, NULL); 246 mxs_auxdata_lookup, NULL);
@@ -223,6 +255,7 @@ static const char *imx23_dt_compat[] __initdata = {
223 255
224static const char *imx28_dt_compat[] __initdata = { 256static const char *imx28_dt_compat[] __initdata = {
225 "crystalfontz,cfa10036", 257 "crystalfontz,cfa10036",
258 "denx,m28evk",
226 "fsl,imx28-evk", 259 "fsl,imx28-evk",
227 "fsl,imx28", 260 "fsl,imx28",
228 NULL, 261 NULL,