[coreboot-gerrit] New patch to review for coreboot: mc_tcu3: Swap LVDS even and odd lanes for a certain hardware

Werner Zeh (werner.zeh@siemens.com) gerrit at coreboot.org
Wed Nov 23 08:09:38 CET 2016


Werner Zeh (werner.zeh at siemens.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17576

-gerrit

commit b3a53f5e77523f08a7781ca4cd34252091b01449
Author: Werner Zeh <werner.zeh at siemens.com>
Date:   Wed Nov 23 07:49:52 2016 +0100

    mc_tcu3: Swap LVDS even and odd lanes for a certain hardware
    
    Due to some LVDS cable constraints even and odd lanes needs
    to be swapped on certain hardware. The hardware ID will be used to
    distinguish between these two cases. The swapping itself will be done by
    PTN3460, which is configurable for that.
    
    Change-Id: I339b2321a8ed1bc3bbf10aa8e50eb598b14b15fa
    Signed-off-by: Werner Zeh <werner.zeh at siemens.com>
---
 src/mainboard/siemens/mc_tcu3/ptn3460.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/mainboard/siemens/mc_tcu3/ptn3460.c b/src/mainboard/siemens/mc_tcu3/ptn3460.c
index bcf8d2c..cd59492 100644
--- a/src/mainboard/siemens/mc_tcu3/ptn3460.c
+++ b/src/mainboard/siemens/mc_tcu3/ptn3460.c
@@ -15,6 +15,7 @@
 
 #include <console/console.h>
 #include <hwilib.h>
+#include <string.h>
 #include "soc/i2c.h"
 #include "ptn3460.h"
 
@@ -29,6 +30,7 @@ int ptn3460_init(char *hwi_block)
 	int status;
 	uint8_t disp_con = 0, color_depth = 0;
 	uint8_t edid_data[0x80];
+	uint8_t hwid[4], tcu31_hwid[4] = {7, 9, 2, 0};
 
 	if (!hwi_block || hwilib_find_blocks(hwi_block) != CB_SUCCESS) {
 		printk(BIOS_ERR, "LCD: Info block \"%s\" not found!\n",
@@ -56,6 +58,11 @@ int ptn3460_init(char *hwi_block)
 			hwi_block);
 		return 1;
 	}
+	if (hwilib_get_field(HWID, hwid, sizeof(hwid)) != sizeof(hwid)) {
+		printk(BIOS_ERR, "LCD: Missing HW-ID from %s\n",
+			hwi_block);
+		return 1;
+	}
 	/* Here, all the desired information for setting up DP2LVDS converter*/
 	/* are present. Inside the converter, table 6 will be used for */
 	/* the timings. */
@@ -78,7 +85,10 @@ int ptn3460_init(char *hwi_block)
 		cfg.lvds_interface_ctrl1 |= 0x20; /* Use 18 bits per pixel */
 
 	cfg.lvds_interface_ctrl2 = 0x03;  /* no clock spreading, 300 mV LVDS swing */
-	cfg.lvds_interface_ctrl3 = 0x00;  /* no LVDS signal swap */
+	if (memcmp(hwid, tcu31_hwid, sizeof(hwid)))
+		cfg.lvds_interface_ctrl3 = 0x00;  /* no LVDS signal swap */
+	else
+		cfg.lvds_interface_ctrl3 = 0x01;  /* swap LVDS even and odd */
 	cfg.t2_delay = 1;		  /* Delay T2 (VDD to LVDS active) by 16 ms */
 	cfg.t3_timing = 10;		  /* 500 ms from LVDS to backlight active */
 	cfg.t12_timing = 20;		  /* 1 second re-power delay */



More information about the coreboot-gerrit mailing list