2 * Copyright (C) 2012 Freescale Semiconductor, Inc.
3 * Fabio Estevam <fabio.estevam@freescale.com>
5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
25 #include <linux/list.h>
27 #include <asm/arch/iomux.h>
29 #include <ipu_pixfmt.h>
31 #define MX53LOCO_LCD_POWER IMX_GPIO_NR(3, 24)
33 static struct fb_videomode const claa_wvga = {
34 .name = "CLAA07LC0ACW",
46 .vmode = FB_VMODE_NONINTERLACED
49 static struct fb_videomode const seiko_wvga = {
50 .name = "Seiko-43WVF1G",
54 .pixclock = 29851, /* picosecond (33.5 MHz) */
64 void setup_iomux_lcd(void)
66 mxc_request_iomux(MX53_PIN_DI0_DISP_CLK, IOMUX_CONFIG_ALT0);
67 mxc_request_iomux(MX53_PIN_DI0_PIN15, IOMUX_CONFIG_ALT0);
68 mxc_request_iomux(MX53_PIN_DI0_PIN2, IOMUX_CONFIG_ALT0);
69 mxc_request_iomux(MX53_PIN_DI0_PIN3, IOMUX_CONFIG_ALT0);
70 mxc_request_iomux(MX53_PIN_DISP0_DAT0, IOMUX_CONFIG_ALT0);
71 mxc_request_iomux(MX53_PIN_DISP0_DAT1, IOMUX_CONFIG_ALT0);
72 mxc_request_iomux(MX53_PIN_DISP0_DAT2, IOMUX_CONFIG_ALT0);
73 mxc_request_iomux(MX53_PIN_DISP0_DAT3, IOMUX_CONFIG_ALT0);
74 mxc_request_iomux(MX53_PIN_DISP0_DAT4, IOMUX_CONFIG_ALT0);
75 mxc_request_iomux(MX53_PIN_DISP0_DAT5, IOMUX_CONFIG_ALT0);
76 mxc_request_iomux(MX53_PIN_DISP0_DAT6, IOMUX_CONFIG_ALT0);
77 mxc_request_iomux(MX53_PIN_DISP0_DAT7, IOMUX_CONFIG_ALT0);
78 mxc_request_iomux(MX53_PIN_DISP0_DAT8, IOMUX_CONFIG_ALT0);
79 mxc_request_iomux(MX53_PIN_DISP0_DAT9, IOMUX_CONFIG_ALT0);
80 mxc_request_iomux(MX53_PIN_DISP0_DAT10, IOMUX_CONFIG_ALT0);
81 mxc_request_iomux(MX53_PIN_DISP0_DAT11, IOMUX_CONFIG_ALT0);
82 mxc_request_iomux(MX53_PIN_DISP0_DAT12, IOMUX_CONFIG_ALT0);
83 mxc_request_iomux(MX53_PIN_DISP0_DAT13, IOMUX_CONFIG_ALT0);
84 mxc_request_iomux(MX53_PIN_DISP0_DAT14, IOMUX_CONFIG_ALT0);
85 mxc_request_iomux(MX53_PIN_DISP0_DAT15, IOMUX_CONFIG_ALT0);
86 mxc_request_iomux(MX53_PIN_DISP0_DAT16, IOMUX_CONFIG_ALT0);
87 mxc_request_iomux(MX53_PIN_DISP0_DAT17, IOMUX_CONFIG_ALT0);
88 mxc_request_iomux(MX53_PIN_DISP0_DAT18, IOMUX_CONFIG_ALT0);
89 mxc_request_iomux(MX53_PIN_DISP0_DAT19, IOMUX_CONFIG_ALT0);
90 mxc_request_iomux(MX53_PIN_DISP0_DAT20, IOMUX_CONFIG_ALT0);
91 mxc_request_iomux(MX53_PIN_DISP0_DAT21, IOMUX_CONFIG_ALT0);
92 mxc_request_iomux(MX53_PIN_DISP0_DAT22, IOMUX_CONFIG_ALT0);
93 mxc_request_iomux(MX53_PIN_DISP0_DAT23, IOMUX_CONFIG_ALT0);
95 /* Turn on GPIO backlight */
96 mxc_request_iomux(MX53_PIN_EIM_D24, IOMUX_CONFIG_ALT1);
97 gpio_direction_output(MX53LOCO_LCD_POWER, 1);
99 /* Turn on display contrast */
100 mxc_request_iomux(MX53_PIN_GPIO_1, IOMUX_CONFIG_ALT1);
101 gpio_direction_output(IOMUX_TO_GPIO(MX53_PIN_GPIO_1), 1);
104 int board_video_skip(void)
107 char const *e = getenv("panel");
110 if (strcmp(e, "seiko") == 0) {
111 ret = ipuv3_fb_init(&seiko_wvga, 0, IPU_PIX_FMT_RGB24);
113 printf("Seiko cannot be configured: %d\n", ret);
119 * 'panel' env variable not found or has different value than 'seiko'
120 * Defaulting to claa lcd.
122 ret = ipuv3_fb_init(&claa_wvga, 0, IPU_PIX_FMT_RGB565);
124 printf("CLAA cannot be configured: %d\n", ret);