aboutsummaryrefslogtreecommitdiff
path: root/hw/p8-i2c.c
diff options
context:
space:
mode:
authorOliver O'Halloran <oohall@gmail.com>2018-07-31 17:16:47 +1000
committerStewart Smith <stewart@linux.ibm.com>2018-08-01 01:30:04 -0500
commitb465be797e8673a38e6b136b18ed593335cfe11e (patch)
treeed563ab9a172f8d3b193dcced3091ab511c31027 /hw/p8-i2c.c
parent55cab51c74a8a6c5bb2e298e541ab125c5ade553 (diff)
downloadskiboot-b465be797e8673a38e6b136b18ed593335cfe11e.zip
skiboot-b465be797e8673a38e6b136b18ed593335cfe11e.tar.gz
skiboot-b465be797e8673a38e6b136b18ed593335cfe11e.tar.bz2
hw/p8-i2c: Print the set error bits
This is purely to save me from having to look it up every time someone gets an I2C error. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'hw/p8-i2c.c')
-rw-r--r--hw/p8-i2c.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/hw/p8-i2c.c b/hw/p8-i2c.c
index 3bf9678..905834b 100644
--- a/hw/p8-i2c.c
+++ b/hw/p8-i2c.c
@@ -318,6 +318,16 @@ static void p8_i2c_print_debug_info(struct p8_i2c_master_port *port,
" cmd:0x%016llx\tmode:0x%016llx\tstat:0x%016llx\n"
" estat:0x%016llx\tintm:0x%016llx\tintc:0x%016llx\n",
cmd, mode, stat, estat, intm, intc);
+
+ log_simple_error(&e_info(OPAL_RC_I2C_TRANSFER),
+ "I2C: Error bits set: %s%s%s%s%s%s%s\n",
+ (stat & I2C_STAT_NACK_RCVD_ERR) ? "nack, " : "",
+ (stat & I2C_STAT_INVALID_CMD) ? "cmd invalid, " : "",
+ (stat & I2C_STAT_LBUS_PARITY_ERR) ? "interal parity, " : "",
+ (stat & I2C_STAT_BKEND_OVERRUN_ERR) ? "backend overrun, " : "",
+ (stat & I2C_STAT_BKEND_ACCESS_ERR) ? "backend access, " : "",
+ (stat & I2C_STAT_ARBT_LOST_ERR) ? "arbitration loss, " : "",
+ (stat & I2C_STAT_STOP_ERR) ? "stop error, " : "");
}
static bool p8_i2c_has_irqs(struct p8_i2c_master *master)