blob: 85f1cdae8af567b407148a460aa174915a1dbc3e [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Patrick Bruennba81b042016-11-04 11:57:02 +01002/*
3 * Copyright (C) 2015 Beckhoff Automation GmbH & Co. KG
4 * Patrick Bruenn <p.bruenn@beckhoff.com>
5 *
6 * Based on <u-boot>/board/freescale/mx53loco/mx53loco_video.c
7 * Copyright (C) 2012 Freescale Semiconductor, Inc.
Patrick Bruennba81b042016-11-04 11:57:02 +01008 */
9
10#include <common.h>
11#include <linux/list.h>
12#include <asm/gpio.h>
13#include <asm/arch/iomux-mx53.h>
14#include <linux/fb.h>
15#include <ipu_pixfmt.h>
16
17#define CX9020_DVI_PWD IMX_GPIO_NR(6, 1)
18
19static struct fb_videomode const vga_640x480 = {
20 .name = "VESA_VGA_640x480",
21 .refresh = 60,
22 .xres = 640,
23 .yres = 480,
24 .pixclock = 39721, /* picosecond (25.175 MHz) */
25 .left_margin = 40,
26 .right_margin = 60,
27 .upper_margin = 10,
28 .lower_margin = 10,
29 .hsync_len = 20,
30 .vsync_len = 10,
31 .sync = 0,
32 .vmode = FB_VMODE_NONINTERLACED
33};
34
35void setup_iomux_lcd(void)
36{
37 /* Turn on DVI_PWD */
38 imx_iomux_v3_setup_pad(MX53_PAD_CSI0_DAT15__GPIO6_1);
Steffen Dirkwinkel098e9ef2019-04-17 13:57:14 +020039 gpio_request(CX9020_DVI_PWD, "CX9020_DVI_PWD");
Patrick Bruennba81b042016-11-04 11:57:02 +010040 gpio_direction_output(CX9020_DVI_PWD, 1);
41}
42
43int board_video_skip(void)
44{
45 const int ret = ipuv3_fb_init(&vga_640x480, 0, IPU_PIX_FMT_RGB24);
46 if (ret)
47 printf("VESA VG 640x480 cannot be configured: %d\n", ret);
48 return ret;
49}