Skip to content

Commit

Permalink
hw/p8-i2c: Print the set error bits
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
oohal authored and stewartsmith committed Aug 1, 2018
1 parent 55cab51 commit b465be7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions hw/p8-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b465be7

Please sign in to comment.