pit: i2c: dump after ADDR bit is cleared instead of before

Dumping before the ADDR bit is cleared also has the effect of clearing the ADDR
bit.

BUG=chrome-os-partner:22235
TEST=Manual test on peach pit.
Keep executing the "battery" command on the EC console while busy running
flashrom on the host to read back the EC. See that there's no error produced.
BRANCH=pit
Signed-off-by: Hung-ying Tyan <tyanh@chromium.org>

Change-Id: I10e88a8512f4e9eb90267ef1aca1df5dd214318d
Reviewed-on: https://chromium-review.googlesource.com/66930
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Commit-Queue: Hung-ying Tyan <tyanh@chromium.org>
Tested-by: Hung-ying Tyan <tyanh@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
This commit is contained in:
Hung-ying Tyan
2013-08-26 16:13:40 +08:00
committed by chrome-internal-fetch
parent 5d014fd2dd
commit e294f80866

View File

@@ -108,7 +108,6 @@ static int send_start(int port, int slave_addr)
/* Write slave address */
STM32_I2C_DR(port) = slave_addr & 0xff;
dump_i2c_reg(port, "wrote addr");
rv = wait_sr1(port, STM32_I2C_SR1_ADDR);
if (rv)
return rv;
@@ -116,6 +115,8 @@ static int send_start(int port, int slave_addr)
/* Read SR2 to clear ADDR bit */
rv = STM32_I2C_SR2(port);
dump_i2c_reg(port, "wrote addr");
return EC_SUCCESS;
}