[coreboot-gerrit] Change in coreboot[master]: soc/rockchip/rk3399: Ensure correct init flow if edp_prepare fails

Ege Mihmanli (Code Review) gerrit at coreboot.org
Mon Jan 8 02:22:46 CET 2018


Ege Mihmanli has uploaded this change for review. ( https://review.coreboot.org/23152


Change subject: soc/rockchip/rk3399: Ensure correct init flow if edp_prepare fails
......................................................................

soc/rockchip/rk3399: Ensure correct init flow if edp_prepare fails

This patch fixes 2 edp display issues:
1. When rk_edp_prepare fails >3 times, edp_init isn't run because
while-condition is not satisfied. Then, only a partial init sequence is
ran.
2. If rk_edp_prepare never succeeds, coreboot never leaves link training
stage due to infinite loop.

Change-Id: I44c3f53e8786558c43078d4afe9acde4d64796e7
Signed-off-by: Ege Mihmanli <egemih at google.com>
---
M src/soc/rockchip/rk3399/display.c
1 file changed, 12 insertions(+), 5 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/52/23152/1

diff --git a/src/soc/rockchip/rk3399/display.c b/src/soc/rockchip/rk3399/display.c
index b81e96f..bbe50cc 100644
--- a/src/soc/rockchip/rk3399/display.c
+++ b/src/soc/rockchip/rk3399/display.c
@@ -45,7 +45,7 @@
 		udelay(1);
 	write32(&cru_ptr->softrst_con[17],
 		RK_CLRBITS(1 << 12 | 1 << 13));
-	printk(BIOS_WARNING, "Retrying epd initialization.\n");
+	printk(BIOS_WARNING, "Retrying EDP initialization.\n");
 }
 
 void rk_display_init(device_t dev)
@@ -53,8 +53,8 @@
 	struct edid edid;
 	struct soc_rockchip_rk3399_config *conf = dev->chip_info;
 	enum vop_modes detected_mode = VOP_MODE_UNKNOWN;
-	int retry_count = 0;
 	const struct mipi_panel_data *panel_data = NULL;
+	int retry_edp_count = 0;
 
 	/* let's use vop0 in rk3399 */
 	uint32_t vop_id = 0;
@@ -77,6 +77,7 @@
 		write32(&rk3399_grf->soc_con25, RK_SETBITS(1 << 11));
 
 retry_edp:
+		int retry_count = 0;
 		while (retry_count++ < 3) {
 			rk_edp_init();
 			if (rk_edp_get_edid(&edid) == 0) {
@@ -84,7 +85,8 @@
 				break;
 			}
 			if (retry_count == 3) {
-				printk(BIOS_WARNING, "Warning: epd initialization failed.\n");
+				printk(BIOS_WARNING,
+				       "Warning: EDP initialization failed.\n");
 				return;
 			} else {
 				reset_edp();
@@ -159,8 +161,13 @@
 	case VOP_MODE_EDP:
 		/* will enable edp in depthcharge */
 		if (rk_edp_prepare()) {
-			reset_edp();
-			goto retry_edp; /* Rerun entire init sequence */
+			if(retry_edp_count++ < 3) {
+				reset_edp();
+				/* Rerun entire init sequence */
+				goto retry_edp;
+			}
+			printk(BIOS_WARNING, "EDP preparation failed.");
+			return;
 		}
 		break;
 	default:

-- 
To view, visit https://review.coreboot.org/23152
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I44c3f53e8786558c43078d4afe9acde4d64796e7
Gerrit-Change-Number: 23152
Gerrit-PatchSet: 1
Gerrit-Owner: Ege Mihmanli <egemih at google.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180108/a4533288/attachment.html>


More information about the coreboot-gerrit mailing list