On 09/22/2012 10:19 AM, Eric Nelson wrote:
On 09/22/2012 10:02 AM, Fabio Estevam wrote:
Hi Eric,

On Sat, Sep 22, 2012 at 1:51 PM, Eric Nelson
<eric.nel...@boundarydevices.com> wrote:

Interestingly, I saw U-Boot display on HDMI during my testing,
so I'm pretty certain that all we need is the HDMI transmitter
initialization sequence.

Excellent, could you please share the HDMI transmitter init sequence?


Hi Fabio,

I haven't worked through the details, but I'm sure they're in here ;)

https://github.com/boundarydevices/linux-imx6/blob/boundary-L3.0.35_MX6DQ_ER_1208-Beta/drivers/video/mxc_hdmi.c


This may be easier than I thought (a set of writes to a single register).

I did a little digging, and it seems that the power-on defaults for the
HDMI transmitter work pretty well with my display (many thanks to the
chip designers!).

Without some more digging, I'm not very confident that the clocks
are all getting set up properly, but the attached patch allows me
to get 1080P video over HDMI.

It also highlights some issues in the I2C detection structure
(two parallel arrays that I hacked), but it gives me a lot more
confidence that HDMI is achievable in the short term for at least
one display.

Regards,


Eric
diff --git a/board/freescale/mx6qsabrelite/mx6qsabrelite.c b/board/freescale/mx6qsabrelite/mx6qsabrelite.c
index ed60c6d..d274bad 100644
--- a/board/freescale/mx6qsabrelite/mx6qsabrelite.c
+++ b/board/freescale/mx6qsabrelite/mx6qsabrelite.c
@@ -39,6 +39,7 @@
 #include <linux/fb.h>
 #include <ipu_pixfmt.h>
 #include <asm/arch/crm_regs.h>
+#include <asm/arch/mxc_hdmi.h>
 #include <i2c.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -379,6 +380,20 @@ int setup_sata(void)
 
 #if defined(CONFIG_VIDEO_IPUV3)
 static struct fb_videomode videomodes[] = {{
+		.name           = "HDMI",
+		.refresh        = 60,
+		.xres           = 1920,
+		.yres           = 1080,
+		.pixclock       = 7692,
+		.left_margin    = 100,
+		.right_margin   = 40,
+		.upper_margin   = 30,
+		.lower_margin   = 3,
+		.hsync_len      = 10,
+		.vsync_len      = 2,
+		.sync           = FB_SYNC_EXT, /* a.k.a. LVDS or HDMI */
+		.vmode          = FB_VMODE_NONINTERLACED
+	}, {
 		.name           = "Hannstar-XGA",
 		.refresh        = 60,
 		.xres           = 1024,
@@ -427,22 +442,33 @@ static struct fb_videomode videomodes[] = {{
 struct i2c_display {
 	int bus;
 	int addr;
+	int pixfmt;
 	char const *name;
 };
 
+#define IS_HDMI(d) (0 > (d).bus)
+
 static struct i2c_display const i2c_displays[] = {
 {
+	.bus		= -1,
+	.addr		= -1,
+	.name           = "HDMI",
+	.pixfmt		= IPU_PIX_FMT_RGB24,
+}, {
 	.bus		= 2,
 	.addr		= 0x4,
 	.name           = "Hannstar-XGA",
+	.pixfmt		= IPU_PIX_FMT_LVDS666,
 }, {
 	.bus		= 2,
 	.addr		= 0x38,
 	.name           = "wsvga-lvds",
+	.pixfmt		= IPU_PIX_FMT_LVDS666,
 }, {
 	.bus		= 2,
 	.addr		= 0x48,
 	.name           = "wvga-rgb",
+	.pixfmt		= IPU_PIX_FMT_RGB666,
 } };
 
 static iomux_v3_cfg_t rgb_pads[] = {
@@ -495,12 +521,20 @@ int board_video_skip(void)
 	if (!panel) {
 		for (i = 0; i < ARRAY_SIZE(i2c_displays); i++) {
 			struct i2c_display const *dev = i2c_displays+i;
-			if ((0 == i2c_set_bus_num(dev->bus))
+			if ((0 < dev->bus)
+			     &&
+			    (0 == i2c_set_bus_num(dev->bus))
 			     &&
 			    (0 == i2c_probe(dev->addr))) {
 				panel = dev->name;
 				printf("auto-detected panel %s\n", panel);
 				break;
+			} else if (0 > dev->bus) {
+				u8 reg = __raw_readb(HDMI_ARB_BASE_ADDR+HDMI_PHY_STAT0);
+				if (reg&HDMI_PHY_HPD) {
+					panel = dev->name;
+					printf("detected HDMI monitor\n");
+				}
 			}
 		}
 		if (!panel) {
@@ -513,9 +547,26 @@ int board_video_skip(void)
 			break;
 	}
 	if (i < ARRAY_SIZE(videomodes)) {
-		ret = ipuv3_fb_init(videomodes+i, 0, IPU_PIX_FMT_RGB666);
+		ret = ipuv3_fb_init(videomodes+i, 0, i2c_displays[i].pixfmt);
 		if (!ret) {
-			if (IS_LVDS(videomodes[i]))
+			if IS_HDMI(i2c_displays[i]) {
+				u8 reg;
+				reg = __raw_readb(
+						HDMI_ARB_BASE_ADDR
+						+HDMI_PHY_CONF0);
+				reg |= HDMI_PHY_CONF0_PDZ_MASK;
+				__raw_writeb(reg,
+					     HDMI_ARB_BASE_ADDR
+						+HDMI_PHY_CONF0);
+				reg |= HDMI_PHY_CONF0_ENTMDS_MASK;
+				__raw_writeb(reg,
+					     HDMI_ARB_BASE_ADDR
+						+HDMI_PHY_CONF0);
+				reg |= HDMI_PHY_CONF0_GEN2_TXPWRON_MASK;
+				__raw_writeb(reg,
+					     HDMI_ARB_BASE_ADDR
+						+HDMI_PHY_CONF0);
+			} else if (IS_LVDS(videomodes[i]))
 				gpio_direction_output(LVDS_BACKLIGHT_GP, 1);
 			else {
 				imx_iomux_v3_setup_multiple_pads(
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to