diff options
author | Marek Vasut <marex@denx.de> | 2012-07-07 09:21:38 -0400 |
---|---|---|
committer | Shawn Guo <shawn.guo@linaro.org> | 2012-07-10 23:49:41 -0400 |
commit | 8fa62e11283faa203b360c4ebdbd186b2c8dd844 (patch) | |
tree | cbf888b1a2371d063ec55190c6facd1964869460 /arch/arm/mach-mxs/mach-mxs.c | |
parent | 3dba2596730709fdec65491455a66a7df1ca67db (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>
Diffstat (limited to 'arch/arm/mach-mxs/mach-mxs.c')
-rw-r--r-- | arch/arm/mach-mxs/mach-mxs.c | 41 |
1 files changed, 37 insertions, 4 deletions
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 | ||
62 | static 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 | |||
62 | static struct mxsfb_platform_data mxsfb_pdata __initdata; | 79 | static struct mxsfb_platform_data mxsfb_pdata __initdata; |
63 | 80 | ||
64 | static struct of_dev_auxdata mxs_auxdata_lookup[] __initdata = { | 81 | static 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 | ||
189 | static void __init imx28_evk_init(void) | 206 | static 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 | ||
214 | static 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 | ||
225 | static 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 | |||
206 | static void __init mxs_machine_init(void) | 236 | static 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 | ||
224 | static const char *imx28_dt_compat[] __initdata = { | 256 | static 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, |