mx53cx9020_video.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // SPDX-License-Identifier: GPL-2.0+
  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.
  8. */
  9. #include <common.h>
  10. #include <linux/list.h>
  11. #include <asm/gpio.h>
  12. #include <asm/arch/iomux-mx53.h>
  13. #include <linux/fb.h>
  14. #include <ipu_pixfmt.h>
  15. #define CX9020_DVI_PWD IMX_GPIO_NR(6, 1)
  16. static struct fb_videomode const vga_640x480 = {
  17. .name = "VESA_VGA_640x480",
  18. .refresh = 60,
  19. .xres = 640,
  20. .yres = 480,
  21. .pixclock = 39721, /* picosecond (25.175 MHz) */
  22. .left_margin = 40,
  23. .right_margin = 60,
  24. .upper_margin = 10,
  25. .lower_margin = 10,
  26. .hsync_len = 20,
  27. .vsync_len = 10,
  28. .sync = 0,
  29. .vmode = FB_VMODE_NONINTERLACED
  30. };
  31. void setup_iomux_lcd(void)
  32. {
  33. /* Turn on DVI_PWD */
  34. imx_iomux_v3_setup_pad(MX53_PAD_CSI0_DAT15__GPIO6_1);
  35. gpio_direction_output(CX9020_DVI_PWD, 1);
  36. }
  37. int board_video_skip(void)
  38. {
  39. const int ret = ipuv3_fb_init(&vga_640x480, 0, IPU_PIX_FMT_RGB24);
  40. if (ret)
  41. printf("VESA VG 640x480 cannot be configured: %d\n", ret);
  42. return ret;
  43. }