From: Umesh Kumar <ukumar@marvell.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Andi Shyti <andi.shyti@kernel.org>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>,
<bbhushan2@marvell.com>, <linux-i2c@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, Umesh Kumar <ukumar@marvell.com>
Subject: [PATCH v4] i2c: designware: Enable SAR in slave mode for Multiple SAR controllers
Date: Mon, 17 Aug 2026 14:10:23 +0530 [thread overview]
Message-ID: <20260817084023.176584-1-ukumar@marvell.com> (raw)
In-Reply-To: <20260804041842.3205356-1-ukumar@marvell.com>
DesignWare controllers synthesised with the Multiple SAR feature (e.g.
Marvell CN20K) gate the primary slave address behind IC_ENABLE.SAR_EN
(bit 19). Per the Synopsys DW_apb_i2c DataBook v2.03a (Multiple SAR
feature),when this bit is set the core acknowledges the address matching
IC_SAR;otherwise the address is NACKed. The slave enable path writes only
IC_ENABLE.ENABLE (bit 0), so on such controllers the target never ACKs
its address and a remote master cannot reach it.
Set SAR_EN together with ENABLE when entering slave mode. The bit is
reserved (and ignored) on single-SAR controllers, so existing users are
unaffected.
Signed-off-by: Umesh Kumar <ukumar@marvell.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
Changes in v4:
- Added DataBook version (v2.03a) to commit message and code comment.
- Removed duplicate comment from core.h; kept only in the .c file.
drivers/i2c/busses/i2c-designware-common.c | 10 +++++++++-
drivers/i2c/busses/i2c-designware-core.h | 1 +
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-designware-common.c b/drivers/i2c/busses/i2c-designware-common.c
index 4dc57fd56170..880b9a74b3ff 100644
--- a/drivers/i2c/busses/i2c-designware-common.c
+++ b/drivers/i2c/busses/i2c-designware-common.c
@@ -374,7 +374,15 @@ static void i2c_dw_configure_mode(struct dw_i2c_dev *dev, int mode)
regmap_write(dev->map, DW_IC_CON, dev->slave_cfg);
regmap_write(dev->map, DW_IC_SAR, dev->slave->addr);
regmap_write(dev->map, DW_IC_INTR_MASK, DW_IC_INTR_SLAVE_MASK);
- __i2c_dw_enable(dev);
+ /*
+ * Per the Synopsys DW_apb_i2c DataBook v2.03a (Multiple SAR
+ * feature), controllers synthesised with multiple SARs only
+ * acknowledge traffic to IC_SAR when IC_ENABLE.SAR_EN is set;
+ * a plain enable is not enough. The bit is reserved (ignored) on
+ * single-SAR controllers.
+ */
+ regmap_write(dev->map, DW_IC_ENABLE,
+ DW_IC_ENABLE_ENABLE | DW_IC_ENABLE_SAR_EN);
break;
default:
WARN(1, "Invalid mode %d\n", mode);
diff --git a/drivers/i2c/busses/i2c-designware-core.h b/drivers/i2c/busses/i2c-designware-core.h
index 9d8d104cc391..1390c8862a68 100644
--- a/drivers/i2c/busses/i2c-designware-core.h
+++ b/drivers/i2c/busses/i2c-designware-core.h
@@ -125,6 +125,7 @@
#define DW_IC_ENABLE_ENABLE BIT(0)
#define DW_IC_ENABLE_ABORT BIT(1)
+#define DW_IC_ENABLE_SAR_EN BIT(19)
#define DW_IC_STATUS_ACTIVITY BIT(0)
#define DW_IC_STATUS_TFE BIT(2)
--
2.43.0
next prev parent reply other threads:[~2026-08-17 8:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-04 4:18 [RFC PATCH] i2c: designware: Enable SAR in slave mode for Multiple SAR controllers Umesh Kumar
2026-08-04 10:36 ` Mika Westerberg
2026-08-12 3:40 ` [PATCH v2] " Umesh Kumar
2026-08-12 7:16 ` Andy Shevchenko
2026-08-12 10:37 ` [EXTERNAL] " Umesh Kumar
2026-08-12 11:45 ` [PATCH v3] " Umesh Kumar
2026-08-13 6:37 ` Andy Shevchenko
2026-08-17 8:40 ` Umesh Kumar [this message]
2026-08-17 11:10 ` [PATCH v4] " Andy Shevchenko
2026-08-17 16:21 ` [PATCH v5] " Umesh Kumar
2026-08-17 16:33 ` Andy Shevchenko
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=20260817084023.176584-1-ukumar@marvell.com \
--to=ukumar@marvell.com \
--cc=andi.shyti@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bbhushan2@marvell.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox