aboutsummaryrefslogtreecommitdiff
path: root/hw/p8-i2c.c
diff options
context:
space:
mode:
authorOliver O'Halloran <oohall@gmail.com>2021-06-25 11:49:25 +0530
committerVasant Hegde <hegdevasant@linux.vnet.ibm.com>2021-06-30 15:05:55 +0530
commit81ae6b6e3bcce3fe2e0ba3a080139c1be80e6d8c (patch)
treefa3ea3ec490759fd5815f9135160a23fa9cc0073 /hw/p8-i2c.c
parent713e21c14f64974e8fce6e15f678b5124bc46ea3 (diff)
downloadskiboot-81ae6b6e3bcce3fe2e0ba3a080139c1be80e6d8c.zip
skiboot-81ae6b6e3bcce3fe2e0ba3a080139c1be80e6d8c.tar.gz
skiboot-81ae6b6e3bcce3fe2e0ba3a080139c1be80e6d8c.tar.bz2
hw/p8-i2c: Print interrupt status per master
Whether I2C interrupts work or not depends on the type of master. Currently we print a single message to indicate whether IRQs work or not, but this will be wrong if we have I2C interrupts on the host and we happen to probe a Centaur I2C master first. Fix this by adding a message to the per-master print indicating whether the master has an interrupt or not. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Diffstat (limited to 'hw/p8-i2c.c')
-rw-r--r--hw/p8-i2c.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/hw/p8-i2c.c b/hw/p8-i2c.c
index 40d9ae4..adefa27 100644
--- a/hw/p8-i2c.c
+++ b/hw/p8-i2c.c
@@ -1446,7 +1446,6 @@ static void p8_i2c_init_one(struct dt_node *i2cm, enum p8_i2c_master_type type)
struct p8_i2c_master *master;
struct list_head *chip_list;
uint64_t ex_stat, default_timeout;
- static bool irq_printed;
int64_t rc;
master = zalloc(sizeof(*master));
@@ -1495,8 +1494,11 @@ static void p8_i2c_init_one(struct dt_node *i2cm, enum p8_i2c_master_type type)
init_timer(&master->recovery, p8_i2c_recover, master);
init_timer(&master->sensor_cache, p8_i2c_enable_scache, master);
- prlog(PR_INFO, "I2C: Chip %08x Eng. %d Clock %d Mhz\n",
- master->chip_id, master->engine_id, lb_freq / 1000000);
+ master->irq_ok = p8_i2c_has_irqs(master);
+
+ prlog(PR_INFO, "I2C: Chip %08x Eng. %d Clock %d Mhz %s\n",
+ master->chip_id, master->engine_id, lb_freq / 1000000,
+ master->irq_ok ? "" : "(no interrupt)");
/* Disable OCC cache during inits */
if (master->type == I2C_CENTAUR) {
@@ -1525,14 +1527,6 @@ static void p8_i2c_init_one(struct dt_node *i2cm, enum p8_i2c_master_type type)
list_head_init(&master->req_list);
list_head_init(&master->ports);
- /* Check if interrupt is usable */
- master->irq_ok = p8_i2c_has_irqs(master);
- if (!irq_printed) {
- irq_printed = true;
- prlog(PR_INFO, "I2C: Interrupts %sfunctional\n",
- master->irq_ok ? "" : "non-");
- }
-
/* Re-enable the sensor cache, we aren't touching HW anymore */
if (master->type == I2C_CENTAUR)
centaur_enable_sensor_cache(master->chip_id);