diff options
author | Jett Rink <jettrink@chromium.org> | 2018-05-23 15:15:32 -0600 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-05-24 15:44:29 -0700 |
commit | 1c2a9ee49eb54e9d3f30d3b9f45db71ef565133c (patch) | |
tree | 446e69df4d84674afc6a229698e11c5260581959 | |
parent | 0bf44c2d56b3d2b29ce6d0d1b36a2bb5b36fa943 (diff) | |
download | chrome-ec-1c2a9ee49eb54e9d3f30d3b9f45db71ef565133c.tar.gz |
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 <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1070626
-rw-r--r-- | driver/ppc/nx20p3483.c | 3 | ||||
-rw-r--r-- | driver/ppc/sn5s330.c | 14 |
2 files changed, 17 insertions, 0 deletions
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) */ |