summaryrefslogtreecommitdiffstats
path: root/board/gateworks
diff options
context:
space:
mode:
authorTim Harvey <tharvey@gateworks.com>2015-04-08 12:55:01 -0700
committerStefano Babic <sbabic@denx.de>2015-04-22 14:39:12 +0200
commita2559f113cd43ef46bcebf79bbc35158af9e7260 (patch)
tree7c9a2557243e50d9410e9da47776d2ab8bc679f1 /board/gateworks
parente9fc6d137bc302c89a2d9395be1a9a4b05f75a74 (diff)
downloadblackbird-obmc-uboot-a2559f113cd43ef46bcebf79bbc35158af9e7260.tar.gz
blackbird-obmc-uboot-a2559f113cd43ef46bcebf79bbc35158af9e7260.zip
imx: ventana: use hdmiinfmt env var to override HDMI capture format
The HDMI receiver used on the GW54xx and GW551x has a 16bit video data bus interconnect between it and the IMX6 CSI. This can be used in two different modes, each having advantages and disadvantages. Allow the hdmiinfmt env var to specify which format is desired (yuv422smp or yuv422bt656). Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Diffstat (limited to 'board/gateworks')
-rw-r--r--board/gateworks/gw_ventana/gw_ventana.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/board/gateworks/gw_ventana/gw_ventana.c b/board/gateworks/gw_ventana/gw_ventana.c
index 50a2a9adf0..e6da3d515a 100644
--- a/board/gateworks/gw_ventana/gw_ventana.c
+++ b/board/gateworks/gw_ventana/gw_ventana.c
@@ -1580,6 +1580,42 @@ int misc_init_r(void)
#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
+static int ft_sethdmiinfmt(void *blob, char *mode)
+{
+ int off;
+
+ if (!mode)
+ return -EINVAL;
+
+ off = fdt_node_offset_by_compatible(blob, -1, "nxp,tda1997x");
+ if (off < 0)
+ return off;
+
+ if (0 == strcasecmp(mode, "yuv422bt656")) {
+ u8 cfg[] = { 0x00, 0x00, 0x00, 0x82, 0x81, 0x00,
+ 0x00, 0x00, 0x00 };
+ mode = "422_ccir";
+ fdt_setprop(blob, off, "vidout_fmt", mode, strlen(mode) + 1);
+ fdt_setprop_u32(blob, off, "vidout_trc", 1);
+ fdt_setprop_u32(blob, off, "vidout_blc", 1);
+ fdt_setprop(blob, off, "vidout_portcfg", cfg, sizeof(cfg));
+ printf(" set HDMI input mode to %s\n", mode);
+ } else if (0 == strcasecmp(mode, "yuv422smp")) {
+ u8 cfg[] = { 0x00, 0x00, 0x00, 0x88, 0x87, 0x00,
+ 0x82, 0x81, 0x00 };
+ mode = "422_smp";
+ fdt_setprop(blob, off, "vidout_fmt", mode, strlen(mode) + 1);
+ fdt_setprop_u32(blob, off, "vidout_trc", 0);
+ fdt_setprop_u32(blob, off, "vidout_blc", 0);
+ fdt_setprop(blob, off, "vidout_portcfg", cfg, sizeof(cfg));
+ printf(" set HDMI input mode to %s\n", mode);
+ } else {
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
/*
* called prior to booting kernel or by 'fdt boardsetup' command
*
@@ -1640,6 +1676,9 @@ int ft_board_setup(void *blob, bd_t *bd)
fdt_setprop(blob, 0, "board", info->model,
strlen((const char *)info->model) + 1);
+ /* set desired digital video capture format */
+ ft_sethdmiinfmt(blob, getenv("hdmiinfmt"));
+
/*
* disable serial2 node for GW54xx for compatibility with older
* 3.10.x kernel that improperly had this node enabled in the DT
OpenPOWER on IntegriCloud