From 1c2a9ee49eb54e9d3f30d3b9f45db71ef565133c Mon Sep 17 00:00:00 2001 From: Jett Rink Date: Wed, 23 May 2018 15:15:32 -0600 Subject: ppc: flush console regularly during console dump I noticed data was getting dropped from my console output on bip. Adding the cflush fixes it. BRANCH=none BUG=none TEST=ppc_dump 0 on bip works Change-Id: Ib71cb37c4c8728a7ab958905d3b2627b8c163faa Signed-off-by: Jett Rink Reviewed-on: https://chromium-review.googlesource.com/1070626 --- driver/ppc/nx20p3483.c | 3 +++ driver/ppc/sn5s330.c | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/driver/ppc/nx20p3483.c b/driver/ppc/nx20p3483.c index 340418b632..e5d0055140 100644 --- a/driver/ppc/nx20p3483.c +++ b/driver/ppc/nx20p3483.c @@ -364,6 +364,9 @@ static int nx20p3483_dump(int port) return rv; } ccprintf("[0x%02x]: 0x%02x\n", reg_addr, reg); + + /* Flush every call otherwise buffer may get full */ + cflush(); } return EC_SUCCESS; diff --git a/driver/ppc/sn5s330.c b/driver/ppc/sn5s330.c index 37c559ce67..4971ab798e 100644 --- a/driver/ppc/sn5s330.c +++ b/driver/ppc/sn5s330.c @@ -51,6 +51,8 @@ static int sn5s330_dump(int port) const int i2c_port = ppc_chips[port].i2c_port; const int i2c_addr = ppc_chips[port].i2c_addr; + /* Flush after every set otherwise console buffer may get full. */ + for (i = SN5S330_FUNC_SET1; i <= SN5S330_FUNC_SET12; i++) { i2c_read8(i2c_port, i2c_addr, i, &data); ccprintf("FUNC_SET%d [%02Xh] = 0x%02x\n", @@ -59,6 +61,8 @@ static int sn5s330_dump(int port) data); } + cflush(); + for (i = SN5S330_INT_STATUS_REG1; i <= SN5S330_INT_STATUS_REG4; i++) { i2c_read8(i2c_port, i2c_addr, i, &data); ccprintf("INT_STATUS_REG%d [%02Xh] = 0x%02x\n", @@ -67,6 +71,8 @@ static int sn5s330_dump(int port) data); } + cflush(); + for (i = SN5S330_INT_TRIP_RISE_REG1; i <= SN5S330_INT_TRIP_RISE_REG3; i++) { i2c_read8(i2c_port, i2c_addr, i, &data); @@ -76,6 +82,8 @@ static int sn5s330_dump(int port) data); } + cflush(); + for (i = SN5S330_INT_TRIP_FALL_REG1; i <= SN5S330_INT_TRIP_FALL_REG3; i++) { i2c_read8(i2c_port, i2c_addr, i, &data); @@ -85,6 +93,8 @@ static int sn5s330_dump(int port) data); } + cflush(); + for (i = SN5S330_INT_MASK_RISE_REG1; i <= SN5S330_INT_MASK_RISE_REG3; i++) { i2c_read8(i2c_port, i2c_addr, i, &data); @@ -94,6 +104,8 @@ static int sn5s330_dump(int port) data); } + cflush(); + for (i = SN5S330_INT_MASK_FALL_REG1; i <= SN5S330_INT_MASK_FALL_REG3; i++) { i2c_read8(i2c_port, i2c_addr, i, &data); @@ -103,6 +115,8 @@ static int sn5s330_dump(int port) data); } + cflush(); + return EC_SUCCESS; } #endif /* defined(CONFIG_CMD_PPC_DUMP) */ -- cgit v1.2.1