All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicholas Piggin <npiggin@gmail.com>
To: Corey Minyard <cminyard@mvista.com>
Cc: "Nicholas Piggin" <npiggin@gmail.com>,
	"Alistair Francis" <alistair.francis@wdc.com>,
	"Daniel Henrique Barboza" <daniel.barboza@oss.qualcomm.com>,
	"Chao Liu" <chao.liu.zevorn@gmail.com>,
	"Chris Rauer" <crauer@google.com>,
	"Michael Ellerman" <mpe@kernel.org>,
	"Joel Stanley" <jms@oss.tenstorrent.com>,
	"Anirudh Srinivasan" <asrinivasan@oss.tenstorrent.com>,
	"Portia Stephens" <portias@oss.tenstorrent.com>,
	qemu-riscv@nongnu.org, qemu-devel@nongnu.org,
	"Hao Wu" <wuhaotsh@google.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH 4/4] [RFC] hw/i2c/designware_i2c: add SMBUS_INTR_MASK
Date: Thu,  7 May 2026 22:05:22 +1000	[thread overview]
Message-ID: <20260507120524.111056-5-npiggin@gmail.com> (raw)
In-Reply-To: <20260507120524.111056-1-npiggin@gmail.com>

QEMU complains about access to unimplemented register when Linux
inits the controller. It is the SMBUS interrupt mask which the
driver unmasks. Since the model implements no SMBUS interrupts,
the mask can be implemented trivially.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 hw/i2c/designware_i2c.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/hw/i2c/designware_i2c.c b/hw/i2c/designware_i2c.c
index b7be4d68c4..cc37bde2ae 100644
--- a/hw/i2c/designware_i2c.c
+++ b/hw/i2c/designware_i2c.c
@@ -142,6 +142,7 @@ REG32(DW_IC_ENABLE_STATUS,      0x9c) /* I2C enable status */
     FIELD(DW_IC_ENABLE_STATUS, IC_EN,                   0, 1)
 REG32(DW_IC_FS_SPKLEN,          0xa0) /* I2C SS, FS or FM+ spike suppression limit */
 REG32(DW_IC_CLR_RESTART_DET,    0xa8)
+REG32(DW_IC_SMBUS_INTR_MASK,    0xcc) /* SMBus Interrupt Mask */
 REG32(DW_IC_COMP_PARAM_1,       0xf4) /* Component parameter */
     FIELD(DW_IC_COMP_PARAM_1, TX_FIFO_SIZE,       16, 8)
     FIELD(DW_IC_COMP_PARAM_1, RX_FIFO_SIZE,        8, 8)
@@ -610,6 +611,10 @@ static const RegisterAccessInfo designware_i2c_regs_info[] = {
     },{ .name  = "DW_IC_CLR_RESTART_DET", .addr = A_DW_IC_CLR_RESTART_DET,
         .ro    = 0xffffffff,
         .post_read = dw_ic_clr_intr_reg_post_read,
+    },{ .name  = "DW_IC_SMBUS_INTR_MASK", .addr = A_DW_IC_SMBUS_INTR_MASK,
+        /* No SMBus interrupts are implemented, Linux updates the mask */
+        .reset =      0x7ff,
+        .unimp = 0xfffff800,
     },{ .name  = "DW_IC_COMP_PARAM_1", .addr = A_DW_IC_COMP_PARAM_1,
         .reset = /* HAS_DMA and HC_COUNT_VAL are disabled */
             ((2 << R_DW_IC_COMP_PARAM_1_APB_DATA_WIDTH_32_SHIFT) |
-- 
2.53.0



  parent reply	other threads:[~2026-05-07 12:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-07 12:05 [PATCH 0/4] hw/i2c: Add designware i2c controller Nicholas Piggin
2026-05-07 12:05 ` [PATCH 1/4] " Nicholas Piggin
2026-05-11 10:20   ` Philippe Mathieu-Daudé
2026-05-07 12:05 ` [PATCH 2/4] [RFC] hw/i2c/designware_i2c: Switch to Fifo8 Nicholas Piggin
2026-05-11 10:18   ` Philippe Mathieu-Daudé
2026-05-15 18:23     ` Nicholas Piggin
2026-05-07 12:05 ` [PATCH 3/4] [RFC] hw/i2c/designware_i2c: Switch to QEMU register API Nicholas Piggin
2026-05-13  2:03   ` Alistair Francis
2026-05-15 18:34     ` Nicholas Piggin
2026-05-07 12:05 ` Nicholas Piggin [this message]
2026-05-11 10:19   ` [PATCH 4/4] [RFC] hw/i2c/designware_i2c: add SMBUS_INTR_MASK Philippe Mathieu-Daudé
2026-05-10 13:03 ` [PATCH 0/4] hw/i2c: Add designware i2c controller Corey Minyard
2026-05-15 23:00   ` Nicholas Piggin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260507120524.111056-5-npiggin@gmail.com \
    --to=npiggin@gmail.com \
    --cc=alistair.francis@wdc.com \
    --cc=asrinivasan@oss.tenstorrent.com \
    --cc=chao.liu.zevorn@gmail.com \
    --cc=cminyard@mvista.com \
    --cc=crauer@google.com \
    --cc=daniel.barboza@oss.qualcomm.com \
    --cc=jms@oss.tenstorrent.com \
    --cc=mpe@kernel.org \
    --cc=philmd@linaro.org \
    --cc=portias@oss.tenstorrent.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=wuhaotsh@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.