coreboot-kgpe-d16/src
Ben Gardner 77e351d9d1 intel/fsp_baytrail: Fix I2C abort logic
A call to i2c_read() for a non-existent address followed by an i2c_read()
to a valid address results in a false abort status for the 2nd call.

i2c_read(1, 0x40, 0, buf, sizeof(buf)) => 0x2000000 (I2C_ERR_TIMEOUT)
i2c_read(1, 0x74, 0, buf, sizeof(buf)) => 0x4000000 (I2C_ERR_ABORT)

Because the abort status register is cleared on read and wait_tx_fifo()
reads it twice, the returned status does not contain the abort status.
Fixing that changed the 2nd read to reflect the abort status.

i2c_read(1, 0x40, 0, buf, sizeof(buf)) => 0x2000000 (I2C_ERR_TIMEOUT)
i2c_read(1, 0x74, 0, buf, sizeof(buf)) => 0x4000001 (I2C_ERR_ABORT)

Bit 0 indicates that the address was not acknowledged by any slave.
That's the abort status from the previous transaction.
So I added a read of the abort status before starting a transaction in
both i2c_read() and i2c_write().

i2c_read(1, 0x40, 0, buf, sizeof(buf)) => 0x2000000 (I2C_ERR_TIMEOUT)
i2c_read(1, 0x74, 0, buf, sizeof(buf)) => 0 (I2C_SUCCESS)

Tested on a Bay Trail E3845 SoC.

Change-Id: I39e4ff4206587267b6fceef58f4a567bf162fbbe
Signed-off-by: Ben Gardner <gardner.ben@gmail.com>
Reviewed-on: https://review.coreboot.org/14160
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
2016-03-25 18:24:49 +01:00
..
acpi acpi/: add missing license header 2016-01-14 22:52:11 +01:00
arch armv7: Word-sized/half-word-sized memory operations for 32/16 bit read/write 2016-03-23 21:12:31 +01:00
commonlib arch/x86: introduce postcar stage/phase 2016-03-23 14:24:30 +01:00
console arch/x86: introduce postcar stage/phase 2016-03-23 14:24:30 +01:00
cpu arch/x86: introduce postcar stage/phase 2016-03-23 14:24:30 +01:00
device device: Add i2c read/write register field API 2016-03-21 23:10:55 +01:00
drivers edid: Add helper function to calculate bits-per-pixel dependent values 2016-03-24 20:25:12 +01:00
ec Hide EC_GOOGLE_CHROMEEC_SPI_BUS. 2016-03-05 00:57:22 +01:00
include edid: Add helper function to calculate bits-per-pixel dependent values 2016-03-24 20:25:12 +01:00
lib edid: Add helper function to calculate bits-per-pixel dependent values 2016-03-24 20:25:12 +01:00
mainboard soc/apollolake: Add skeleton ACPI entry 2016-03-21 23:14:09 +01:00
northbridge nb/amd/mct_ddr3: Set the NBP0 read latency from P0 trained values 2016-03-24 22:24:11 +01:00
soc intel/fsp_baytrail: Fix I2C abort logic 2016-03-25 18:24:49 +01:00
southbridge southbridge/intel/ibexpeak: Use common gpio.c 2016-02-23 00:28:26 +01:00
superio roda/rk9: Remove #include early_serial.c from romstage 2016-03-08 13:41:03 +01:00
vendorcode vendorcode/intel/Kconfig: Add broadwell_de symbol to fix lint 2016-03-15 15:23:40 +01:00
Kconfig Kconfig: remove COMPRESS_PRERAM_STAGES option from x86 2016-03-11 16:52:38 +01:00