From: Andreas Kemnade <andreas@kemnade.info>
To: Aaro Koskinen <aaro.koskinen@iki.fi>,
Kevin Hilman <khilman@baylibre.com>,
Roger Quadros <rogerq@kernel.org>,
Tony Lindgren <tony@atomide.com>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Andi Shyti <andi.shyti@kernel.org>,
Thomas Richard <thomas.richard@bootlin.com>,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
Paul Walmsley <paul@pwsan.com>,
Russell King <linux@armlinux.org.uk>
Cc: Sicelo <absicsz@gmail.com>,
linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Andreas Kemnade <andreas@kemnade.info>
Subject: [PATCH 1/3] bus: ti-sysc: fix I2C quirk for OMAP3 variants
Date: Tue, 10 Nov 2026 11:46:12 +0100 [thread overview]
Message-ID: <20261110-i2c-sysc-v1-1-8945eb1d38f0@kemnade.info> (raw)
In-Reply-To: <20261110-i2c-sysc-v1-0-8945eb1d38f0@kemnade.info>
OMAP3 has only one revision register, not split across two registers.
Do not try to interpret the interrupt enable register but instead
use the size of the revision register as indicator.
Specifying a fake 8 byte range and the original quirk only works if
u-boot has not messed around with the interrupt enable register.
Fixes: 4e23be473e306 ("bus: ti-sysc: Add support for module specific reset quirks")
Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
---
drivers/bus/ti-sysc.c | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
index 12285ad9ef51f..c07a0e1f9a878 100644
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -153,6 +153,7 @@ struct sysc {
struct ti_sysc_cookie cookie;
const char *name;
u32 revision;
+ bool revision_doubleword;
u32 sysconfig;
unsigned int reserved:1;
unsigned int enabled:1;
@@ -179,7 +180,8 @@ static void sysc_write(struct sysc *ddata, int offset, u32 value)
/* Only i2c revision has LO and HI register with stride of 4 */
if (ddata->offsets[SYSC_REVISION] >= 0 &&
- offset == ddata->offsets[SYSC_REVISION]) {
+ offset == ddata->offsets[SYSC_REVISION] &&
+ ddata->revision_doubleword) {
u16 hi = value >> 16;
writew_relaxed(hi, ddata->module_va + offset + 4);
@@ -200,7 +202,8 @@ static u32 sysc_read(struct sysc *ddata, int offset)
/* Only i2c revision has LO and HI register with stride of 4 */
if (ddata->offsets[SYSC_REVISION] >= 0 &&
- offset == ddata->offsets[SYSC_REVISION]) {
+ offset == ddata->offsets[SYSC_REVISION] &&
+ ddata->revision_doubleword) {
u16 tmp = readw_relaxed(ddata->module_va + offset + 4);
val |= tmp << 16;
@@ -761,8 +764,10 @@ static void sysc_check_children(struct sysc *ddata)
*/
static void sysc_check_quirk_16bit(struct sysc *ddata, struct resource *res)
{
- if (resource_size(res) == 8)
+ if (resource_size(res) == 8) {
ddata->cfg.quirks |= SYSC_QUIRK_16BIT | SYSC_QUIRK_USE_CLOCKACT;
+ ddata->revision_doubleword = true;
+ }
}
/**
@@ -1527,9 +1532,11 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {
SYSC_QUIRK("i2c", 0, 0, 0x20, 0x10, 0x00000036, 0x000000ff,
SYSC_MODULE_QUIRK_I2C | SYSC_MODULE_QUIRK_ENA_RESETDONE),
SYSC_QUIRK("i2c", 0, 0, 0x20, 0x10, 0x0000003c, 0x000000ff,
- SYSC_MODULE_QUIRK_I2C | SYSC_MODULE_QUIRK_ENA_RESETDONE),
+ SYSC_MODULE_QUIRK_I2C | SYSC_MODULE_QUIRK_ENA_RESETDONE |
+ SYSC_QUIRK_16BIT | SYSC_QUIRK_USE_CLOCKACT),
SYSC_QUIRK("i2c", 0, 0, 0x20, 0x10, 0x00000040, 0x000000ff,
- SYSC_MODULE_QUIRK_I2C | SYSC_MODULE_QUIRK_ENA_RESETDONE),
+ SYSC_MODULE_QUIRK_I2C | SYSC_MODULE_QUIRK_ENA_RESETDONE |
+ SYSC_QUIRK_16BIT | SYSC_QUIRK_USE_CLOCKACT),
SYSC_QUIRK("i2c", 0, 0, 0x10, 0x90, 0x5040000a, 0xfffff0f0,
SYSC_MODULE_QUIRK_I2C | SYSC_MODULE_QUIRK_ENA_RESETDONE),
SYSC_QUIRK("gpu", 0x50000000, 0x14, -ENODEV, -ENODEV, 0x00010201, 0xffffffff, 0),
@@ -1872,7 +1879,7 @@ static void sysc_clk_quirk_i2c(struct sysc *ddata, bool enable)
u16 val;
/* I2C_CON, omap2/3 is different from omap4 and later */
- if ((ddata->revision & 0xffffff00) == 0x001f0000)
+ if (!ddata->revision_doubleword)
offset = 0x24;
else
offset = 0xa4;
--
2.47.3
next prev parent reply other threads:[~2026-11-10 10:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 10:46 [PATCH 0/3] ARM: OMAP2+: Convert OMAP3 I2C to ti-sysc Andreas Kemnade
2026-11-10 10:46 ` Andreas Kemnade [this message]
2026-11-10 20:18 ` [PATCH 1/3] bus: ti-sysc: fix I2C quirk for OMAP3 variants kernel test robot
2026-11-10 10:46 ` [PATCH 2/3] ARM: dts: ti/omap: describe omap3 i2c via ti-sysc Andreas Kemnade
2026-11-10 10:46 ` [PATCH 3/3] ARM: OMAP2+: remove i2c from OMAP3 hwmods list Andreas Kemnade
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=20261110-i2c-sysc-v1-1-8945eb1d38f0@kemnade.info \
--to=andreas@kemnade.info \
--cc=aaro.koskinen@iki.fi \
--cc=absicsz@gmail.com \
--cc=andi.shyti@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=khilman@baylibre.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=paul@pwsan.com \
--cc=robh@kernel.org \
--cc=rogerq@kernel.org \
--cc=thomas.richard@bootlin.com \
--cc=tony@atomide.com \
--cc=wsa+renesas@sang-engineering.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
all inboxes | Powered by JetHome®