yongqiang niu has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/46837 )
Change subject: DEBUG: ANX read edid test ......................................................................
DEBUG: ANX read edid test
Signed-off-by: Yongqiang Niu yongqiang.niu@mediatek.com Change-Id: Icaaf8d7a96d40839947beeb0b6d50521b314b91a --- M src/drivers/analogix/anx7625/anx7625.c 1 file changed, 28 insertions(+), 11 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/37/46837/1
diff --git a/src/drivers/analogix/anx7625/anx7625.c b/src/drivers/analogix/anx7625/anx7625.c index 1f04346..121075a 100644 --- a/src/drivers/analogix/anx7625/anx7625.c +++ b/src/drivers/analogix/anx7625/anx7625.c @@ -848,24 +848,41 @@ 0x2d, 0x45, 0x41, 0x31, 0x0a, 0x20, 0x00, 0xea, };
+static void anx7625_read_ver(uint8_t bus) +{ + uint8_t version, revision; + + anx7625_reg_read(bus, RX_P0_ADDR, OCM_FW_VERSION, &version); + anx7625_reg_read(bus, RX_P0_ADDR, OCM_FW_REVERSION, &revision); + + ANXINFO("OCM : ver %#02x, rev %#02x.\n", version, revision); +} + int anx7625_dp_get_edid(uint8_t bus, struct edid *out) { int block_num; int ret; u8 edid[FOUR_BLOCK_SIZE];
- /* Something goes terribly wrong here, and ANX7625 does not seem to be able to recover from it. */ - block_num = sp_tx_edid_read(bus, edid, FOUR_BLOCK_SIZE); - if (block_num <= 0) { - block_num = 1; - memcpy(edid, &edp_edid, sizeof(edp_edid)); - ANXINFO("Failed to get eDP EDID, test with hard code edied.\n"); - } + anx7625_read_ver(bus); + ANXINFO("first time read edid\n"); + sp_tx_edid_read(bus, edid, FOUR_BLOCK_SIZE); + ANXERROR("get eDP EDID at 1st time done.\n");
- if (block_num < 0) { - ANXERROR("Failed to get eDP EDID.\n"); - return -1; - } + anx7625_read_ver(bus); + ANXINFO("2nd time read edid\n"); + sp_tx_edid_read(bus, edid, FOUR_BLOCK_SIZE); + ANXERROR("get eDP EDID at 2nd time done.\n"); + + anx7625_read_ver(bus); + ANXINFO("3rd time read edid\n"); + sp_tx_edid_read(bus, edid, FOUR_BLOCK_SIZE); + ANXERROR("get eDP EDID at 3rd time done.\n"); + anx7625_read_ver(bus); + + ANXINFO("use fixed edid\n"); + block_num = 0; + memcpy(edid, &edp_edid, sizeof(edp_edid));
ret = decode_edid(edid, (block_num + 1) * ONE_BLOCK_SIZE, out); if (ret != EDID_CONFORMANT) {