Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Patrick Bruenn | 98d62e6 | 2016-11-04 11:57:02 +0100 | [diff] [blame] | 2 | /* |
| 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 Bruenn | 98d62e6 | 2016-11-04 11:57:02 +0100 | [diff] [blame] | 8 | */ |
| 9 | |
| 10 | #include <common.h> |
Patrick Bruenn | 98d62e6 | 2016-11-04 11:57:02 +0100 | [diff] [blame] | 11 | #include <asm/arch/iomux-mx53.h> |
Steffen Dirkwinkel | 29771c2 | 2019-04-17 13:57:17 +0200 | [diff] [blame] | 12 | #include <asm/gpio.h> |
| 13 | #include <asm/mach-imx/video.h> |
Patrick Bruenn | 98d62e6 | 2016-11-04 11:57:02 +0100 | [diff] [blame] | 14 | |
| 15 | #define CX9020_DVI_PWD IMX_GPIO_NR(6, 1) |
| 16 | |
Steffen Dirkwinkel | 29771c2 | 2019-04-17 13:57:17 +0200 | [diff] [blame] | 17 | struct display_info_t const displays[] = {{ |
| 18 | .bus = -1, |
| 19 | .addr = 0, |
| 20 | .pixfmt = IPU_PIX_FMT_RGB24, |
| 21 | .detect = NULL, |
| 22 | .enable = NULL, |
| 23 | .mode = { |
| 24 | .name = "DVI", |
| 25 | .refresh = 60, |
| 26 | .xres = 640, |
| 27 | .yres = 480, |
| 28 | .pixclock = 39721, /* picosecond (25.175 MHz) */ |
| 29 | .left_margin = 40, |
| 30 | .right_margin = 60, |
| 31 | .upper_margin = 10, |
| 32 | .lower_margin = 10, |
| 33 | .hsync_len = 20, |
| 34 | .vsync_len = 10, |
| 35 | .sync = 0, |
| 36 | .vmode = FB_VMODE_NONINTERLACED |
| 37 | } } }; |
| 38 | size_t display_count = ARRAY_SIZE(displays); |
Patrick Bruenn | 98d62e6 | 2016-11-04 11:57:02 +0100 | [diff] [blame] | 39 | |
| 40 | void setup_iomux_lcd(void) |
| 41 | { |
| 42 | /* Turn on DVI_PWD */ |
| 43 | imx_iomux_v3_setup_pad(MX53_PAD_CSI0_DAT15__GPIO6_1); |
Steffen Dirkwinkel | 08cc54f | 2019-04-17 13:57:14 +0200 | [diff] [blame] | 44 | gpio_request(CX9020_DVI_PWD, "CX9020_DVI_PWD"); |
Patrick Bruenn | 98d62e6 | 2016-11-04 11:57:02 +0100 | [diff] [blame] | 45 | gpio_direction_output(CX9020_DVI_PWD, 1); |
| 46 | } |