* [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E
@ 2026-01-08 9:28 Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 01/22] bitops: add generic parity calculation for u8 Tommaso Merciai
` (22 more replies)
0 siblings, 23 replies; 34+ messages in thread
From: Tommaso Merciai @ 2026-01-08 9:28 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
This series adds I3C support for the Renesas RZ/G3E SoC into
linux-6.1.y-cip kernel. This includes also nxp,p3t1085 I3C backporting
for testing purposes.
Tested using the NXP P3T1085UK-ARD connected to the RZ/G3E SMARC SoM
via the RZ/G3E SMARC BREAKOUT board.
Thanks & Regards,
Tommaso
Alexandre Belloni (2):
i3c: Document I3C_ADDR_SLOT_EXT_STATUS_MASK
i3c: document i3c_xfers
Billy Tsai (1):
i3c: Remove the const qualifier from i2c_msg pointer in i2c_xfers API
Frank Li (4):
dt-bindings: hwmon: ti,tmp108: Add nxp,p3t1085 compatible string
hwmon: (tmp108) Add NXP p3t1085 support
hwmon: (tmp108) Add helper function tmp108_common_probe() to prepare
I3C support
hwmon: (tmp108) Add support for I3C device
Jack Chen (1):
i3c: export SETDASA method
Jarkko Nikula (2):
i3c: master: Add helpers for DMA mapping and bounce buffer handling
hwmon: (tmp108) Do not fail in I3C probe when I3C regmap is a module
Jorge Marques (1):
i3c: master: Add inline i3c_readl_fifo() and i3c_writel_fifo()
Naveen Krishna Chatradhi (1):
i3c: Correct the macro module_i3c_i2c_driver
Stanislav Jakubek (2):
dt-bindings: hwmon: ti,tmp108: document V+ supply, add short
description
hwmon: (tmp108) Add basic regulator support
Tommaso Merciai (3):
dt-bindings: i3c: Add Renesas I3C controller
clk: renesas: r9a09g047: Add I3C0 clocks and resets
arm64: dts: renesas: r9a09g047: Add I3C node
Wolfram Sang (5):
bitops: add generic parity calculation for u8
i3c: controllers do not need to depend on I3C
i3c: master: Add basic driver for the Renesas I3C controller
i3c: Standardize defines for specification parameters
i3c: Add more parameters for controllers to the header
.../devicetree/bindings/hwmon/ti,tmp108.yaml | 18 +-
.../devicetree/bindings/i3c/renesas,i3c.yaml | 179 +++
Documentation/hwmon/tmp108.rst | 8 +
MAINTAINERS | 7 +
arch/arm64/boot/dts/renesas/r9a09g047.dtsi | 35 +
drivers/clk/renesas/r9a09g047-cpg.c | 8 +
drivers/hwmon/Kconfig | 3 +-
drivers/hwmon/tmp108.c | 73 +-
drivers/i3c/device.c | 20 +
drivers/i3c/internals.h | 38 +
drivers/i3c/master.c | 105 +-
drivers/i3c/master/Kconfig | 14 +-
drivers/i3c/master/Makefile | 1 +
drivers/i3c/master/dw-i3c-master.c | 6 +-
drivers/i3c/master/i3c-master-cdns.c | 2 +-
drivers/i3c/master/mipi-i3c-hci/core.c | 2 +-
drivers/i3c/master/renesas-i3c.c | 1431 +++++++++++++++++
drivers/i3c/master/svc-i3c-master.c | 2 +-
include/linux/bitops.h | 31 +
include/linux/i3c/device.h | 5 +-
include/linux/i3c/master.h | 48 +-
21 files changed, 1993 insertions(+), 43 deletions(-)
create mode 100644 Documentation/devicetree/bindings/i3c/renesas,i3c.yaml
create mode 100644 drivers/i3c/master/renesas-i3c.c
--
2.43.0
^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH 6.1.y-cip 01/22] bitops: add generic parity calculation for u8
2026-01-08 9:28 [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E Tommaso Merciai
@ 2026-01-08 9:28 ` Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 02/22] dt-bindings: i3c: Add Renesas I3C controller Tommaso Merciai
` (21 subsequent siblings)
22 siblings, 0 replies; 34+ messages in thread
From: Tommaso Merciai @ 2026-01-08 9:28 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
commit c320592f3f2a1e6a4e69e5db8e76fc66934a0a78 upstream.
There are multiple open coded implementations for getting the parity of
a byte in the kernel, even using different approaches. Take the pretty
efficient version from SPD5118 driver and make it generally available by
putting it into the bitops header. As long as there is just one parity
calculation helper, the creation of a distinct 'parity.h' header was
discarded. Also, the usage of hweight8() for architectures having a
popcnt instruction is postponed until a use case within hot paths is
desired. The motivation for this patch is the frequent use of odd parity
in the I3C specification and to simplify drivers there.
Changes compared to the original SPD5118 version are the addition of
kernel documentation, switching the return type from bool to int, and
renaming the argument of the function.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Yury Norov <yury.norov@gmail.com>
Reviewed-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Tested-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Link: https://lore.kernel.org/r/20250107090204.6593-2-wsa+renesas@sang-engineering.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
include/linux/bitops.h | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index f7f5a783da2a..296c177ed088 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -229,6 +229,37 @@ static inline int get_count_order_long(unsigned long l)
return (int)fls_long(--l);
}
+/**
+ * parity8 - get the parity of an u8 value
+ * @value: the value to be examined
+ *
+ * Determine the parity of the u8 argument.
+ *
+ * Returns:
+ * 0 for even parity, 1 for odd parity
+ *
+ * Note: This function informs you about the current parity. Example to bail
+ * out when parity is odd:
+ *
+ * if (parity8(val) == 1)
+ * return -EBADMSG;
+ *
+ * If you need to calculate a parity bit, you need to draw the conclusion from
+ * this result yourself. Example to enforce odd parity, parity bit is bit 7:
+ *
+ * if (parity8(val) == 0)
+ * val ^= BIT(7);
+ */
+static inline int parity8(u8 val)
+{
+ /*
+ * One explanation of this algorithm:
+ * https://funloop.org/codex/problem/parity/README.html
+ */
+ val ^= val >> 4;
+ return (0x6996 >> (val & 0xf)) & 1;
+}
+
/**
* __ffs64 - find first set bit in a 64 bit word
* @word: The 64 bit word
--
2.43.0
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 6.1.y-cip 02/22] dt-bindings: i3c: Add Renesas I3C controller
2026-01-08 9:28 [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 01/22] bitops: add generic parity calculation for u8 Tommaso Merciai
@ 2026-01-08 9:28 ` Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 03/22] i3c: controllers do not need to depend on I3C Tommaso Merciai
` (20 subsequent siblings)
22 siblings, 0 replies; 34+ messages in thread
From: Tommaso Merciai @ 2026-01-08 9:28 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
commit 94e611b5b9ef3a1d9ba77f41343e95155a5091d2 upstream.
Add Renesas I3C controller which is available in R9A08G045 (RZ/G3S) and
R9A09G047 (RZ/G3E) SoCs.
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20250724094146.6443-4-wsa+renesas@sang-engineering.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
.../devicetree/bindings/i3c/renesas,i3c.yaml | 179 ++++++++++++++++++
1 file changed, 179 insertions(+)
create mode 100644 Documentation/devicetree/bindings/i3c/renesas,i3c.yaml
diff --git a/Documentation/devicetree/bindings/i3c/renesas,i3c.yaml b/Documentation/devicetree/bindings/i3c/renesas,i3c.yaml
new file mode 100644
index 000000000000..fe2e9633c46f
--- /dev/null
+++ b/Documentation/devicetree/bindings/i3c/renesas,i3c.yaml
@@ -0,0 +1,179 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/i3c/renesas,i3c.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas RZ/G3S and RZ/G3E I3C Bus Interface
+
+maintainers:
+ - Wolfram Sang <wsa+renesas@sang-engineering.com>
+ - Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
+
+properties:
+ compatible:
+ items:
+ - enum:
+ - renesas,r9a08g045-i3c # RZ/G3S
+ - renesas,r9a09g047-i3c # RZ/G3E
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ items:
+ - description: Non-recoverable internal error interrupt
+ - description: Normal transfer error interrupt
+ - description: Normal transfer abort interrupt
+ - description: Normal response status buffer full interrupt
+ - description: Normal command buffer empty interrupt
+ - description: Normal IBI status buffer full interrupt
+ - description: Normal Rx data buffer full interrupt
+ - description: Normal Tx data buffer empty interrupt
+ - description: Normal receive status buffer full interrupt
+ - description: START condition detection interrupt
+ - description: STOP condition detection interrupt
+ - description: Transmit end interrupt
+ - description: NACK detection interrupt
+ - description: Arbitration lost interrupt
+ - description: Timeout detection interrupt
+ - description: Wake-up condition detection interrupt
+ - description: HDR Exit Pattern detection interrupt
+ minItems: 16
+
+ interrupt-names:
+ items:
+ - const: ierr
+ - const: terr
+ - const: abort
+ - const: resp
+ - const: cmd
+ - const: ibi
+ - const: rx
+ - const: tx
+ - const: rcv
+ - const: st
+ - const: sp
+ - const: tend
+ - const: nack
+ - const: al
+ - const: tmo
+ - const: wu
+ - const: exit
+ minItems: 16
+
+ clocks:
+ items:
+ - description: APB bus clock
+ - description: transfer clock
+ - description: SFRs clock
+ minItems: 2
+
+ clock-names:
+ items:
+ - const: pclk
+ - const: tclk
+ - const: pclkrw
+ minItems: 2
+
+ power-domains:
+ maxItems: 1
+
+ resets:
+ items:
+ - description: Reset signal
+ - description: APB interface reset signal/SCAN reset signal
+
+ reset-names:
+ items:
+ - const: presetn
+ - const: tresetn
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - interrupt-names
+ - clock-names
+ - clocks
+ - power-domains
+ - resets
+ - reset-names
+
+allOf:
+ - $ref: i3c.yaml#
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: renesas,r9a08g045-i3c
+ then:
+ properties:
+ clocks:
+ maxItems: 2
+ clock-names:
+ maxItems: 2
+ interrupts:
+ minItems: 17
+ interrupt-names:
+ minItems: 17
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: renesas,r9a09g047-i3c
+ then:
+ properties:
+ clocks:
+ minItems: 3
+ clock-names:
+ minItems: 3
+ interrupts:
+ maxItems: 16
+ interrupt-names:
+ maxItems: 16
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/clock/r9a08g045-cpg.h>
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+ i3c@1005b000 {
+ compatible = "renesas,r9a08g045-i3c";
+ reg = <0x1005b000 0x1000>;
+ clocks = <&cpg CPG_MOD R9A08G045_I3C_PCLK>,
+ <&cpg CPG_MOD R9A08G045_I3C_TCLK>;
+ clock-names = "pclk", "tclk";
+ interrupts = <GIC_SPI 289 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 290 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 293 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 294 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 295 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 296 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 297 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 298 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 299 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 304 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 305 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 307 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 308 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 309 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 310 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 311 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 306 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "ierr", "terr", "abort", "resp",
+ "cmd", "ibi", "rx", "tx", "rcv",
+ "st", "sp", "tend", "nack",
+ "al", "tmo", "wu", "exit";
+ resets = <&cpg R9A08G045_I3C_PRESETN>,
+ <&cpg R9A08G045_I3C_TRESETN>;
+ reset-names = "presetn", "tresetn";
+ power-domains = <&cpg>;
+ #address-cells = <3>;
+ #size-cells = <0>;
+ };
+...
--
2.43.0
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 6.1.y-cip 03/22] i3c: controllers do not need to depend on I3C
2026-01-08 9:28 [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 01/22] bitops: add generic parity calculation for u8 Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 02/22] dt-bindings: i3c: Add Renesas I3C controller Tommaso Merciai
@ 2026-01-08 9:28 ` Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 04/22] i3c: master: Add basic driver for the Renesas I3C controller Tommaso Merciai
` (19 subsequent siblings)
22 siblings, 0 replies; 34+ messages in thread
From: Tommaso Merciai @ 2026-01-08 9:28 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
commit 00286d7d643d3c98e48d9cc3a9f471b37154f462 upstream.
The Kconfig file for controller drivers is only sourced if the I3C
symbol is enabled. No need to check for that in individual drivers.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20250506075247.1545-2-wsa+renesas@sang-engineering.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
drivers/i3c/master/Kconfig | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/i3c/master/Kconfig b/drivers/i3c/master/Kconfig
index 3b8f95916f46..b5e20b28f107 100644
--- a/drivers/i3c/master/Kconfig
+++ b/drivers/i3c/master/Kconfig
@@ -1,7 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-only
config CDNS_I3C_MASTER
tristate "Cadence I3C master driver"
- depends on I3C
depends on HAS_IOMEM
depends on !(ALPHA || PARISC)
help
@@ -9,7 +8,6 @@ config CDNS_I3C_MASTER
config DW_I3C_MASTER
tristate "Synospsys DesignWare I3C master driver"
- depends on I3C
depends on HAS_IOMEM
depends on !(ALPHA || PARISC)
# ALPHA and PARISC needs {read,write}sl()
@@ -24,7 +22,6 @@ config DW_I3C_MASTER
config SVC_I3C_MASTER
tristate "Silvaco I3C Dual-Role Master driver"
- depends on I3C
depends on HAS_IOMEM
depends on !(ALPHA || PARISC)
help
@@ -32,7 +29,6 @@ config SVC_I3C_MASTER
config MIPI_I3C_HCI
tristate "MIPI I3C Host Controller Interface driver (EXPERIMENTAL)"
- depends on I3C
depends on HAS_IOMEM
help
Support for hardware following the MIPI Aliance's I3C Host Controller
--
2.43.0
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 6.1.y-cip 04/22] i3c: master: Add basic driver for the Renesas I3C controller
2026-01-08 9:28 [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E Tommaso Merciai
` (2 preceding siblings ...)
2026-01-08 9:28 ` [PATCH 6.1.y-cip 03/22] i3c: controllers do not need to depend on I3C Tommaso Merciai
@ 2026-01-08 9:28 ` Tommaso Merciai
2026-01-09 10:22 ` [cip-dev] " Pavel Machek
2026-01-14 11:53 ` Pavel Machek
2026-01-08 9:28 ` [PATCH 6.1.y-cip 05/22] i3c: Document I3C_ADDR_SLOT_EXT_STATUS_MASK Tommaso Merciai
` (18 subsequent siblings)
22 siblings, 2 replies; 34+ messages in thread
From: Tommaso Merciai @ 2026-01-08 9:28 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
commit d028219a9f1485914492bf373406f6a0e665ace2 upstream.
Add a basic driver for the I3C controller found in Renesas RZ/G3S and
G3E SoCs. Support I3C pure busses (tested with two targets) and mixed
busses (two I3C devices plus various I2C targets). DAA and communication
with temperature sensors worked reliably at various speeds.
Missing features such as IBI, HotJoin, and target mode will be added
incrementally.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20250724094146.6443-5-wsa+renesas@sang-engineering.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
[tommaso.merciai:
- Removed __counted_by(ncmds) from struct renesas_i3c_cmd cmds[]
- Added struct reset_control *tresetn, *presetn into struct
renesas_i3c
- Use devm_reset_control_get_optional_exclusive() into probe function +
reset_control_deassert() and devm_add_action_or_reset() for tresetn,
presetn error path.
- Fixed renesas_i3c_remove() from static void to static int]
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
MAINTAINERS | 7 +
drivers/i3c/master/Kconfig | 10 +
drivers/i3c/master/Makefile | 1 +
drivers/i3c/master/renesas-i3c.c | 1431 ++++++++++++++++++++++++++++++
4 files changed, 1449 insertions(+)
create mode 100644 drivers/i3c/master/renesas-i3c.c
diff --git a/MAINTAINERS b/MAINTAINERS
index f87e337db1e1..061d208b5a9f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -9700,6 +9700,13 @@ S: Maintained
F: Documentation/devicetree/bindings/i3c/cdns,i3c-master.yaml
F: drivers/i3c/master/i3c-master-cdns.c
+I3C DRIVER FOR RENESAS
+M: Wolfram Sang <wsa+renesas@sang-engineering.com>
+M: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
+S: Supported
+F: Documentation/devicetree/bindings/i3c/renesas,i3c.yaml
+F: drivers/i3c/master/renesas-i3c.c
+
I3C DRIVER FOR SYNOPSYS DESIGNWARE
M: Vitor Soares <vitor.soares@synopsys.com>
S: Maintained
diff --git a/drivers/i3c/master/Kconfig b/drivers/i3c/master/Kconfig
index b5e20b28f107..eb096e22683b 100644
--- a/drivers/i3c/master/Kconfig
+++ b/drivers/i3c/master/Kconfig
@@ -39,3 +39,13 @@ config MIPI_I3C_HCI
This driver can also be built as a module. If so, the module will be
called mipi-i3c-hci.
+
+config RENESAS_I3C
+ tristate "Renesas I3C controller driver"
+ depends on HAS_IOMEM
+ depends on ARCH_RENESAS || COMPILE_TEST
+ help
+ Support the Renesas I3C controller as found in some RZ variants.
+
+ This driver can also be built as a module. If so, the module will be
+ called renesas-i3c.
diff --git a/drivers/i3c/master/Makefile b/drivers/i3c/master/Makefile
index b3fee0f690b2..e7dd13daea72 100644
--- a/drivers/i3c/master/Makefile
+++ b/drivers/i3c/master/Makefile
@@ -3,3 +3,4 @@ obj-$(CONFIG_CDNS_I3C_MASTER) += i3c-master-cdns.o
obj-$(CONFIG_DW_I3C_MASTER) += dw-i3c-master.o
obj-$(CONFIG_SVC_I3C_MASTER) += svc-i3c-master.o
obj-$(CONFIG_MIPI_I3C_HCI) += mipi-i3c-hci/
+obj-$(CONFIG_RENESAS_I3C) += renesas-i3c.o
diff --git a/drivers/i3c/master/renesas-i3c.c b/drivers/i3c/master/renesas-i3c.c
new file mode 100644
index 000000000000..432be328a4e4
--- /dev/null
+++ b/drivers/i3c/master/renesas-i3c.c
@@ -0,0 +1,1431 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Renesas I3C Controller driver
+ * Copyright (C) 2023-25 Renesas Electronics Corp.
+ *
+ * TODO: IBI support, HotJoin support, Target support
+ */
+
+#include <linux/bitfield.h>
+#include <linux/bitops.h>
+#include <linux/clk.h>
+#include <linux/completion.h>
+#include <linux/err.h>
+#include <linux/errno.h>
+#include <linux/i2c.h>
+#include <linux/i3c/master.h>
+#include <linux/interrupt.h>
+#include <linux/ioport.h>
+#include <linux/iopoll.h>
+#include <linux/list.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_platform.h>
+#include <linux/platform_device.h>
+#include <linux/reset.h>
+#include <linux/slab.h>
+#include "../internals.h"
+
+#define PRTS 0x00
+#define PRTS_PRTMD BIT(0)
+
+#define BCTL 0x14
+#define BCTL_INCBA BIT(0)
+#define BCTL_HJACKCTL BIT(8)
+#define BCTL_ABT BIT(29)
+#define BCTL_BUSE BIT(31)
+
+#define MSDVAD 0x18
+#define MSDVAD_MDYAD(x) FIELD_PREP(GENMASK(21, 16), x)
+#define MSDVAD_MDYADV BIT(31)
+
+#define RSTCTL 0x20
+#define RSTCTL_RI3CRST BIT(0)
+#define RSTCTL_INTLRST BIT(16)
+
+#define INST 0x30
+
+#define IBINCTL 0x58
+#define IBINCTL_NRHJCTL BIT(0)
+#define IBINCTL_NRMRCTL BIT(1)
+#define IBINCTL_NRSIRCTL BIT(3)
+
+#define SVCTL 0x64
+
+#define REFCKCTL 0x70
+#define REFCKCTL_IREFCKS(x) FIELD_PREP(GENMASK(2, 0), x)
+
+#define STDBR 0x74
+#define STDBR_SBRLO(cond, x) FIELD_PREP(GENMASK(7, 0), (x) >> (cond))
+#define STDBR_SBRHO(cond, x) FIELD_PREP(GENMASK(15, 8), (x) >> (cond))
+#define STDBR_SBRLP(x) FIELD_PREP(GENMASK(21, 16), x)
+#define STDBR_SBRHP(x) FIELD_PREP(GENMASK(29, 24), x)
+#define STDBR_DSBRPO BIT(31)
+
+#define EXTBR 0x78
+#define EXTBR_EBRLO(x) FIELD_PREP(GENMASK(7, 0), x)
+#define EXTBR_EBRHO(x) FIELD_PREP(GENMASK(15, 8), x)
+#define EXTBR_EBRLP(x) FIELD_PREP(GENMASK(21, 16), x)
+#define EXTBR_EBRHP(x) FIELD_PREP(GENMASK(29, 24), x)
+
+#define BFRECDT 0x7c
+#define BFRECDT_FRECYC(x) FIELD_PREP(GENMASK(8, 0), x)
+
+#define BAVLCDT 0x80
+#define BAVLCDT_AVLCYC(x) FIELD_PREP(GENMASK(8, 0), x)
+
+#define BIDLCDT 0x84
+#define BIDLCDT_IDLCYC(x) FIELD_PREP(GENMASK(17, 0), x)
+
+#define ACKCTL 0xa0
+#define ACKCTL_ACKT BIT(1)
+#define ACKCTL_ACKTWP BIT(2)
+
+#define SCSTRCTL 0xa4
+#define SCSTRCTL_ACKTWE BIT(0)
+#define SCSTRCTL_RWE BIT(1)
+
+#define SCSTLCTL 0xb0
+
+#define CNDCTL 0x140
+#define CNDCTL_STCND BIT(0)
+#define CNDCTL_SRCND BIT(1)
+#define CNDCTL_SPCND BIT(2)
+
+#define NCMDQP 0x150 /* Normal Command Queue */
+#define NCMDQP_CMD_ATTR(x) FIELD_PREP(GENMASK(2, 0), x)
+#define NCMDQP_IMMED_XFER 0x01
+#define NCMDQP_ADDR_ASSGN 0x02
+#define NCMDQP_TID(x) FIELD_PREP(GENMASK(6, 3), x)
+#define NCMDQP_CMD(x) FIELD_PREP(GENMASK(14, 7), x)
+#define NCMDQP_CP BIT(15)
+#define NCMDQP_DEV_INDEX(x) FIELD_PREP(GENMASK(20, 16), x)
+#define NCMDQP_BYTE_CNT(x) FIELD_PREP(GENMASK(25, 23), x)
+#define NCMDQP_DEV_COUNT(x) FIELD_PREP(GENMASK(29, 26), x)
+#define NCMDQP_MODE(x) FIELD_PREP(GENMASK(28, 26), x)
+#define NCMDQP_RNW(x) FIELD_PREP(GENMASK(29, 29), x)
+#define NCMDQP_ROC BIT(30)
+#define NCMDQP_TOC BIT(31)
+#define NCMDQP_DATA_LENGTH(x) FIELD_PREP(GENMASK(31, 16), x)
+
+#define NRSPQP 0x154 /* Normal Respone Queue */
+#define NRSPQP_NO_ERROR 0
+#define NRSPQP_ERROR_CRC 1
+#define NRSPQP_ERROR_PARITY 2
+#define NRSPQP_ERROR_FRAME 3
+#define NRSPQP_ERROR_IBA_NACK 4
+#define NRSPQP_ERROR_ADDRESS_NACK 5
+#define NRSPQP_ERROR_OVER_UNDER_FLOW 6
+#define NRSPQP_ERROR_TRANSF_ABORT 8
+#define NRSPQP_ERROR_I2C_W_NACK_ERR 9
+#define NRSPQP_ERROR_UNSUPPORTED 10
+#define NRSPQP_DATA_LEN(x) FIELD_GET(GENMASK(15, 0), x)
+#define NRSPQP_ERR_STATUS(x) FIELD_GET(GENMASK(31, 28), x)
+
+#define NTDTBP0 0x158 /* Normal Transfer Data Buffer */
+#define NTDTBP0_DEPTH 16
+
+#define NQTHCTL 0x190
+#define NQTHCTL_CMDQTH(x) FIELD_PREP(GENMASK(1, 0), x)
+#define NQTHCTL_IBIDSSZ(x) FIELD_PREP(GENMASK(23, 16), x)
+
+#define NTBTHCTL0 0x194
+
+#define NRQTHCTL 0x1c0
+
+#define BST 0x1d0
+#define BST_STCNDDF BIT(0)
+#define BST_SPCNDDF BIT(1)
+#define BST_NACKDF BIT(4)
+#define BST_TENDF BIT(8)
+
+#define BSTE 0x1d4
+#define BSTE_STCNDDE BIT(0)
+#define BSTE_SPCNDDE BIT(1)
+#define BSTE_NACKDE BIT(4)
+#define BSTE_TENDE BIT(8)
+#define BSTE_ALE BIT(16)
+#define BSTE_TODE BIT(20)
+#define BSTE_WUCNDDE BIT(24)
+#define BSTE_ALL_FLAG (BSTE_STCNDDE | BSTE_SPCNDDE |\
+ BSTE_NACKDE | BSTE_TENDE |\
+ BSTE_ALE | BSTE_TODE | BSTE_WUCNDDE)
+
+#define BIE 0x1d8
+#define BIE_STCNDDIE BIT(0)
+#define BIE_SPCNDDIE BIT(1)
+#define BIE_NACKDIE BIT(4)
+#define BIE_TENDIE BIT(8)
+
+#define NTST 0x1e0
+#define NTST_TDBEF0 BIT(0)
+#define NTST_RDBFF0 BIT(1)
+#define NTST_CMDQEF BIT(3)
+#define NTST_RSPQFF BIT(4)
+#define NTST_TABTF BIT(5)
+#define NTST_TEF BIT(9)
+
+#define NTSTE 0x1e4
+#define NTSTE_TDBEE0 BIT(0)
+#define NTSTE_RDBFE0 BIT(1)
+#define NTSTE_IBIQEFE BIT(2)
+#define NTSTE_CMDQEE BIT(3)
+#define NTSTE_RSPQFE BIT(4)
+#define NTSTE_TABTE BIT(5)
+#define NTSTE_TEE BIT(9)
+#define NTSTE_RSQFE BIT(20)
+#define NTSTE_ALL_FLAG (NTSTE_TDBEE0 | NTSTE_RDBFE0 |\
+ NTSTE_IBIQEFE | NTSTE_CMDQEE |\
+ NTSTE_RSPQFE | NTSTE_TABTE |\
+ NTSTE_TEE | NTSTE_RSQFE)
+
+#define NTIE 0x1e8
+#define NTIE_TDBEIE0 BIT(0)
+#define NTIE_RDBFIE0 BIT(1)
+#define NTIE_IBIQEFIE BIT(2)
+#define NTIE_RSPQFIE BIT(4)
+#define NTIE_RSQFIE BIT(20)
+
+#define BCST 0x210
+#define BCST_BFREF BIT(0)
+
+#define DATBAS(x) (0x224 + 0x8 * (x))
+#define DATBAS_DVSTAD(x) FIELD_PREP(GENMASK(6, 0), x)
+#define DATBAS_DVDYAD(x) FIELD_PREP(GENMASK(23, 16), x)
+
+#define NDBSTLV0 0x398
+#define NDBSTLV0_RDBLV(x) FIELD_GET(GENMASK(15, 8), x)
+
+#define RENESAS_I3C_MAX_DEVS 8
+#define I2C_INIT_MSG -1
+
+enum i3c_internal_state {
+ I3C_INTERNAL_STATE_DISABLED,
+ I3C_INTERNAL_STATE_CONTROLLER_IDLE,
+ I3C_INTERNAL_STATE_CONTROLLER_ENTDAA,
+ I3C_INTERNAL_STATE_CONTROLLER_SETDASA,
+ I3C_INTERNAL_STATE_CONTROLLER_WRITE,
+ I3C_INTERNAL_STATE_CONTROLLER_READ,
+ I3C_INTERNAL_STATE_CONTROLLER_COMMAND_WRITE,
+ I3C_INTERNAL_STATE_CONTROLLER_COMMAND_READ,
+};
+
+enum renesas_i3c_event {
+ I3C_COMMAND_ADDRESS_ASSIGNMENT,
+ I3C_WRITE,
+ I3C_READ,
+ I3C_COMMAND_WRITE,
+ I3C_COMMAND_READ,
+};
+
+struct renesas_i3c_cmd {
+ u32 cmd0;
+ u32 len;
+ const void *tx_buf;
+ u32 tx_count;
+ void *rx_buf;
+ u32 rx_count;
+ u32 err;
+ u8 rnw;
+ /* i2c xfer */
+ int i2c_bytes_left;
+ int i2c_is_last;
+ u8 *i2c_buf;
+ const struct i2c_msg *msg;
+};
+
+struct renesas_i3c_xfer {
+ struct list_head node;
+ struct completion comp;
+ int ret;
+ bool is_i2c_xfer;
+ unsigned int ncmds;
+ struct renesas_i3c_cmd cmds[];
+};
+
+struct renesas_i3c_xferqueue {
+ struct list_head list;
+ struct renesas_i3c_xfer *cur;
+ /* Lock for accessing the xfer queue */
+ spinlock_t lock;
+};
+
+struct renesas_i3c {
+ struct i3c_master_controller base;
+ enum i3c_internal_state internal_state;
+ u16 maxdevs;
+ u32 free_pos;
+ u32 i2c_STDBR;
+ u32 i3c_STDBR;
+ u8 addrs[RENESAS_I3C_MAX_DEVS];
+ struct renesas_i3c_xferqueue xferqueue;
+ void __iomem *regs;
+ struct clk *tclk;
+ struct reset_control *tresetn;
+ struct reset_control *presetn;
+};
+
+struct renesas_i3c_i2c_dev_data {
+ u8 index;
+};
+
+struct renesas_i3c_irq_desc {
+ const char *name;
+ irq_handler_t isr;
+ const char *desc;
+};
+
+struct renesas_i3c_config {
+ unsigned int has_pclkrw:1;
+};
+
+static inline void renesas_i3c_reg_update(void __iomem *reg, u32 mask, u32 val)
+{
+ u32 data = readl(reg);
+
+ data &= ~mask;
+ data |= (val & mask);
+ writel(data, reg);
+}
+
+static inline u32 renesas_readl(void __iomem *base, u32 reg)
+{
+ return readl(base + reg);
+}
+
+static inline void renesas_writel(void __iomem *base, u32 reg, u32 val)
+{
+ writel(val, base + reg);
+}
+
+static void renesas_set_bit(void __iomem *base, u32 reg, u32 val)
+{
+ renesas_i3c_reg_update(base + reg, val, val);
+}
+
+static void renesas_clear_bit(void __iomem *base, u32 reg, u32 val)
+{
+ renesas_i3c_reg_update(base + reg, val, 0);
+}
+
+static inline struct renesas_i3c *to_renesas_i3c(struct i3c_master_controller *m)
+{
+ return container_of(m, struct renesas_i3c, base);
+}
+
+static inline u32 datbas_dvdyad_with_parity(u8 addr)
+{
+ return DATBAS_DVDYAD(addr | (parity8(addr) ? 0 : BIT(7)));
+}
+
+static int renesas_i3c_get_free_pos(struct renesas_i3c *i3c)
+{
+ if (!(i3c->free_pos & GENMASK(i3c->maxdevs - 1, 0)))
+ return -ENOSPC;
+
+ return ffs(i3c->free_pos) - 1;
+}
+
+static int renesas_i3c_get_addr_pos(struct renesas_i3c *i3c, u8 addr)
+{
+ int pos;
+
+ for (pos = 0; pos < i3c->maxdevs; pos++) {
+ if (addr == i3c->addrs[pos])
+ return pos;
+ }
+
+ return -EINVAL;
+}
+
+static struct renesas_i3c_xfer *renesas_i3c_alloc_xfer(struct renesas_i3c *i3c,
+ unsigned int ncmds)
+{
+ struct renesas_i3c_xfer *xfer;
+
+ xfer = kzalloc(struct_size(xfer, cmds, ncmds), GFP_KERNEL);
+ if (!xfer)
+ return NULL;
+
+ INIT_LIST_HEAD(&xfer->node);
+ xfer->ncmds = ncmds;
+ xfer->ret = -ETIMEDOUT;
+
+ return xfer;
+}
+
+static void renesas_i3c_start_xfer_locked(struct renesas_i3c *i3c)
+{
+ struct renesas_i3c_xfer *xfer = i3c->xferqueue.cur;
+ struct renesas_i3c_cmd *cmd;
+ u32 cmd1;
+
+ if (!xfer)
+ return;
+
+ cmd = xfer->cmds;
+
+ switch (i3c->internal_state) {
+ case I3C_INTERNAL_STATE_CONTROLLER_ENTDAA:
+ case I3C_INTERNAL_STATE_CONTROLLER_SETDASA:
+ renesas_set_bit(i3c->regs, NTIE, NTIE_RSPQFIE);
+ renesas_writel(i3c->regs, NCMDQP, cmd->cmd0);
+ renesas_writel(i3c->regs, NCMDQP, 0);
+ break;
+ case I3C_INTERNAL_STATE_CONTROLLER_WRITE:
+ case I3C_INTERNAL_STATE_CONTROLLER_COMMAND_WRITE:
+ renesas_set_bit(i3c->regs, NTIE, NTIE_RSPQFIE);
+ if (cmd->len <= 4) {
+ cmd->cmd0 |= NCMDQP_CMD_ATTR(NCMDQP_IMMED_XFER);
+ cmd->cmd0 |= NCMDQP_BYTE_CNT(cmd->len);
+ cmd->tx_count = cmd->len;
+ cmd1 = cmd->len == 0 ? 0 : *(u32 *)cmd->tx_buf;
+ } else {
+ cmd1 = NCMDQP_DATA_LENGTH(cmd->len);
+ }
+ renesas_writel(i3c->regs, NCMDQP, cmd->cmd0);
+ renesas_writel(i3c->regs, NCMDQP, cmd1);
+ break;
+ case I3C_INTERNAL_STATE_CONTROLLER_READ:
+ case I3C_INTERNAL_STATE_CONTROLLER_COMMAND_READ:
+ renesas_set_bit(i3c->regs, NTIE, NTIE_RDBFIE0);
+ cmd1 = NCMDQP_DATA_LENGTH(cmd->len);
+ renesas_writel(i3c->regs, NCMDQP, cmd->cmd0);
+ renesas_writel(i3c->regs, NCMDQP, cmd1);
+ break;
+ default:
+ break;
+ }
+
+ /* Clear the command queue empty flag */
+ renesas_clear_bit(i3c->regs, NTST, NTST_CMDQEF);
+}
+
+static void renesas_i3c_dequeue_xfer_locked(struct renesas_i3c *i3c,
+ struct renesas_i3c_xfer *xfer)
+{
+ if (i3c->xferqueue.cur == xfer)
+ i3c->xferqueue.cur = NULL;
+ else
+ list_del_init(&xfer->node);
+}
+
+static void renesas_i3c_dequeue_xfer(struct renesas_i3c *i3c, struct renesas_i3c_xfer *xfer)
+{
+ scoped_guard(spinlock_irqsave, &i3c->xferqueue.lock)
+ renesas_i3c_dequeue_xfer_locked(i3c, xfer);
+}
+
+static void renesas_i3c_enqueue_xfer(struct renesas_i3c *i3c, struct renesas_i3c_xfer *xfer)
+{
+ reinit_completion(&xfer->comp);
+ scoped_guard(spinlock_irqsave, &i3c->xferqueue.lock) {
+ if (i3c->xferqueue.cur) {
+ list_add_tail(&xfer->node, &i3c->xferqueue.list);
+ } else {
+ i3c->xferqueue.cur = xfer;
+ if (!xfer->is_i2c_xfer)
+ renesas_i3c_start_xfer_locked(i3c);
+ }
+ }
+}
+
+static void renesas_i3c_wait_xfer(struct renesas_i3c *i3c, struct renesas_i3c_xfer *xfer)
+{
+ unsigned long time_left;
+
+ renesas_i3c_enqueue_xfer(i3c, xfer);
+
+ time_left = wait_for_completion_timeout(&xfer->comp, msecs_to_jiffies(1000));
+ if (!time_left)
+ renesas_i3c_dequeue_xfer(i3c, xfer);
+}
+
+static void renesas_i3c_set_prts(struct renesas_i3c *i3c, u32 val)
+{
+ /* Required sequence according to tnrza0140ae */
+ renesas_set_bit(i3c->regs, RSTCTL, RSTCTL_INTLRST);
+ renesas_writel(i3c->regs, PRTS, val);
+ renesas_clear_bit(i3c->regs, RSTCTL, RSTCTL_INTLRST);
+}
+
+static void renesas_i3c_bus_enable(struct i3c_master_controller *m, bool i3c_mode)
+{
+ struct renesas_i3c *i3c = to_renesas_i3c(m);
+
+ /* Setup either I3C or I2C protocol */
+ if (i3c_mode) {
+ renesas_i3c_set_prts(i3c, 0);
+ /* Revisit: INCBA handling, especially after I2C transfers */
+ renesas_set_bit(i3c->regs, BCTL, BCTL_HJACKCTL | BCTL_INCBA);
+ renesas_set_bit(i3c->regs, MSDVAD, MSDVAD_MDYADV);
+ renesas_writel(i3c->regs, STDBR, i3c->i3c_STDBR);
+ } else {
+ renesas_i3c_set_prts(i3c, PRTS_PRTMD);
+ renesas_writel(i3c->regs, STDBR, i3c->i2c_STDBR);
+ }
+
+ /* Enable I3C bus */
+ renesas_set_bit(i3c->regs, BCTL, BCTL_BUSE);
+}
+
+static int renesas_i3c_reset(struct renesas_i3c *i3c)
+{
+ u32 val;
+
+ renesas_writel(i3c->regs, BCTL, 0);
+ renesas_set_bit(i3c->regs, RSTCTL, RSTCTL_RI3CRST);
+
+ return read_poll_timeout(renesas_readl, val, !(val & RSTCTL_RI3CRST),
+ 0, 1000, false, i3c->regs, RSTCTL);
+}
+
+static int renesas_i3c_bus_init(struct i3c_master_controller *m)
+{
+ struct renesas_i3c *i3c = to_renesas_i3c(m);
+ struct i3c_bus *bus = i3c_master_get_bus(m);
+ struct i3c_device_info info = {};
+ struct i2c_timings t;
+ unsigned long rate;
+ u32 double_SBR, val;
+ int cks, pp_high_ticks, pp_low_ticks, i3c_total_ticks;
+ int od_high_ticks, od_low_ticks, i2c_total_ticks;
+ int ret;
+
+ rate = clk_get_rate(i3c->tclk);
+ if (!rate)
+ return -EINVAL;
+
+ ret = renesas_i3c_reset(i3c);
+ if (ret)
+ return ret;
+
+ i2c_total_ticks = DIV_ROUND_UP(rate, bus->scl_rate.i2c);
+ i3c_total_ticks = DIV_ROUND_UP(rate, bus->scl_rate.i3c);
+
+ i2c_parse_fw_timings(&m->dev, &t, true);
+
+ for (cks = 0; cks < 7; cks++) {
+ /* SCL low-period calculation in Open-drain mode */
+ od_low_ticks = ((i2c_total_ticks * 6) / 10);
+
+ /* SCL clock calculation in Push-Pull mode */
+ if (bus->mode == I3C_BUS_MODE_PURE)
+ pp_high_ticks = ((i3c_total_ticks * 5) / 10);
+ else
+ pp_high_ticks = DIV_ROUND_UP(I3C_BUS_THIGH_MIXED_MAX_NS,
+ NSEC_PER_SEC / rate);
+ pp_low_ticks = i3c_total_ticks - pp_high_ticks;
+
+ if ((od_low_ticks / 2) <= 0xFF && pp_low_ticks < 0x3F)
+ break;
+
+ i2c_total_ticks /= 2;
+ i3c_total_ticks /= 2;
+ rate /= 2;
+ }
+
+ /* SCL clock period calculation in Open-drain mode */
+ if ((od_low_ticks / 2) > 0xFF || pp_low_ticks > 0x3F) {
+ dev_err(&m->dev, "invalid speed (i2c-scl = %lu Hz, i3c-scl = %lu Hz). Too slow.\n",
+ (unsigned long)bus->scl_rate.i2c, (unsigned long)bus->scl_rate.i3c);
+ return -EINVAL;
+ }
+
+ /* SCL high-period calculation in Open-drain mode */
+ od_high_ticks = i2c_total_ticks - od_low_ticks;
+
+ /* Standard Bit Rate setting */
+ double_SBR = od_low_ticks > 0xFF ? 1 : 0;
+ i3c->i3c_STDBR = (double_SBR ? STDBR_DSBRPO : 0) |
+ STDBR_SBRLO(double_SBR, od_low_ticks) |
+ STDBR_SBRHO(double_SBR, od_high_ticks) |
+ STDBR_SBRLP(pp_low_ticks) |
+ STDBR_SBRHP(pp_high_ticks);
+
+ od_low_ticks -= t.scl_fall_ns / (NSEC_PER_SEC / rate) + 1;
+ od_high_ticks -= t.scl_rise_ns / (NSEC_PER_SEC / rate) + 1;
+ i3c->i2c_STDBR = (double_SBR ? STDBR_DSBRPO : 0) |
+ STDBR_SBRLO(double_SBR, od_low_ticks) |
+ STDBR_SBRHO(double_SBR, od_high_ticks) |
+ STDBR_SBRLP(pp_low_ticks) |
+ STDBR_SBRHP(pp_high_ticks);
+ renesas_writel(i3c->regs, STDBR, i3c->i3c_STDBR);
+
+ /* Extended Bit Rate setting */
+ renesas_writel(i3c->regs, EXTBR, EXTBR_EBRLO(od_low_ticks) |
+ EXTBR_EBRHO(od_high_ticks) |
+ EXTBR_EBRLP(pp_low_ticks) |
+ EXTBR_EBRHP(pp_high_ticks));
+
+ renesas_writel(i3c->regs, REFCKCTL, REFCKCTL_IREFCKS(cks));
+
+ /* Disable Slave Mode */
+ renesas_writel(i3c->regs, SVCTL, 0);
+
+ /* Initialize Queue/Buffer threshold */
+ renesas_writel(i3c->regs, NQTHCTL, NQTHCTL_IBIDSSZ(6) |
+ NQTHCTL_CMDQTH(1));
+
+ /* The only supported configuration is two entries*/
+ renesas_writel(i3c->regs, NTBTHCTL0, 0);
+ /* Interrupt when there is one entry in the queue */
+ renesas_writel(i3c->regs, NRQTHCTL, 0);
+
+ /* Enable all Bus/Transfer Status Flags */
+ renesas_writel(i3c->regs, BSTE, BSTE_ALL_FLAG);
+ renesas_writel(i3c->regs, NTSTE, NTSTE_ALL_FLAG);
+
+ /* Interrupt enable settings */
+ renesas_writel(i3c->regs, BIE, BIE_NACKDIE | BIE_TENDIE);
+ renesas_writel(i3c->regs, NTIE, 0);
+
+ /* Clear Status register */
+ renesas_writel(i3c->regs, NTST, 0);
+ renesas_writel(i3c->regs, INST, 0);
+ renesas_writel(i3c->regs, BST, 0);
+
+ /* Hot-Join Acknowlege setting. */
+ renesas_set_bit(i3c->regs, BCTL, BCTL_HJACKCTL);
+
+ renesas_writel(i3c->regs, IBINCTL, IBINCTL_NRHJCTL | IBINCTL_NRMRCTL |
+ IBINCTL_NRSIRCTL);
+
+ renesas_writel(i3c->regs, SCSTLCTL, 0);
+ renesas_set_bit(i3c->regs, SCSTRCTL, SCSTRCTL_ACKTWE);
+
+ /* Bus condition timing */
+ val = DIV_ROUND_UP(I3C_BUS_TBUF_MIXED_FM_MIN_NS, NSEC_PER_SEC / rate);
+ renesas_writel(i3c->regs, BFRECDT, BFRECDT_FRECYC(val));
+
+ val = DIV_ROUND_UP(I3C_BUS_TAVAL_MIN_NS, NSEC_PER_SEC / rate);
+ renesas_writel(i3c->regs, BAVLCDT, BAVLCDT_AVLCYC(val));
+
+ val = DIV_ROUND_UP(I3C_BUS_TIDLE_MIN_NS, NSEC_PER_SEC / rate);
+ renesas_writel(i3c->regs, BIDLCDT, BIDLCDT_IDLCYC(val));
+
+ ret = i3c_master_get_free_addr(m, 0);
+ if (ret < 0)
+ return ret;
+
+ renesas_writel(i3c->regs, MSDVAD, MSDVAD_MDYAD(ret) | MSDVAD_MDYADV);
+
+ memset(&info, 0, sizeof(info));
+ info.dyn_addr = ret;
+ return i3c_master_set_info(&i3c->base, &info);
+}
+
+static void renesas_i3c_bus_cleanup(struct i3c_master_controller *m)
+{
+ struct renesas_i3c *i3c = to_renesas_i3c(m);
+
+ renesas_i3c_reset(i3c);
+}
+
+static int renesas_i3c_daa(struct i3c_master_controller *m)
+{
+ struct renesas_i3c *i3c = to_renesas_i3c(m);
+ struct renesas_i3c_cmd *cmd;
+ u32 olddevs, newdevs;
+ u8 last_addr = 0, pos;
+ int ret;
+
+ struct renesas_i3c_xfer *xfer __free(kfree) = renesas_i3c_alloc_xfer(i3c, 1);
+ if (!xfer)
+ return -ENOMEM;
+
+ /* Enable I3C bus. */
+ renesas_i3c_bus_enable(m, true);
+
+ olddevs = ~(i3c->free_pos);
+ i3c->internal_state = I3C_INTERNAL_STATE_CONTROLLER_ENTDAA;
+
+ /* Setting DATBASn registers for target devices. */
+ for (pos = 0; pos < i3c->maxdevs; pos++) {
+ if (olddevs & BIT(pos))
+ continue;
+
+ ret = i3c_master_get_free_addr(m, last_addr + 1);
+ if (ret < 0)
+ return -ENOSPC;
+
+ i3c->addrs[pos] = ret;
+ last_addr = ret;
+
+ renesas_writel(i3c->regs, DATBAS(pos), datbas_dvdyad_with_parity(ret));
+ }
+
+ init_completion(&xfer->comp);
+ cmd = xfer->cmds;
+ cmd->rx_count = 0;
+
+ ret = renesas_i3c_get_free_pos(i3c);
+ if (ret < 0)
+ return ret;
+
+ /*
+ * Setup the command descriptor to start the ENTDAA command
+ * and starting at the selected device index.
+ */
+ cmd->cmd0 = NCMDQP_CMD_ATTR(NCMDQP_ADDR_ASSGN) | NCMDQP_ROC |
+ NCMDQP_TID(I3C_COMMAND_ADDRESS_ASSIGNMENT) |
+ NCMDQP_CMD(I3C_CCC_ENTDAA) | NCMDQP_DEV_INDEX(ret) |
+ NCMDQP_DEV_COUNT(i3c->maxdevs - ret) | NCMDQP_TOC;
+
+ renesas_i3c_wait_xfer(i3c, xfer);
+
+ newdevs = GENMASK(i3c->maxdevs - cmd->rx_count - 1, 0);
+ newdevs &= ~olddevs;
+
+ for (pos = 0; pos < i3c->maxdevs; pos++) {
+ if (newdevs & BIT(pos))
+ i3c_master_add_i3c_dev_locked(m, i3c->addrs[pos]);
+ }
+
+ return ret < 0 ? ret : 0;
+}
+
+static bool renesas_i3c_supports_ccc_cmd(struct i3c_master_controller *m,
+ const struct i3c_ccc_cmd *cmd)
+{
+ if (cmd->ndests > 1)
+ return false;
+
+ switch (cmd->id) {
+ case I3C_CCC_ENEC(true):
+ case I3C_CCC_ENEC(false):
+ case I3C_CCC_DISEC(true):
+ case I3C_CCC_DISEC(false):
+ case I3C_CCC_ENTAS(0, true):
+ case I3C_CCC_ENTAS(1, true):
+ case I3C_CCC_ENTAS(2, true):
+ case I3C_CCC_ENTAS(3, true):
+ case I3C_CCC_ENTAS(0, false):
+ case I3C_CCC_ENTAS(1, false):
+ case I3C_CCC_ENTAS(2, false):
+ case I3C_CCC_ENTAS(3, false):
+ case I3C_CCC_RSTDAA(true):
+ case I3C_CCC_RSTDAA(false):
+ case I3C_CCC_ENTDAA:
+ case I3C_CCC_DEFSLVS:
+ case I3C_CCC_SETMWL(true):
+ case I3C_CCC_SETMWL(false):
+ case I3C_CCC_SETMRL(true):
+ case I3C_CCC_SETMRL(false):
+ case I3C_CCC_ENTTM:
+ case I3C_CCC_SETDASA:
+ case I3C_CCC_SETNEWDA:
+ case I3C_CCC_GETMWL:
+ case I3C_CCC_GETMRL:
+ case I3C_CCC_GETPID:
+ case I3C_CCC_GETBCR:
+ case I3C_CCC_GETDCR:
+ case I3C_CCC_GETSTATUS:
+ case I3C_CCC_GETACCMST:
+ case I3C_CCC_GETMXDS:
+ return true;
+ default:
+ return false;
+ }
+}
+
+static int renesas_i3c_send_ccc_cmd(struct i3c_master_controller *m,
+ struct i3c_ccc_cmd *ccc)
+{
+ struct renesas_i3c *i3c = to_renesas_i3c(m);
+ struct renesas_i3c_xfer *xfer;
+ struct renesas_i3c_cmd *cmd;
+ int ret, pos = 0;
+
+ if (ccc->id & I3C_CCC_DIRECT) {
+ pos = renesas_i3c_get_addr_pos(i3c, ccc->dests[0].addr);
+ if (pos < 0)
+ return pos;
+ }
+
+ xfer = renesas_i3c_alloc_xfer(i3c, 1);
+ if (!xfer)
+ return -ENOMEM;
+
+ renesas_i3c_bus_enable(m, true);
+
+ init_completion(&xfer->comp);
+ cmd = xfer->cmds;
+ cmd->rnw = ccc->rnw;
+ cmd->cmd0 = 0;
+
+ /* Calculate the command descriptor. */
+ switch (ccc->id) {
+ case I3C_CCC_SETDASA:
+ renesas_writel(i3c->regs, DATBAS(pos),
+ DATBAS_DVSTAD(ccc->dests[0].addr) |
+ DATBAS_DVDYAD(*(u8 *)ccc->dests[0].payload.data >> 1));
+ cmd->cmd0 = NCMDQP_CMD_ATTR(NCMDQP_ADDR_ASSGN) | NCMDQP_ROC |
+ NCMDQP_TID(I3C_COMMAND_ADDRESS_ASSIGNMENT) |
+ NCMDQP_CMD(I3C_CCC_SETDASA) | NCMDQP_DEV_INDEX(pos) |
+ NCMDQP_DEV_COUNT(0) | NCMDQP_TOC;
+ i3c->internal_state = I3C_INTERNAL_STATE_CONTROLLER_SETDASA;
+ break;
+ default:
+ /* Calculate the command descriptor. */
+ cmd->cmd0 = NCMDQP_TID(I3C_COMMAND_WRITE) | NCMDQP_MODE(0) |
+ NCMDQP_RNW(ccc->rnw) | NCMDQP_CMD(ccc->id) |
+ NCMDQP_ROC | NCMDQP_TOC | NCMDQP_CP |
+ NCMDQP_DEV_INDEX(pos);
+
+ if (ccc->rnw) {
+ cmd->rx_buf = ccc->dests[0].payload.data;
+ cmd->len = ccc->dests[0].payload.len;
+ cmd->rx_count = 0;
+ i3c->internal_state = I3C_INTERNAL_STATE_CONTROLLER_COMMAND_READ;
+ } else {
+ cmd->tx_buf = ccc->dests[0].payload.data;
+ cmd->len = ccc->dests[0].payload.len;
+ cmd->tx_count = 0;
+ i3c->internal_state = I3C_INTERNAL_STATE_CONTROLLER_COMMAND_WRITE;
+ }
+ }
+
+ renesas_i3c_wait_xfer(i3c, xfer);
+
+ ret = xfer->ret;
+ if (ret)
+ ccc->err = I3C_ERROR_M2;
+
+ kfree(xfer);
+
+ return ret;
+}
+
+static int renesas_i3c_priv_xfers(struct i3c_dev_desc *dev, struct i3c_priv_xfer *i3c_xfers,
+ int i3c_nxfers)
+{
+ struct i3c_master_controller *m = i3c_dev_get_master(dev);
+ struct renesas_i3c *i3c = to_renesas_i3c(m);
+ struct renesas_i3c_i2c_dev_data *data = i3c_dev_get_master_data(dev);
+ struct renesas_i3c_xfer *xfer;
+ int i;
+
+ /* Enable I3C bus. */
+ renesas_i3c_bus_enable(m, true);
+
+ xfer = renesas_i3c_alloc_xfer(i3c, 1);
+ if (!xfer)
+ return -ENOMEM;
+
+ init_completion(&xfer->comp);
+
+ for (i = 0; i < i3c_nxfers; i++) {
+ struct renesas_i3c_cmd *cmd = xfer->cmds;
+
+ /* Calculate the Transfer Command Descriptor */
+ cmd->rnw = i3c_xfers[i].rnw;
+ cmd->cmd0 = NCMDQP_DEV_INDEX(data->index) | NCMDQP_MODE(0) |
+ NCMDQP_RNW(cmd->rnw) | NCMDQP_ROC | NCMDQP_TOC;
+
+ if (i3c_xfers[i].rnw) {
+ cmd->rx_count = 0;
+ cmd->cmd0 |= NCMDQP_TID(I3C_READ);
+ cmd->rx_buf = i3c_xfers[i].data.in;
+ cmd->len = i3c_xfers[i].len;
+ i3c->internal_state = I3C_INTERNAL_STATE_CONTROLLER_READ;
+ } else {
+ cmd->tx_count = 0;
+ cmd->cmd0 |= NCMDQP_TID(I3C_WRITE);
+ cmd->tx_buf = i3c_xfers[i].data.out;
+ cmd->len = i3c_xfers[i].len;
+ i3c->internal_state = I3C_INTERNAL_STATE_CONTROLLER_WRITE;
+ }
+
+ if (!i3c_xfers[i].rnw && i3c_xfers[i].len > 4) {
+ i3c_writel_fifo(i3c->regs + NTDTBP0, cmd->tx_buf, cmd->len);
+ if (cmd->len > NTDTBP0_DEPTH * sizeof(u32))
+ renesas_set_bit(i3c->regs, NTIE, NTIE_TDBEIE0);
+ }
+
+ renesas_i3c_wait_xfer(i3c, xfer);
+ }
+
+ return 0;
+}
+
+static int renesas_i3c_attach_i3c_dev(struct i3c_dev_desc *dev)
+{
+ struct i3c_master_controller *m = i3c_dev_get_master(dev);
+ struct renesas_i3c *i3c = to_renesas_i3c(m);
+ struct renesas_i3c_i2c_dev_data *data;
+ int pos;
+
+ pos = renesas_i3c_get_free_pos(i3c);
+ if (pos < 0)
+ return pos;
+
+ data = kzalloc(sizeof(*data), GFP_KERNEL);
+ if (!data)
+ return -ENOMEM;
+
+ data->index = pos;
+ i3c->addrs[pos] = dev->info.dyn_addr ? : dev->info.static_addr;
+ i3c->free_pos &= ~BIT(pos);
+
+ renesas_writel(i3c->regs, DATBAS(pos), DATBAS_DVSTAD(dev->info.static_addr) |
+ datbas_dvdyad_with_parity(i3c->addrs[pos]));
+ i3c_dev_set_master_data(dev, data);
+
+ return 0;
+}
+
+static int renesas_i3c_reattach_i3c_dev(struct i3c_dev_desc *dev,
+ u8 old_dyn_addr)
+{
+ struct i3c_master_controller *m = i3c_dev_get_master(dev);
+ struct renesas_i3c *i3c = to_renesas_i3c(m);
+ struct renesas_i3c_i2c_dev_data *data = i3c_dev_get_master_data(dev);
+
+ i3c->addrs[data->index] = dev->info.dyn_addr ? dev->info.dyn_addr :
+ dev->info.static_addr;
+
+ return 0;
+}
+
+static void renesas_i3c_detach_i3c_dev(struct i3c_dev_desc *dev)
+{
+ struct renesas_i3c_i2c_dev_data *data = i3c_dev_get_master_data(dev);
+ struct i3c_master_controller *m = i3c_dev_get_master(dev);
+ struct renesas_i3c *i3c = to_renesas_i3c(m);
+
+ i3c_dev_set_master_data(dev, NULL);
+ i3c->addrs[data->index] = 0;
+ i3c->free_pos |= BIT(data->index);
+ kfree(data);
+}
+
+static int renesas_i3c_i2c_xfers(struct i2c_dev_desc *dev,
+ struct i2c_msg *i2c_xfers,
+ int i2c_nxfers)
+{
+ struct i3c_master_controller *m = i2c_dev_get_master(dev);
+ struct renesas_i3c *i3c = to_renesas_i3c(m);
+ struct renesas_i3c_cmd *cmd;
+ u8 start_bit = CNDCTL_STCND;
+ int i;
+
+ struct renesas_i3c_xfer *xfer __free(kfree) = renesas_i3c_alloc_xfer(i3c, 1);
+ if (!xfer)
+ return -ENOMEM;
+
+ if (!i2c_nxfers)
+ return 0;
+
+ renesas_i3c_bus_enable(m, false);
+
+ init_completion(&xfer->comp);
+ xfer->is_i2c_xfer = true;
+ cmd = xfer->cmds;
+
+ if (!(renesas_readl(i3c->regs, BCST) & BCST_BFREF)) {
+ cmd->err = -EBUSY;
+ return cmd->err;
+ }
+
+ renesas_writel(i3c->regs, BST, 0);
+
+ renesas_i3c_enqueue_xfer(i3c, xfer);
+
+ for (i = 0; i < i2c_nxfers; i++) {
+ cmd->i2c_bytes_left = I2C_INIT_MSG;
+ cmd->i2c_buf = i2c_xfers[i].buf;
+ cmd->msg = &i2c_xfers[i];
+ cmd->i2c_is_last = (i == i2c_nxfers - 1);
+
+ renesas_set_bit(i3c->regs, BIE, BIE_NACKDIE);
+ renesas_set_bit(i3c->regs, NTIE, NTIE_TDBEIE0);
+ renesas_set_bit(i3c->regs, BIE, BIE_STCNDDIE);
+
+ /* Issue Start condition */
+ renesas_set_bit(i3c->regs, CNDCTL, start_bit);
+
+ renesas_set_bit(i3c->regs, NTSTE, NTSTE_TDBEE0);
+
+ wait_for_completion_timeout(&xfer->comp, m->i2c.timeout);
+
+ if (cmd->err)
+ break;
+
+ start_bit = CNDCTL_SRCND;
+ }
+
+ renesas_i3c_dequeue_xfer(i3c, xfer);
+ return cmd->err;
+}
+
+static int renesas_i3c_attach_i2c_dev(struct i2c_dev_desc *dev)
+{
+ struct i3c_master_controller *m = i2c_dev_get_master(dev);
+ struct renesas_i3c *i3c = to_renesas_i3c(m);
+ struct renesas_i3c_i2c_dev_data *data;
+ int pos;
+
+ pos = renesas_i3c_get_free_pos(i3c);
+ if (pos < 0)
+ return pos;
+
+ data = kzalloc(sizeof(*data), GFP_KERNEL);
+ if (!data)
+ return -ENOMEM;
+
+ data->index = pos;
+ i3c->addrs[pos] = dev->addr;
+ i3c->free_pos &= ~BIT(pos);
+ i2c_dev_set_master_data(dev, data);
+
+ return 0;
+}
+
+static void renesas_i3c_detach_i2c_dev(struct i2c_dev_desc *dev)
+{
+ struct renesas_i3c_i2c_dev_data *data = i2c_dev_get_master_data(dev);
+ struct i3c_master_controller *m = i2c_dev_get_master(dev);
+ struct renesas_i3c *i3c = to_renesas_i3c(m);
+
+ i2c_dev_set_master_data(dev, NULL);
+ i3c->addrs[data->index] = 0;
+ i3c->free_pos |= BIT(data->index);
+ kfree(data);
+}
+
+static irqreturn_t renesas_i3c_tx_isr(int irq, void *data)
+{
+ struct renesas_i3c *i3c = data;
+ struct renesas_i3c_xfer *xfer;
+ struct renesas_i3c_cmd *cmd;
+ u8 val;
+
+ scoped_guard(spinlock, &i3c->xferqueue.lock) {
+ xfer = i3c->xferqueue.cur;
+ cmd = xfer->cmds;
+
+ if (xfer->is_i2c_xfer) {
+ if (!cmd->i2c_bytes_left)
+ return IRQ_NONE;
+
+ if (cmd->i2c_bytes_left != I2C_INIT_MSG) {
+ val = *cmd->i2c_buf;
+ cmd->i2c_buf++;
+ cmd->i2c_bytes_left--;
+ renesas_writel(i3c->regs, NTDTBP0, val);
+ }
+
+ if (cmd->i2c_bytes_left == 0) {
+ renesas_clear_bit(i3c->regs, NTIE, NTIE_TDBEIE0);
+ renesas_set_bit(i3c->regs, BIE, BIE_TENDIE);
+ }
+
+ /* Clear the Transmit Buffer Empty status flag. */
+ renesas_clear_bit(i3c->regs, NTST, NTST_TDBEF0);
+ } else {
+ i3c_writel_fifo(i3c->regs + NTDTBP0, cmd->tx_buf, cmd->len);
+ }
+ }
+
+ return IRQ_HANDLED;
+}
+
+static irqreturn_t renesas_i3c_resp_isr(int irq, void *data)
+{
+ struct renesas_i3c *i3c = data;
+ struct renesas_i3c_xfer *xfer;
+ struct renesas_i3c_cmd *cmd;
+ u32 resp_descriptor = renesas_readl(i3c->regs, NRSPQP);
+ u32 bytes_remaining = 0;
+ u32 ntst, data_len;
+ int ret = 0;
+
+ scoped_guard(spinlock, &i3c->xferqueue.lock) {
+ xfer = i3c->xferqueue.cur;
+ cmd = xfer->cmds;
+
+ /* Clear the Respone Queue Full status flag*/
+ renesas_clear_bit(i3c->regs, NTST, NTST_RSPQFF);
+
+ data_len = NRSPQP_DATA_LEN(resp_descriptor);
+
+ switch (i3c->internal_state) {
+ case I3C_INTERNAL_STATE_CONTROLLER_ENTDAA:
+ cmd->rx_count = data_len;
+ break;
+ case I3C_INTERNAL_STATE_CONTROLLER_WRITE:
+ case I3C_INTERNAL_STATE_CONTROLLER_COMMAND_WRITE:
+ /* Disable the transmit IRQ if it hasn't been disabled already. */
+ renesas_clear_bit(i3c->regs, NTIE, NTIE_TDBEIE0);
+ break;
+ case I3C_INTERNAL_STATE_CONTROLLER_READ:
+ case I3C_INTERNAL_STATE_CONTROLLER_COMMAND_READ:
+ if (NDBSTLV0_RDBLV(renesas_readl(i3c->regs, NDBSTLV0)) && !cmd->err)
+ bytes_remaining = data_len - cmd->rx_count;
+
+ i3c_readl_fifo(i3c->regs + NTDTBP0, cmd->rx_buf, bytes_remaining);
+ renesas_clear_bit(i3c->regs, NTIE, NTIE_RDBFIE0);
+ break;
+ default:
+ break;
+ }
+
+ switch (NRSPQP_ERR_STATUS(resp_descriptor)) {
+ case NRSPQP_NO_ERROR:
+ break;
+ case NRSPQP_ERROR_PARITY:
+ case NRSPQP_ERROR_IBA_NACK:
+ case NRSPQP_ERROR_TRANSF_ABORT:
+ case NRSPQP_ERROR_CRC:
+ case NRSPQP_ERROR_FRAME:
+ ret = -EIO;
+ break;
+ case NRSPQP_ERROR_OVER_UNDER_FLOW:
+ ret = -ENOSPC;
+ break;
+ case NRSPQP_ERROR_UNSUPPORTED:
+ ret = -EOPNOTSUPP;
+ break;
+ case NRSPQP_ERROR_I2C_W_NACK_ERR:
+ case NRSPQP_ERROR_ADDRESS_NACK:
+ default:
+ ret = -EINVAL;
+ break;
+ }
+
+ /*
+ * If the transfer was aborted, then the abort flag must be cleared
+ * before notifying the application that a transfer has completed.
+ */
+ ntst = renesas_readl(i3c->regs, NTST);
+ if (ntst & NTST_TABTF)
+ renesas_clear_bit(i3c->regs, BCTL, BCTL_ABT);
+
+ /* Clear error status flags. */
+ renesas_clear_bit(i3c->regs, NTST, NTST_TEF | NTST_TABTF);
+
+ xfer->ret = ret;
+ complete(&xfer->comp);
+
+ xfer = list_first_entry_or_null(&i3c->xferqueue.list,
+ struct renesas_i3c_xfer, node);
+ if (xfer)
+ list_del_init(&xfer->node);
+
+ i3c->xferqueue.cur = xfer;
+ }
+
+ return IRQ_HANDLED;
+}
+
+static irqreturn_t renesas_i3c_tend_isr(int irq, void *data)
+{
+ struct renesas_i3c *i3c = data;
+ struct renesas_i3c_xfer *xfer;
+ struct renesas_i3c_cmd *cmd;
+
+ scoped_guard(spinlock, &i3c->xferqueue.lock) {
+ xfer = i3c->xferqueue.cur;
+ cmd = xfer->cmds;
+
+ if (xfer->is_i2c_xfer) {
+ if (renesas_readl(i3c->regs, BST) & BST_NACKDF) {
+ /* We got a NACKIE */
+ renesas_readl(i3c->regs, NTDTBP0); /* dummy read */
+ renesas_clear_bit(i3c->regs, BST, BST_NACKDF);
+ cmd->err = -ENXIO;
+ } else if (cmd->i2c_bytes_left) {
+ renesas_set_bit(i3c->regs, NTIE, NTIE_TDBEIE0);
+ return IRQ_NONE;
+ }
+
+ if (cmd->i2c_is_last || cmd->err) {
+ renesas_clear_bit(i3c->regs, BIE, BIE_TENDIE);
+ renesas_set_bit(i3c->regs, BIE, BIE_SPCNDDIE);
+ renesas_set_bit(i3c->regs, CNDCTL, CNDCTL_SPCND);
+ } else {
+ /* Transfer is complete, but do not send STOP */
+ renesas_clear_bit(i3c->regs, NTSTE, NTSTE_TDBEE0);
+ renesas_clear_bit(i3c->regs, BIE, BIE_TENDIE);
+ xfer->ret = 0;
+ complete(&xfer->comp);
+ }
+ }
+
+ /* Clear the Transmit Buffer Empty status flag. */
+ renesas_clear_bit(i3c->regs, BST, BST_TENDF);
+ }
+
+ return IRQ_HANDLED;
+}
+
+static irqreturn_t renesas_i3c_rx_isr(int irq, void *data)
+{
+ struct renesas_i3c *i3c = data;
+ struct renesas_i3c_xfer *xfer;
+ struct renesas_i3c_cmd *cmd;
+ int read_bytes;
+
+ /* If resp_isr already read the data and updated 'xfer', we can just leave */
+ if (!(renesas_readl(i3c->regs, NTIE) & NTIE_RDBFIE0))
+ return IRQ_NONE;
+
+ scoped_guard(spinlock, &i3c->xferqueue.lock) {
+ xfer = i3c->xferqueue.cur;
+ cmd = xfer->cmds;
+
+ if (xfer->is_i2c_xfer) {
+ if (!cmd->i2c_bytes_left)
+ return IRQ_NONE;
+
+ if (cmd->i2c_bytes_left == I2C_INIT_MSG) {
+ cmd->i2c_bytes_left = cmd->msg->len;
+ renesas_set_bit(i3c->regs, SCSTRCTL, SCSTRCTL_RWE);
+ renesas_readl(i3c->regs, NTDTBP0); /* dummy read */
+ if (cmd->i2c_bytes_left == 1)
+ renesas_writel(i3c->regs, ACKCTL, ACKCTL_ACKT | ACKCTL_ACKTWP);
+ return IRQ_HANDLED;
+ }
+
+ if (cmd->i2c_bytes_left == 1) {
+ /* STOP must come before we set ACKCTL! */
+ if (cmd->i2c_is_last) {
+ renesas_set_bit(i3c->regs, BIE, BIE_SPCNDDIE);
+ renesas_clear_bit(i3c->regs, BST, BST_SPCNDDF);
+ renesas_set_bit(i3c->regs, CNDCTL, CNDCTL_SPCND);
+ }
+ renesas_writel(i3c->regs, ACKCTL, ACKCTL_ACKT | ACKCTL_ACKTWP);
+ } else {
+ renesas_writel(i3c->regs, ACKCTL, ACKCTL_ACKTWP);
+ }
+
+ /* Reading acks the RIE interrupt */
+ *cmd->i2c_buf = renesas_readl(i3c->regs, NTDTBP0);
+ cmd->i2c_buf++;
+ cmd->i2c_bytes_left--;
+ } else {
+ read_bytes = NDBSTLV0_RDBLV(renesas_readl(i3c->regs, NDBSTLV0)) * sizeof(u32);
+ i3c_readl_fifo(i3c->regs + NTDTBP0, cmd->rx_buf, read_bytes);
+ cmd->rx_count = read_bytes;
+ }
+
+ /* Clear the Read Buffer Full status flag. */
+ renesas_clear_bit(i3c->regs, NTST, NTST_RDBFF0);
+ }
+
+ return IRQ_HANDLED;
+}
+
+static irqreturn_t renesas_i3c_stop_isr(int irq, void *data)
+{
+ struct renesas_i3c *i3c = data;
+ struct renesas_i3c_xfer *xfer;
+
+ scoped_guard(spinlock, &i3c->xferqueue.lock) {
+ xfer = i3c->xferqueue.cur;
+
+ /* read back registers to confirm writes have fully propagated */
+ renesas_writel(i3c->regs, BST, 0);
+ renesas_readl(i3c->regs, BST);
+ renesas_writel(i3c->regs, BIE, 0);
+ renesas_clear_bit(i3c->regs, NTST, NTST_TDBEF0 | NTST_RDBFF0);
+ renesas_clear_bit(i3c->regs, SCSTRCTL, SCSTRCTL_RWE);
+
+ xfer->ret = 0;
+ complete(&xfer->comp);
+ }
+
+ return IRQ_HANDLED;
+}
+
+static irqreturn_t renesas_i3c_start_isr(int irq, void *data)
+{
+ struct renesas_i3c *i3c = data;
+ struct renesas_i3c_xfer *xfer;
+ struct renesas_i3c_cmd *cmd;
+ u8 val;
+
+ scoped_guard(spinlock, &i3c->xferqueue.lock) {
+ xfer = i3c->xferqueue.cur;
+ cmd = xfer->cmds;
+
+ if (xfer->is_i2c_xfer) {
+ if (!cmd->i2c_bytes_left)
+ return IRQ_NONE;
+
+ if (cmd->i2c_bytes_left == I2C_INIT_MSG) {
+ if (cmd->msg->flags & I2C_M_RD) {
+ /* On read, switch over to receive interrupt */
+ renesas_clear_bit(i3c->regs, NTIE, NTIE_TDBEIE0);
+ renesas_set_bit(i3c->regs, NTIE, NTIE_RDBFIE0);
+ } else {
+ /* On write, initialize length */
+ cmd->i2c_bytes_left = cmd->msg->len;
+ }
+
+ val = i2c_8bit_addr_from_msg(cmd->msg);
+ renesas_writel(i3c->regs, NTDTBP0, val);
+ }
+ }
+
+ renesas_clear_bit(i3c->regs, BIE, BIE_STCNDDIE);
+ renesas_clear_bit(i3c->regs, BST, BST_STCNDDF);
+ }
+
+ return IRQ_HANDLED;
+}
+
+static const struct i3c_master_controller_ops renesas_i3c_ops = {
+ .bus_init = renesas_i3c_bus_init,
+ .bus_cleanup = renesas_i3c_bus_cleanup,
+ .attach_i3c_dev = renesas_i3c_attach_i3c_dev,
+ .reattach_i3c_dev = renesas_i3c_reattach_i3c_dev,
+ .detach_i3c_dev = renesas_i3c_detach_i3c_dev,
+ .do_daa = renesas_i3c_daa,
+ .supports_ccc_cmd = renesas_i3c_supports_ccc_cmd,
+ .send_ccc_cmd = renesas_i3c_send_ccc_cmd,
+ .priv_xfers = renesas_i3c_priv_xfers,
+ .attach_i2c_dev = renesas_i3c_attach_i2c_dev,
+ .detach_i2c_dev = renesas_i3c_detach_i2c_dev,
+ .i2c_xfers = renesas_i3c_i2c_xfers,
+};
+
+static const struct renesas_i3c_irq_desc renesas_i3c_irqs[] = {
+ { .name = "resp", .isr = renesas_i3c_resp_isr, .desc = "i3c-resp" },
+ { .name = "rx", .isr = renesas_i3c_rx_isr, .desc = "i3c-rx" },
+ { .name = "tx", .isr = renesas_i3c_tx_isr, .desc = "i3c-tx" },
+ { .name = "st", .isr = renesas_i3c_start_isr, .desc = "i3c-start" },
+ { .name = "sp", .isr = renesas_i3c_stop_isr, .desc = "i3c-stop" },
+ { .name = "tend", .isr = renesas_i3c_tend_isr, .desc = "i3c-tend" },
+ { .name = "nack", .isr = renesas_i3c_tend_isr, .desc = "i3c-nack" },
+};
+
+static void renesas_i3c_reset_control_assert(void *data)
+{
+ reset_control_assert(data);
+}
+
+static int renesas_i3c_probe(struct platform_device *pdev)
+{
+ struct renesas_i3c *i3c;
+ struct clk *clk;
+ const struct renesas_i3c_config *config = of_device_get_match_data(&pdev->dev);
+ int ret, i;
+
+ if (!config)
+ return -ENODATA;
+
+ i3c = devm_kzalloc(&pdev->dev, sizeof(*i3c), GFP_KERNEL);
+ if (!i3c)
+ return -ENOMEM;
+
+ i3c->regs = devm_platform_ioremap_resource(pdev, 0);
+ if (IS_ERR(i3c->regs))
+ return PTR_ERR(i3c->regs);
+
+ clk = devm_clk_get_enabled(&pdev->dev, "pclk");
+ if (IS_ERR(clk))
+ return PTR_ERR(clk);
+
+ if (config->has_pclkrw) {
+ clk = devm_clk_get_enabled(&pdev->dev, "pclkrw");
+ if (IS_ERR(clk))
+ return PTR_ERR(clk);
+ }
+
+ i3c->tclk = devm_clk_get_enabled(&pdev->dev, "tclk");
+ if (IS_ERR(i3c->tclk))
+ return PTR_ERR(i3c->tclk);
+
+ i3c->tresetn = devm_reset_control_get_optional_exclusive(&pdev->dev, "tresetn");
+ if (IS_ERR(i3c->tresetn))
+ return dev_err_probe(&pdev->dev, PTR_ERR(i3c->tresetn),
+ "Error: missing tresetn ctrl\n");
+
+ i3c->presetn = devm_reset_control_get_optional_exclusive(&pdev->dev, "presetn");
+ if (IS_ERR(i3c->presetn))
+ return dev_err_probe(&pdev->dev, PTR_ERR(i3c->presetn),
+ "Error: missing presetn ctrl\n");
+
+ ret = reset_control_deassert(i3c->tresetn);
+ if (ret)
+ return ret;
+
+ ret = reset_control_deassert(i3c->presetn);
+ if (ret)
+ return ret;
+
+ ret = devm_add_action_or_reset(&pdev->dev, renesas_i3c_reset_control_assert,
+ i3c->tresetn);
+ if (ret)
+ return ret;
+
+ ret = devm_add_action_or_reset(&pdev->dev, renesas_i3c_reset_control_assert,
+ i3c->presetn);
+ if (ret)
+ return ret;
+
+ spin_lock_init(&i3c->xferqueue.lock);
+ INIT_LIST_HEAD(&i3c->xferqueue.list);
+
+ ret = renesas_i3c_reset(i3c);
+ if (ret)
+ return ret;
+
+ for (i = 0; i < ARRAY_SIZE(renesas_i3c_irqs); i++) {
+ ret = platform_get_irq_byname(pdev, renesas_i3c_irqs[i].name);
+ if (ret < 0)
+ return ret;
+
+ ret = devm_request_irq(&pdev->dev, ret, renesas_i3c_irqs[i].isr,
+ 0, renesas_i3c_irqs[i].desc, i3c);
+ if (ret)
+ return ret;
+ }
+
+ platform_set_drvdata(pdev, i3c);
+
+ i3c->maxdevs = RENESAS_I3C_MAX_DEVS;
+ i3c->free_pos = GENMASK(i3c->maxdevs - 1, 0);
+
+ return i3c_master_register(&i3c->base, &pdev->dev, &renesas_i3c_ops, false);
+}
+
+static int renesas_i3c_remove(struct platform_device *pdev)
+{
+ struct renesas_i3c *i3c = platform_get_drvdata(pdev);
+
+ i3c_master_unregister(&i3c->base);
+
+ return 0;
+}
+
+static const struct renesas_i3c_config empty_i3c_config = {
+};
+
+static const struct renesas_i3c_config r9a09g047_i3c_config = {
+ .has_pclkrw = 1,
+};
+
+static const struct of_device_id renesas_i3c_of_ids[] = {
+ { .compatible = "renesas,r9a08g045-i3c", .data = &empty_i3c_config },
+ { .compatible = "renesas,r9a09g047-i3c", .data = &r9a09g047_i3c_config },
+ { /* sentinel */ },
+};
+MODULE_DEVICE_TABLE(of, renesas_i3c_of_ids);
+
+static struct platform_driver renesas_i3c = {
+ .probe = renesas_i3c_probe,
+ .remove = renesas_i3c_remove,
+ .driver = {
+ .name = "renesas-i3c",
+ .of_match_table = renesas_i3c_of_ids,
+ },
+};
+module_platform_driver(renesas_i3c);
+
+MODULE_AUTHOR("Wolfram Sang <wsa+renesas@sang-engineering.com>");
+MODULE_AUTHOR("Renesas BSP teams");
+MODULE_DESCRIPTION("Renesas I3C controller driver");
+MODULE_LICENSE("GPL");
--
2.43.0
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 6.1.y-cip 05/22] i3c: Document I3C_ADDR_SLOT_EXT_STATUS_MASK
2026-01-08 9:28 [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E Tommaso Merciai
` (3 preceding siblings ...)
2026-01-08 9:28 ` [PATCH 6.1.y-cip 04/22] i3c: master: Add basic driver for the Renesas I3C controller Tommaso Merciai
@ 2026-01-08 9:28 ` Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 06/22] i3c: Remove the const qualifier from i2c_msg pointer in i2c_xfers API Tommaso Merciai
` (17 subsequent siblings)
22 siblings, 0 replies; 34+ messages in thread
From: Tommaso Merciai @ 2026-01-08 9:28 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
commit f6ca73063754950bf3fbad753e3a9557e3aa85e3 upstream.
As the mask is part of the enum, document it.
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Link: https://lore.kernel.org/r/20241102132841.2446176-1-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
include/linux/i3c/master.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/i3c/master.h b/include/linux/i3c/master.h
index 2f731c6c16ea..a82a3d5b00e1 100644
--- a/include/linux/i3c/master.h
+++ b/include/linux/i3c/master.h
@@ -289,6 +289,7 @@ enum i3c_open_drain_speed {
* @I3C_ADDR_SLOT_I2C_DEV: address is assigned to an I2C device
* @I3C_ADDR_SLOT_I3C_DEV: address is assigned to an I3C device
* @I3C_ADDR_SLOT_STATUS_MASK: address slot mask
+ * @I3C_ADDR_SLOT_EXT_STATUS_MASK: address slot mask with extended information
* @I3C_ADDR_SLOT_EXT_DESIRED: the bitmask represents addresses that are preferred by some devices,
* such as the "assigned-address" property in a device tree source.
* On an I3C bus, addresses are assigned dynamically, and we need to know which
--
2.43.0
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 6.1.y-cip 06/22] i3c: Remove the const qualifier from i2c_msg pointer in i2c_xfers API
2026-01-08 9:28 [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E Tommaso Merciai
` (4 preceding siblings ...)
2026-01-08 9:28 ` [PATCH 6.1.y-cip 05/22] i3c: Document I3C_ADDR_SLOT_EXT_STATUS_MASK Tommaso Merciai
@ 2026-01-08 9:28 ` Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 07/22] i3c: Standardize defines for specification parameters Tommaso Merciai
` (16 subsequent siblings)
22 siblings, 0 replies; 34+ messages in thread
From: Tommaso Merciai @ 2026-01-08 9:28 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Billy Tsai <billy_tsai@aspeedtech.com>
commit 6866c91f8c2327546d850d5a85025fb81e2089bf upstream.
The change is necessary to enable the use of the
`i2c_get_dma_safe_msg_buf()` API, which requires a non-const
`struct i2c_msg *` to operate. The `i2c_get_dma_safe_msg_buf()` function
ensures safe handling of I2C messages when using DMA, making it essential
for scenarios where DMA transfers are involved. By removing the `const`
qualifier, this patch allows drivers to prepare and manage DMA-safe
buffers directly.
Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Mukesh Kumar Savaliya <quic_msavaliy@quicinc.com>
Link: https://lore.kernel.org/r/20250204091702.4014466-1-billy_tsai@aspeedtech.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
drivers/i3c/master/dw-i3c-master.c | 2 +-
drivers/i3c/master/i3c-master-cdns.c | 2 +-
drivers/i3c/master/mipi-i3c-hci/core.c | 2 +-
drivers/i3c/master/svc-i3c-master.c | 2 +-
include/linux/i3c/master.h | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
index b72f6dce18b4..49e495509632 100644
--- a/drivers/i3c/master/dw-i3c-master.c
+++ b/drivers/i3c/master/dw-i3c-master.c
@@ -968,7 +968,7 @@ static void dw_i3c_master_detach_i3c_dev(struct i3c_dev_desc *dev)
}
static int dw_i3c_master_i2c_xfers(struct i2c_dev_desc *dev,
- const struct i2c_msg *i2c_xfers,
+ struct i2c_msg *i2c_xfers,
int i2c_nxfers)
{
struct dw_i3c_i2c_dev_data *data = i2c_dev_get_master_data(dev);
diff --git a/drivers/i3c/master/i3c-master-cdns.c b/drivers/i3c/master/i3c-master-cdns.c
index c5a37f58079a..ba3df9f6c578 100644
--- a/drivers/i3c/master/i3c-master-cdns.c
+++ b/drivers/i3c/master/i3c-master-cdns.c
@@ -814,7 +814,7 @@ static int cdns_i3c_master_priv_xfers(struct i3c_dev_desc *dev,
}
static int cdns_i3c_master_i2c_xfers(struct i2c_dev_desc *dev,
- const struct i2c_msg *xfers, int nxfers)
+ struct i2c_msg *xfers, int nxfers)
{
struct i3c_master_controller *m = i2c_dev_get_master(dev);
struct cdns_i3c_master *master = to_cdns_i3c_master(m);
diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mipi-i3c-hci/core.c
index f9bc58366a72..48bc86253877 100644
--- a/drivers/i3c/master/mipi-i3c-hci/core.c
+++ b/drivers/i3c/master/mipi-i3c-hci/core.c
@@ -329,7 +329,7 @@ static int i3c_hci_priv_xfers(struct i3c_dev_desc *dev,
}
static int i3c_hci_i2c_xfers(struct i2c_dev_desc *dev,
- const struct i2c_msg *i2c_xfers, int nxfers)
+ struct i2c_msg *i2c_xfers, int nxfers)
{
struct i3c_master_controller *m = i2c_dev_get_master(dev);
struct i3c_hci *hci = to_i3c_hci(m);
diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c
index fda472d84549..fd12536affbf 100644
--- a/drivers/i3c/master/svc-i3c-master.c
+++ b/drivers/i3c/master/svc-i3c-master.c
@@ -1477,7 +1477,7 @@ static int svc_i3c_master_priv_xfers(struct i3c_dev_desc *dev,
}
static int svc_i3c_master_i2c_xfers(struct i2c_dev_desc *dev,
- const struct i2c_msg *xfers,
+ struct i2c_msg *xfers,
int nxfers)
{
struct i3c_master_controller *m = i2c_dev_get_master(dev);
diff --git a/include/linux/i3c/master.h b/include/linux/i3c/master.h
index a82a3d5b00e1..5fb114f10623 100644
--- a/include/linux/i3c/master.h
+++ b/include/linux/i3c/master.h
@@ -466,7 +466,7 @@ struct i3c_master_controller_ops {
int (*attach_i2c_dev)(struct i2c_dev_desc *dev);
void (*detach_i2c_dev)(struct i2c_dev_desc *dev);
int (*i2c_xfers)(struct i2c_dev_desc *dev,
- const struct i2c_msg *xfers, int nxfers);
+ struct i2c_msg *xfers, int nxfers);
int (*request_ibi)(struct i3c_dev_desc *dev,
const struct i3c_ibi_setup *req);
void (*free_ibi)(struct i3c_dev_desc *dev);
--
2.43.0
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 6.1.y-cip 07/22] i3c: Standardize defines for specification parameters
2026-01-08 9:28 [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E Tommaso Merciai
` (5 preceding siblings ...)
2026-01-08 9:28 ` [PATCH 6.1.y-cip 06/22] i3c: Remove the const qualifier from i2c_msg pointer in i2c_xfers API Tommaso Merciai
@ 2026-01-08 9:28 ` Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 08/22] i3c: Add more parameters for controllers to the header Tommaso Merciai
` (15 subsequent siblings)
22 siblings, 0 replies; 34+ messages in thread
From: Tommaso Merciai @ 2026-01-08 9:28 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
commit 9c0609d685b27a0bb392390680207baa820ed118 upstream.
Align existing defines to follow the consistent pattern:
I3C_BUS_<PARAM>_<MAX|MIN|TYP>_<UNIT>. Prepare the codebase for adding
new parameters and help avoid duplication.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20250724094146.6443-2-wsa+renesas@sang-engineering.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
drivers/i3c/master.c | 12 ++++++------
drivers/i3c/master/dw-i3c-master.c | 4 ++--
include/linux/i3c/master.h | 9 +++++----
3 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
index 019fd9bd928d..3361b466c3fa 100644
--- a/drivers/i3c/master.c
+++ b/drivers/i3c/master.c
@@ -682,12 +682,12 @@ static int i3c_bus_set_mode(struct i3c_bus *i3cbus, enum i3c_bus_mode mode,
switch (i3cbus->mode) {
case I3C_BUS_MODE_PURE:
if (!i3cbus->scl_rate.i3c)
- i3cbus->scl_rate.i3c = I3C_BUS_TYP_I3C_SCL_RATE;
+ i3cbus->scl_rate.i3c = I3C_BUS_I3C_SCL_TYP_RATE;
break;
case I3C_BUS_MODE_MIXED_FAST:
case I3C_BUS_MODE_MIXED_LIMITED:
if (!i3cbus->scl_rate.i3c)
- i3cbus->scl_rate.i3c = I3C_BUS_TYP_I3C_SCL_RATE;
+ i3cbus->scl_rate.i3c = I3C_BUS_I3C_SCL_TYP_RATE;
if (!i3cbus->scl_rate.i2c)
i3cbus->scl_rate.i2c = max_i2c_scl_rate;
break;
@@ -709,8 +709,8 @@ static int i3c_bus_set_mode(struct i3c_bus *i3cbus, enum i3c_bus_mode mode,
* I3C/I2C frequency may have been overridden, check that user-provided
* values are not exceeding max possible frequency.
*/
- if (i3cbus->scl_rate.i3c > I3C_BUS_MAX_I3C_SCL_RATE ||
- i3cbus->scl_rate.i2c > I3C_BUS_I2C_FM_PLUS_SCL_RATE)
+ if (i3cbus->scl_rate.i3c > I3C_BUS_I3C_SCL_MAX_RATE ||
+ i3cbus->scl_rate.i2c > I3C_BUS_I2C_FM_PLUS_SCL_MAX_RATE)
return -EINVAL;
return 0;
@@ -2727,7 +2727,7 @@ int i3c_master_register(struct i3c_master_controller *master,
const struct i3c_master_controller_ops *ops,
bool secondary)
{
- unsigned long i2c_scl_rate = I3C_BUS_I2C_FM_PLUS_SCL_RATE;
+ unsigned long i2c_scl_rate = I3C_BUS_I2C_FM_PLUS_SCL_MAX_RATE;
struct i3c_bus *i3cbus = i3c_master_get_bus(master);
enum i3c_bus_mode mode = I3C_BUS_MODE_PURE;
struct i2c_dev_boardinfo *i2cbi;
@@ -2782,7 +2782,7 @@ int i3c_master_register(struct i3c_master_controller *master,
}
if (i2cbi->lvr & I3C_LVR_I2C_FM_MODE)
- i2c_scl_rate = I3C_BUS_I2C_FM_SCL_RATE;
+ i2c_scl_rate = I3C_BUS_I2C_FM_SCL_MAX_RATE;
}
ret = i3c_bus_set_mode(i3cbus, mode, i2c_scl_rate);
diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
index 49e495509632..d6585d0a20c5 100644
--- a/drivers/i3c/master/dw-i3c-master.c
+++ b/drivers/i3c/master/dw-i3c-master.c
@@ -571,13 +571,13 @@ static int dw_i2c_clk_cfg(struct dw_i3c_master *master)
core_period = DIV_ROUND_UP(1000000000, core_rate);
lcnt = DIV_ROUND_UP(I3C_BUS_I2C_FMP_TLOW_MIN_NS, core_period);
- hcnt = DIV_ROUND_UP(core_rate, I3C_BUS_I2C_FM_PLUS_SCL_RATE) - lcnt;
+ hcnt = DIV_ROUND_UP(core_rate, I3C_BUS_I2C_FM_PLUS_SCL_MAX_RATE) - lcnt;
scl_timing = SCL_I2C_FMP_TIMING_HCNT(hcnt) |
SCL_I2C_FMP_TIMING_LCNT(lcnt);
writel(scl_timing, master->regs + SCL_I2C_FMP_TIMING);
lcnt = DIV_ROUND_UP(I3C_BUS_I2C_FM_TLOW_MIN_NS, core_period);
- hcnt = DIV_ROUND_UP(core_rate, I3C_BUS_I2C_FM_SCL_RATE) - lcnt;
+ hcnt = DIV_ROUND_UP(core_rate, I3C_BUS_I2C_FM_SCL_MAX_RATE) - lcnt;
scl_timing = SCL_I2C_FM_TIMING_HCNT(hcnt) |
SCL_I2C_FM_TIMING_LCNT(lcnt);
writel(scl_timing, master->regs + SCL_I2C_FM_TIMING);
diff --git a/include/linux/i3c/master.h b/include/linux/i3c/master.h
index 5fb114f10623..b399ef2a9359 100644
--- a/include/linux/i3c/master.h
+++ b/include/linux/i3c/master.h
@@ -240,10 +240,11 @@ struct i3c_device {
*/
#define I3C_BUS_MAX_DEVS 11
-#define I3C_BUS_MAX_I3C_SCL_RATE 12900000
-#define I3C_BUS_TYP_I3C_SCL_RATE 12500000
-#define I3C_BUS_I2C_FM_PLUS_SCL_RATE 1000000
-#define I3C_BUS_I2C_FM_SCL_RATE 400000
+/* Taken from the I3C Spec V1.1.1, chapter 6.2. "Timing specification" */
+#define I3C_BUS_I2C_FM_PLUS_SCL_MAX_RATE 1000000
+#define I3C_BUS_I2C_FM_SCL_MAX_RATE 400000
+#define I3C_BUS_I3C_SCL_MAX_RATE 12900000
+#define I3C_BUS_I3C_SCL_TYP_RATE 12500000
#define I3C_BUS_TLOW_OD_MIN_NS 200
/**
--
2.43.0
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 6.1.y-cip 08/22] i3c: Add more parameters for controllers to the header
2026-01-08 9:28 [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E Tommaso Merciai
` (6 preceding siblings ...)
2026-01-08 9:28 ` [PATCH 6.1.y-cip 07/22] i3c: Standardize defines for specification parameters Tommaso Merciai
@ 2026-01-08 9:28 ` Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 09/22] i3c: master: Add helpers for DMA mapping and bounce buffer handling Tommaso Merciai
` (14 subsequent siblings)
22 siblings, 0 replies; 34+ messages in thread
From: Tommaso Merciai @ 2026-01-08 9:28 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
commit 8acf1f3bae1ea48949458b67d68a72a95c3244a4 upstream.
Add standard timing value definition from specification.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20250724094146.6443-3-wsa+renesas@sang-engineering.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
include/linux/i3c/master.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/linux/i3c/master.h b/include/linux/i3c/master.h
index b399ef2a9359..fd5f35b2385c 100644
--- a/include/linux/i3c/master.h
+++ b/include/linux/i3c/master.h
@@ -245,6 +245,10 @@ struct i3c_device {
#define I3C_BUS_I2C_FM_SCL_MAX_RATE 400000
#define I3C_BUS_I3C_SCL_MAX_RATE 12900000
#define I3C_BUS_I3C_SCL_TYP_RATE 12500000
+#define I3C_BUS_TAVAL_MIN_NS 1000
+#define I3C_BUS_TBUF_MIXED_FM_MIN_NS 1300
+#define I3C_BUS_THIGH_MIXED_MAX_NS 41
+#define I3C_BUS_TIDLE_MIN_NS 200000
#define I3C_BUS_TLOW_OD_MIN_NS 200
/**
--
2.43.0
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 6.1.y-cip 09/22] i3c: master: Add helpers for DMA mapping and bounce buffer handling
2026-01-08 9:28 [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E Tommaso Merciai
` (7 preceding siblings ...)
2026-01-08 9:28 ` [PATCH 6.1.y-cip 08/22] i3c: Add more parameters for controllers to the header Tommaso Merciai
@ 2026-01-08 9:28 ` Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 10/22] i3c: document i3c_xfers Tommaso Merciai
` (13 subsequent siblings)
22 siblings, 0 replies; 34+ messages in thread
From: Tommaso Merciai @ 2026-01-08 9:28 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Jarkko Nikula <jarkko.nikula@linux.intel.com>
commit f8d9e56aeb87ce82ce8636cd176cc59b69aa0e41 upstream.
Some I3C controllers such as MIPI I3C HCI may pad the last DWORD (32-bit)
with stale data from the RX FIFO in DMA transfers if the receive length
is not DWORD aligned and when the device DMA is IOMMU mapped.
In such a case, a properly sized bounce buffer is required in order to
avoid possible data corruption. In a review discussion, proposal was to
have a common helpers in I3C core for DMA mapping and bounce buffer
handling.
Drivers may use the helper i3c_master_dma_map_single() to map a buffer
for a DMA transfer. It internally allocates a bounce buffer if buffer is
not DMA'able or when the driver requires it for a transfer.
Helper i3c_master_dma_unmap_single() does the needed cleanups and
data copying from the bounce buffer.
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20250822105630.2820009-2-jarkko.nikula@linux.intel.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
drivers/i3c/master.c | 74 ++++++++++++++++++++++++++++++++++++++
include/linux/i3c/master.h | 26 ++++++++++++++
2 files changed, 100 insertions(+)
diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
index 3361b466c3fa..035dab33f85d 100644
--- a/drivers/i3c/master.c
+++ b/drivers/i3c/master.c
@@ -8,6 +8,7 @@
#include <linux/atomic.h>
#include <linux/bug.h>
#include <linux/device.h>
+#include <linux/dma-mapping.h>
#include <linux/err.h>
#include <linux/export.h>
#include <linux/kernel.h>
@@ -1669,6 +1670,79 @@ int i3c_master_do_daa(struct i3c_master_controller *master)
}
EXPORT_SYMBOL_GPL(i3c_master_do_daa);
+/**
+ * i3c_master_dma_map_single() - Map buffer for single DMA transfer
+ * @dev: device object of a device doing DMA
+ * @buf: destination/source buffer for DMA
+ * @len: length of transfer
+ * @force_bounce: true, force to use a bounce buffer,
+ * false, function will auto check is a bounce buffer required
+ * @dir: DMA direction
+ *
+ * Map buffer for a DMA transfer and allocate a bounce buffer if required.
+ *
+ * Return: I3C DMA transfer descriptor or NULL in case of error.
+ */
+struct i3c_dma *i3c_master_dma_map_single(struct device *dev, void *buf,
+ size_t len, bool force_bounce, enum dma_data_direction dir)
+{
+ struct i3c_dma *dma_xfer __free(kfree) = NULL;
+ void *bounce __free(kfree) = NULL;
+ void *dma_buf = buf;
+
+ dma_xfer = kzalloc(sizeof(*dma_xfer), GFP_KERNEL);
+ if (!dma_xfer)
+ return NULL;
+
+ dma_xfer->dev = dev;
+ dma_xfer->buf = buf;
+ dma_xfer->dir = dir;
+ dma_xfer->len = len;
+ dma_xfer->map_len = len;
+
+ if (is_vmalloc_addr(buf))
+ force_bounce = true;
+
+ if (force_bounce) {
+ dma_xfer->map_len = ALIGN(len, cache_line_size());
+ if (dir == DMA_FROM_DEVICE)
+ bounce = kzalloc(dma_xfer->map_len, GFP_KERNEL);
+ else
+ bounce = kmemdup(buf, dma_xfer->map_len, GFP_KERNEL);
+ if (!bounce)
+ return NULL;
+ dma_buf = bounce;
+ }
+
+ dma_xfer->addr = dma_map_single(dev, dma_buf, dma_xfer->map_len, dir);
+ if (dma_mapping_error(dev, dma_xfer->addr))
+ return NULL;
+
+ dma_xfer->bounce_buf = no_free_ptr(bounce);
+ return no_free_ptr(dma_xfer);
+}
+EXPORT_SYMBOL_GPL(i3c_master_dma_map_single);
+
+/**
+ * i3c_master_dma_unmap_single() - Unmap buffer after DMA
+ * @dma_xfer: DMA transfer and mapping descriptor
+ *
+ * Unmap buffer and cleanup DMA transfer descriptor.
+ */
+void i3c_master_dma_unmap_single(struct i3c_dma *dma_xfer)
+{
+ dma_unmap_single(dma_xfer->dev, dma_xfer->addr,
+ dma_xfer->map_len, dma_xfer->dir);
+ if (dma_xfer->bounce_buf) {
+ if (dma_xfer->dir == DMA_FROM_DEVICE)
+ memcpy(dma_xfer->buf, dma_xfer->bounce_buf,
+ dma_xfer->len);
+ kfree(dma_xfer->bounce_buf);
+ }
+ kfree(dma_xfer);
+}
+EXPORT_SYMBOL_GPL(i3c_master_dma_unmap_single);
+
/**
* i3c_master_set_info() - set master device information
* @master: master used to send frames on the bus
diff --git a/include/linux/i3c/master.h b/include/linux/i3c/master.h
index fd5f35b2385c..4188a6bdca12 100644
--- a/include/linux/i3c/master.h
+++ b/include/linux/i3c/master.h
@@ -549,6 +549,26 @@ struct i3c_master_controller {
#define i3c_bus_for_each_i3cdev(bus, dev) \
list_for_each_entry(dev, &(bus)->devs.i3c, common.node)
+/**
+ * struct i3c_dma - DMA transfer and mapping descriptor
+ * @dev: device object of a device doing DMA
+ * @buf: destination/source buffer for DMA
+ * @len: length of transfer
+ * @map_len: length of DMA mapping
+ * @addr: mapped DMA address for a Host Controller Driver
+ * @dir: DMA direction
+ * @bounce_buf: an allocated bounce buffer if transfer needs it or NULL
+ */
+struct i3c_dma {
+ struct device *dev;
+ void *buf;
+ size_t len;
+ size_t map_len;
+ dma_addr_t addr;
+ enum dma_data_direction dir;
+ void *bounce_buf;
+};
+
int i3c_master_do_i2c_xfers(struct i3c_master_controller *master,
const struct i2c_msg *xfers,
int nxfers);
@@ -566,6 +586,12 @@ int i3c_master_get_free_addr(struct i3c_master_controller *master,
int i3c_master_add_i3c_dev_locked(struct i3c_master_controller *master,
u8 addr);
int i3c_master_do_daa(struct i3c_master_controller *master);
+struct i3c_dma *i3c_master_dma_map_single(struct device *dev, void *ptr,
+ size_t len, bool force_bounce,
+ enum dma_data_direction dir);
+void i3c_master_dma_unmap_single(struct i3c_dma *dma_xfer);
+DEFINE_FREE(i3c_master_dma_unmap_single, void *,
+ if (_T) i3c_master_dma_unmap_single(_T))
int i3c_master_set_info(struct i3c_master_controller *master,
const struct i3c_device_info *info);
--
2.43.0
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 6.1.y-cip 10/22] i3c: document i3c_xfers
2026-01-08 9:28 [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E Tommaso Merciai
` (8 preceding siblings ...)
2026-01-08 9:28 ` [PATCH 6.1.y-cip 09/22] i3c: master: Add helpers for DMA mapping and bounce buffer handling Tommaso Merciai
@ 2026-01-08 9:28 ` Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 11/22] i3c: master: Add inline i3c_readl_fifo() and i3c_writel_fifo() Tommaso Merciai
` (12 subsequent siblings)
22 siblings, 0 replies; 34+ messages in thread
From: Tommaso Merciai @ 2026-01-08 9:28 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
commit e01a8baf60af43f6f87a5850dee29cf31377ec25 upstream.
i3c_xfers was left undocumented, document it.
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Link: https://patch.msgid.link/20251202153804.2640623-2-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
include/linux/i3c/master.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/include/linux/i3c/master.h b/include/linux/i3c/master.h
index 4188a6bdca12..1dde400afaf6 100644
--- a/include/linux/i3c/master.h
+++ b/include/linux/i3c/master.h
@@ -409,7 +409,11 @@ struct i3c_bus {
* @send_ccc_cmd: send a CCC command
* This method is mandatory.
* @priv_xfers: do one or several private I3C SDR transfers
- * This method is mandatory.
+ * This method is mandatory when i3c_xfers is not implemented. It
+ * is deprecated.
+ * @i3c_xfers: do one or several I3C SDR or HDR transfers
+ * This method is mandatory when priv_xfers is not implemented but
+ * should be implemented instead of priv_xfers.
* @attach_i2c_dev: called every time an I2C device is attached to the bus.
* This is a good place to attach master controller specific
* data to I2C devices.
--
2.43.0
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 6.1.y-cip 11/22] i3c: master: Add inline i3c_readl_fifo() and i3c_writel_fifo()
2026-01-08 9:28 [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E Tommaso Merciai
` (9 preceding siblings ...)
2026-01-08 9:28 ` [PATCH 6.1.y-cip 10/22] i3c: document i3c_xfers Tommaso Merciai
@ 2026-01-08 9:28 ` Tommaso Merciai
2026-01-09 10:26 ` [cip-dev] " Pavel Machek
2026-01-08 9:28 ` [PATCH 6.1.y-cip 12/22] i3c: Correct the macro module_i3c_i2c_driver Tommaso Merciai
` (11 subsequent siblings)
22 siblings, 1 reply; 34+ messages in thread
From: Tommaso Merciai @ 2026-01-08 9:28 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Jorge Marques <jorge.marques@analog.com>
commit 733b439375b494e8a6950ab47d18a4b615b73cb3 upstream.
The I3C abstraction expects u8 buffers, but some controllers operate with
a 32-bit bus width FIFO and cannot flag valid bytes individually. To avoid
reading or writing outside the buffer bounds, use 32-bit accesses where
possible and apply memcpy for any remaining bytes
Signed-off-by: Jorge Marques <jorge.marques@analog.com>
Suggested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20250624-i3c-writesl-readsl-v3-1-63ccf0870f01@analog.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
drivers/i3c/internals.h | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/drivers/i3c/internals.h b/drivers/i3c/internals.h
index 1906c711f38a..d16a79953709 100644
--- a/drivers/i3c/internals.h
+++ b/drivers/i3c/internals.h
@@ -24,4 +24,41 @@ int i3c_dev_enable_ibi_locked(struct i3c_dev_desc *dev);
int i3c_dev_request_ibi_locked(struct i3c_dev_desc *dev,
const struct i3c_ibi_setup *req);
void i3c_dev_free_ibi_locked(struct i3c_dev_desc *dev);
+
+/**
+ * i3c_writel_fifo - Write data buffer to 32bit FIFO
+ * @addr: FIFO Address to write to
+ * @buf: Pointer to the data bytes to write
+ * @nbytes: Number of bytes to write
+ */
+static inline void i3c_writel_fifo(void __iomem *addr, const void *buf,
+ int nbytes)
+{
+ writesl(addr, buf, nbytes / 4);
+ if (nbytes & 3) {
+ u32 tmp = 0;
+
+ memcpy(&tmp, buf + (nbytes & ~3), nbytes & 3);
+ writel(tmp, addr);
+ }
+}
+
+/**
+ * i3c_readl_fifo - Read data buffer from 32bit FIFO
+ * @addr: FIFO Address to read from
+ * @buf: Pointer to the buffer to store read bytes
+ * @nbytes: Number of bytes to read
+ */
+static inline void i3c_readl_fifo(const void __iomem *addr, void *buf,
+ int nbytes)
+{
+ readsl(addr, buf, nbytes / 4);
+ if (nbytes & 3) {
+ u32 tmp;
+
+ tmp = readl(addr);
+ memcpy(buf + (nbytes & ~3), &tmp, nbytes & 3);
+ }
+}
+
#endif /* I3C_INTERNAL_H */
--
2.43.0
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 6.1.y-cip 12/22] i3c: Correct the macro module_i3c_i2c_driver
2026-01-08 9:28 [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E Tommaso Merciai
` (10 preceding siblings ...)
2026-01-08 9:28 ` [PATCH 6.1.y-cip 11/22] i3c: master: Add inline i3c_readl_fifo() and i3c_writel_fifo() Tommaso Merciai
@ 2026-01-08 9:28 ` Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 13/22] i3c: export SETDASA method Tommaso Merciai
` (10 subsequent siblings)
22 siblings, 0 replies; 34+ messages in thread
From: Tommaso Merciai @ 2026-01-08 9:28 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Naveen Krishna Chatradhi <nchatrad@amd.com>
commit 01744ce9f07f0b76b0b2d30adba2a7c104f1ff2a upstream.
Present definition for module_i3c_i2c_driver uses only the
1st argument i.e., struct i3c_driver.
Irrespective of CONFIG_I3C being enabled/disabled,
struct i2c_driver is never passed to module_driver()
Passing struct i2c_driver as the 4th argument works.
Signed-off-by: Akshay Gupta <Akshay.Gupta@amd.com>
Signed-off-by: Naveen Krishna Chatradhi <nchatrad@amd.com>
Link: https://lore.kernel.org/r/20221205105413.937704-1-naveenkrishna.chatradhi@amd.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
include/linux/i3c/device.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/linux/i3c/device.h b/include/linux/i3c/device.h
index 8242e13e7b0b..419192b5cc4d 100644
--- a/include/linux/i3c/device.h
+++ b/include/linux/i3c/device.h
@@ -287,7 +287,8 @@ static inline void i3c_i2c_driver_unregister(struct i3c_driver *i3cdrv,
#define module_i3c_i2c_driver(__i3cdrv, __i2cdrv) \
module_driver(__i3cdrv, \
i3c_i2c_driver_register, \
- i3c_i2c_driver_unregister)
+ i3c_i2c_driver_unregister, \
+ __i2cdrv)
int i3c_device_do_priv_xfers(struct i3c_device *dev,
struct i3c_priv_xfer *xfers,
--
2.43.0
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 6.1.y-cip 13/22] i3c: export SETDASA method
2026-01-08 9:28 [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E Tommaso Merciai
` (11 preceding siblings ...)
2026-01-08 9:28 ` [PATCH 6.1.y-cip 12/22] i3c: Correct the macro module_i3c_i2c_driver Tommaso Merciai
@ 2026-01-08 9:28 ` Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 14/22] clk: renesas: r9a09g047: Add I3C0 clocks and resets Tommaso Merciai
` (9 subsequent siblings)
22 siblings, 0 replies; 34+ messages in thread
From: Tommaso Merciai @ 2026-01-08 9:28 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Jack Chen <zenghuchen@google.com>
commit 672825cd2823a0cee4687ce80fef5b702ff3caa3 upstream.
Because not all I3C drivers have the hot-join feature ready, and
especially not all I3C devices support hot-join feature, exporting
SETDASA method could be useful. With this function, the I3C controller
could perform a DAA to I3C devices when users decide to turn these I3C
devices off and on again during run-time.
Tested: This change has been tested with turnning off an I3C device and
turning on it again during run-time. The device driver calls SETDASA
method to perform DAA to the device. And communication between I3C
controller and device is set up again correctly.
Signed-off-by: Jack Chen <zenghuchen@google.com>
Link: https://lore.kernel.org/r/20221207205059.3848851-1-zenghuchen@google.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
drivers/i3c/device.c | 20 ++++++++++++++++++++
drivers/i3c/internals.h | 1 +
drivers/i3c/master.c | 19 +++++++++++++++++++
include/linux/i3c/device.h | 2 ++
4 files changed, 42 insertions(+)
diff --git a/drivers/i3c/device.c b/drivers/i3c/device.c
index e92d3e9a52bd..9762630b917e 100644
--- a/drivers/i3c/device.c
+++ b/drivers/i3c/device.c
@@ -50,6 +50,26 @@ int i3c_device_do_priv_xfers(struct i3c_device *dev,
}
EXPORT_SYMBOL_GPL(i3c_device_do_priv_xfers);
+/**
+ * i3c_device_do_setdasa() - do I3C dynamic address assignement with
+ * static address
+ *
+ * @dev: device with which the DAA should be done
+ *
+ * Return: 0 in case of success, a negative error core otherwise.
+ */
+int i3c_device_do_setdasa(struct i3c_device *dev)
+{
+ int ret;
+
+ i3c_bus_normaluse_lock(dev->bus);
+ ret = i3c_dev_setdasa_locked(dev->desc);
+ i3c_bus_normaluse_unlock(dev->bus);
+
+ return ret;
+}
+EXPORT_SYMBOL_GPL(i3c_device_do_setdasa);
+
/**
* i3c_device_get_info() - get I3C device information
*
diff --git a/drivers/i3c/internals.h b/drivers/i3c/internals.h
index d16a79953709..80245b953c71 100644
--- a/drivers/i3c/internals.h
+++ b/drivers/i3c/internals.h
@@ -16,6 +16,7 @@ extern struct bus_type i3c_bus_type;
void i3c_bus_normaluse_lock(struct i3c_bus *bus);
void i3c_bus_normaluse_unlock(struct i3c_bus *bus);
+int i3c_dev_setdasa_locked(struct i3c_dev_desc *dev);
int i3c_dev_do_priv_xfers_locked(struct i3c_dev_desc *dev,
struct i3c_priv_xfer *xfers,
int nxfers);
diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
index 035dab33f85d..7405bf386d8a 100644
--- a/drivers/i3c/master.c
+++ b/drivers/i3c/master.c
@@ -2924,6 +2924,25 @@ void i3c_master_unregister(struct i3c_master_controller *master)
}
EXPORT_SYMBOL_GPL(i3c_master_unregister);
+int i3c_dev_setdasa_locked(struct i3c_dev_desc *dev)
+{
+ struct i3c_master_controller *master;
+
+ if (!dev)
+ return -ENOENT;
+
+ master = i3c_dev_get_master(dev);
+ if (!master)
+ return -EINVAL;
+
+ if (!dev->boardinfo || !dev->boardinfo->init_dyn_addr ||
+ !dev->boardinfo->static_addr)
+ return -EINVAL;
+
+ return i3c_master_setdasa_locked(master, dev->info.static_addr,
+ dev->boardinfo->init_dyn_addr);
+}
+
int i3c_dev_do_priv_xfers_locked(struct i3c_dev_desc *dev,
struct i3c_priv_xfer *xfers,
int nxfers)
diff --git a/include/linux/i3c/device.h b/include/linux/i3c/device.h
index 419192b5cc4d..1c997abe868c 100644
--- a/include/linux/i3c/device.h
+++ b/include/linux/i3c/device.h
@@ -294,6 +294,8 @@ int i3c_device_do_priv_xfers(struct i3c_device *dev,
struct i3c_priv_xfer *xfers,
int nxfers);
+int i3c_device_do_setdasa(struct i3c_device *dev);
+
void i3c_device_get_info(struct i3c_device *dev, struct i3c_device_info *info);
struct i3c_ibi_payload {
--
2.43.0
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 6.1.y-cip 14/22] clk: renesas: r9a09g047: Add I3C0 clocks and resets
2026-01-08 9:28 [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E Tommaso Merciai
` (12 preceding siblings ...)
2026-01-08 9:28 ` [PATCH 6.1.y-cip 13/22] i3c: export SETDASA method Tommaso Merciai
@ 2026-01-08 9:28 ` Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 15/22] arm64: dts: renesas: r9a09g047: Add I3C node Tommaso Merciai
` (8 subsequent siblings)
22 siblings, 0 replies; 34+ messages in thread
From: Tommaso Merciai @ 2026-01-08 9:28 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
commit c939b63f44e50c3d2bd3790cddf07c3ef805ca5f upstream.
Add I3C0 clock and reset support to the Renesas RZ/G3E R9A09G047 CPG
driver.
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/20250611093934.4208-3-wsa+renesas@sang-engineering.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
drivers/clk/renesas/r9a09g047-cpg.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/clk/renesas/r9a09g047-cpg.c b/drivers/clk/renesas/r9a09g047-cpg.c
index 281d19782409..26e2be7667eb 100644
--- a/drivers/clk/renesas/r9a09g047-cpg.c
+++ b/drivers/clk/renesas/r9a09g047-cpg.c
@@ -198,6 +198,12 @@ static const struct rzv2h_mod_clk r9a09g047_mod_clks[] __initconst = {
BUS_MSTOP(5, BIT(13))),
DEF_MOD("scif_0_clk_pck", CLK_PLLCM33_DIV16, 8, 15, 4, 15,
BUS_MSTOP(3, BIT(14))),
+ DEF_MOD("i3c_0_pclkrw", CLK_PLLCLN_DIV16, 9, 0, 4, 16,
+ BUS_MSTOP(10, BIT(15))),
+ DEF_MOD("i3c_0_pclk", CLK_PLLCLN_DIV16, 9, 1, 4, 17,
+ BUS_MSTOP(10, BIT(15))),
+ DEF_MOD("i3c_0_tclk", CLK_PLLCLN_DIV8, 9, 2, 4, 18,
+ BUS_MSTOP(10, BIT(15))),
DEF_MOD("riic_8_ckm", CLK_PLLCM33_DIV16, 9, 3, 4, 19,
BUS_MSTOP(3, BIT(13))),
DEF_MOD("riic_0_ckm", CLK_PLLCLN_DIV16, 9, 4, 4, 20,
@@ -301,6 +307,8 @@ static const struct rzv2h_reset r9a09g047_resets[] __initconst = {
DEF_RST(7, 7, 3, 8), /* WDT_2_RESET */
DEF_RST(7, 8, 3, 9), /* WDT_3_RESET */
DEF_RST(9, 5, 4, 6), /* SCIF_0_RST_SYSTEM_N */
+ DEF_RST(9, 6, 4, 7), /* I3C_0_PRESETN */
+ DEF_RST(9, 7, 4, 8), /* I3C_0_TRESETN */
DEF_RST(9, 8, 4, 9), /* RIIC_0_MRST */
DEF_RST(9, 9, 4, 10), /* RIIC_1_MRST */
DEF_RST(9, 10, 4, 11), /* RIIC_2_MRST */
--
2.43.0
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 6.1.y-cip 15/22] arm64: dts: renesas: r9a09g047: Add I3C node
2026-01-08 9:28 [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E Tommaso Merciai
` (13 preceding siblings ...)
2026-01-08 9:28 ` [PATCH 6.1.y-cip 14/22] clk: renesas: r9a09g047: Add I3C0 clocks and resets Tommaso Merciai
@ 2026-01-08 9:28 ` Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 16/22] dt-bindings: hwmon: ti,tmp108: document V+ supply, add short description Tommaso Merciai
` (7 subsequent siblings)
22 siblings, 0 replies; 34+ messages in thread
From: Tommaso Merciai @ 2026-01-08 9:28 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
commit 6fb1e70e7a918969573bc5258975456bb7165cc0 upstream.
Add the I3C node to RZ/G3E SoC DTSI.
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/20250807151434.5241-8-wsa+renesas@sang-engineering.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
arch/arm64/boot/dts/renesas/r9a09g047.dtsi | 35 ++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/arch/arm64/boot/dts/renesas/r9a09g047.dtsi b/arch/arm64/boot/dts/renesas/r9a09g047.dtsi
index b55b113d1f11..42bf6a57df97 100644
--- a/arch/arm64/boot/dts/renesas/r9a09g047.dtsi
+++ b/arch/arm64/boot/dts/renesas/r9a09g047.dtsi
@@ -322,6 +322,41 @@ scif0: serial@11c01400 {
status = "disabled";
};
+ i3c: i3c@12400000 {
+ compatible = "renesas,r9a09g047-i3c";
+ reg = <0 0x12400000 0 0x10000>;
+ clocks = <&cpg CPG_MOD 0x91>,
+ <&cpg CPG_MOD 0x92>,
+ <&cpg CPG_MOD 0x90>;
+ clock-names = "pclk", "tclk", "pclkrw";
+ interrupts = <GIC_SPI 674 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 675 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 676 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 677 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 678 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 679 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 680 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 681 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 682 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 689 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 690 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 692 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 693 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 694 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 695 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 696 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "ierr", "terr", "abort", "resp",
+ "cmd", "ibi", "rx", "tx", "rcv",
+ "st", "sp", "tend", "nack", "al",
+ "tmo", "wu";
+ resets = <&cpg 0x96>, <&cpg 0x97>;
+ reset-names = "presetn", "tresetn";
+ power-domains = <&cpg>;
+ #address-cells = <3>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
canfd: can@12440000 {
compatible = "renesas,r9a09g047-canfd";
reg = <0 0x12440000 0 0x40000>;
--
2.43.0
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 6.1.y-cip 16/22] dt-bindings: hwmon: ti,tmp108: document V+ supply, add short description
2026-01-08 9:28 [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E Tommaso Merciai
` (14 preceding siblings ...)
2026-01-08 9:28 ` [PATCH 6.1.y-cip 15/22] arm64: dts: renesas: r9a09g047: Add I3C node Tommaso Merciai
@ 2026-01-08 9:28 ` Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 17/22] dt-bindings: hwmon: ti,tmp108: Add nxp,p3t1085 compatible string Tommaso Merciai
` (6 subsequent siblings)
22 siblings, 0 replies; 34+ messages in thread
From: Tommaso Merciai @ 2026-01-08 9:28 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Stanislav Jakubek <stano.jakubek@gmail.com>
commit 699383466851e3fb8284e1eefeed78ec30989b3b upstream.
TMP108 is powered by its V+ supply, document it. The property is called
"vcc-supply" since the plus sign (+) is not an expected character.
While at it, add a short description with a link to its datasheets.
Signed-off-by: Stanislav Jakubek <stano.jakubek@gmail.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/ZnBmDXfnDQXNXz3k@standask-GA-A55M-S2HP
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
.../devicetree/bindings/hwmon/ti,tmp108.yaml | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/Documentation/devicetree/bindings/hwmon/ti,tmp108.yaml b/Documentation/devicetree/bindings/hwmon/ti,tmp108.yaml
index dcbc6fbc3b48..5bbb7aedda3a 100644
--- a/Documentation/devicetree/bindings/hwmon/ti,tmp108.yaml
+++ b/Documentation/devicetree/bindings/hwmon/ti,tmp108.yaml
@@ -9,6 +9,14 @@ title: TMP108 temperature sensor
maintainers:
- Krzysztof Kozlowski <krzk@kernel.org>
+description: |
+ The TMP108 is a digital-output temperature sensor with a
+ dynamically-programmable limit window, and under- and overtemperature
+ alert functions.
+
+ Datasheets:
+ https://www.ti.com/product/TMP108
+
properties:
compatible:
enum:
@@ -24,6 +32,9 @@ properties:
"#thermal-sensor-cells":
const: 0
+ vcc-supply:
+ description: phandle to the regulator that provides the V+ supply
+
required:
- compatible
- reg
@@ -45,6 +56,7 @@ examples:
interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
pinctrl-names = "default";
pinctrl-0 = <&tmp_alrt>;
+ vcc-supply = <&supply>;
#thermal-sensor-cells = <0>;
};
};
--
2.43.0
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 6.1.y-cip 17/22] dt-bindings: hwmon: ti,tmp108: Add nxp,p3t1085 compatible string
2026-01-08 9:28 [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E Tommaso Merciai
` (15 preceding siblings ...)
2026-01-08 9:28 ` [PATCH 6.1.y-cip 16/22] dt-bindings: hwmon: ti,tmp108: document V+ supply, add short description Tommaso Merciai
@ 2026-01-08 9:28 ` Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 18/22] hwmon: (tmp108) Add NXP p3t1085 support Tommaso Merciai
` (5 subsequent siblings)
22 siblings, 0 replies; 34+ messages in thread
From: Tommaso Merciai @ 2026-01-08 9:28 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Frank Li <Frank.Li@nxp.com>
commit 4585580781d69d8627e15f027873e46282ea3787 upstream.
The register layout of P3T1085 is the same as ti,tmp108. Add compatible
string nxp,p3t1085 for it. The difference of P3T1085 is support I3C.
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Message-ID: <20241111-p3t1085-v3-1-bff511550aad@nxp.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
Documentation/devicetree/bindings/hwmon/ti,tmp108.yaml | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/hwmon/ti,tmp108.yaml b/Documentation/devicetree/bindings/hwmon/ti,tmp108.yaml
index 5bbb7aedda3a..1f8af3a0048b 100644
--- a/Documentation/devicetree/bindings/hwmon/ti,tmp108.yaml
+++ b/Documentation/devicetree/bindings/hwmon/ti,tmp108.yaml
@@ -4,22 +4,26 @@
$id: http://devicetree.org/schemas/hwmon/ti,tmp108.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
-title: TMP108 temperature sensor
+title: TMP108/P3T1085(NXP) temperature sensor
maintainers:
- Krzysztof Kozlowski <krzk@kernel.org>
description: |
- The TMP108 is a digital-output temperature sensor with a
+ The TMP108/P3T1085(NXP) is a digital-output temperature sensor with a
dynamically-programmable limit window, and under- and overtemperature
alert functions.
+ P3T1085(NXP) support I3C.
+
Datasheets:
https://www.ti.com/product/TMP108
+ https://www.nxp.com/docs/en/data-sheet/P3T1085UK.pdf
properties:
compatible:
enum:
+ - nxp,p3t1085
- ti,tmp108
interrupts:
--
2.43.0
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 6.1.y-cip 18/22] hwmon: (tmp108) Add NXP p3t1085 support
2026-01-08 9:28 [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E Tommaso Merciai
` (16 preceding siblings ...)
2026-01-08 9:28 ` [PATCH 6.1.y-cip 17/22] dt-bindings: hwmon: ti,tmp108: Add nxp,p3t1085 compatible string Tommaso Merciai
@ 2026-01-08 9:28 ` Tommaso Merciai
2026-01-09 10:29 ` [cip-dev] " Pavel Machek
2026-01-08 9:28 ` [PATCH 6.1.y-cip 19/22] hwmon: (tmp108) Add helper function tmp108_common_probe() to prepare I3C support Tommaso Merciai
` (4 subsequent siblings)
22 siblings, 1 reply; 34+ messages in thread
From: Tommaso Merciai @ 2026-01-08 9:28 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Frank Li <Frank.Li@nxp.com>
commit 11d35624d7696a64724160199fc94587010d7cb2 upstream.
Add compatible string 'nxp,p3t1085' since p3t1085's register layout is the
same as tmp108.
The p3t1085 supports I3C interface.
Update document tmp108.rst and Kconfig's help context.
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Message-ID: <20241111-p3t1085-v3-2-bff511550aad@nxp.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
Documentation/hwmon/tmp108.rst | 8 ++++++++
drivers/hwmon/Kconfig | 2 +-
drivers/hwmon/tmp108.c | 1 +
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/Documentation/hwmon/tmp108.rst b/Documentation/hwmon/tmp108.rst
index 6df7cf1b42f4..bc4941d98268 100644
--- a/Documentation/hwmon/tmp108.rst
+++ b/Documentation/hwmon/tmp108.rst
@@ -3,6 +3,14 @@ Kernel driver tmp108
Supported chips:
+ * NXP P3T1085
+
+ Prefix: 'p3t1085'
+
+ Addresses scanned: none
+
+ Datasheet: https://www.nxp.com/docs/en/data-sheet/P3T1085UK.pdf
+
* Texas Instruments TMP108
Prefix: 'tmp108'
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index 7884fcb95c3e..df7a0d3b59ce 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -2063,7 +2063,7 @@ config SENSORS_TMP108
select REGMAP_I2C
help
If you say yes here you get support for Texas Instruments TMP108
- sensor chips.
+ sensor chips and NXP P3T1085.
This driver can also be built as a module. If so, the module
will be called tmp108.
diff --git a/drivers/hwmon/tmp108.c b/drivers/hwmon/tmp108.c
index acb4ba750b09..a8d9a4e00eb0 100644
--- a/drivers/hwmon/tmp108.c
+++ b/drivers/hwmon/tmp108.c
@@ -420,6 +420,7 @@ MODULE_DEVICE_TABLE(i2c, tmp108_i2c_ids);
#ifdef CONFIG_OF
static const struct of_device_id tmp108_of_ids[] = {
+ { .compatible = "nxp,p3t1085", },
{ .compatible = "ti,tmp108", },
{}
};
--
2.43.0
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 6.1.y-cip 19/22] hwmon: (tmp108) Add helper function tmp108_common_probe() to prepare I3C support
2026-01-08 9:28 [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E Tommaso Merciai
` (17 preceding siblings ...)
2026-01-08 9:28 ` [PATCH 6.1.y-cip 18/22] hwmon: (tmp108) Add NXP p3t1085 support Tommaso Merciai
@ 2026-01-08 9:28 ` Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 20/22] hwmon: (tmp108) Add support for I3C device Tommaso Merciai
` (3 subsequent siblings)
22 siblings, 0 replies; 34+ messages in thread
From: Tommaso Merciai @ 2026-01-08 9:28 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Frank Li <Frank.Li@nxp.com>
commit 700f3250198d51093884254220a96777a922dd47 upstream.
Add help function tmp108_common_probe() to pave road to support i3c for
P3T1085(NXP) chip.
Use dev_err_probe() to simplify the code.
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Message-ID: <20241112-p3t1085-v4-1-a1334314b1e6@nxp.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
drivers/hwmon/tmp108.c | 39 +++++++++++++++++++++------------------
1 file changed, 21 insertions(+), 18 deletions(-)
diff --git a/drivers/hwmon/tmp108.c b/drivers/hwmon/tmp108.c
index a8d9a4e00eb0..63c2eaa59d21 100644
--- a/drivers/hwmon/tmp108.c
+++ b/drivers/hwmon/tmp108.c
@@ -323,33 +323,19 @@ static const struct regmap_config tmp108_regmap_config = {
.use_single_write = true,
};
-static int tmp108_probe(struct i2c_client *client)
+static int tmp108_common_probe(struct device *dev, struct regmap *regmap, char *name)
{
- struct device *dev = &client->dev;
struct device *hwmon_dev;
struct tmp108 *tmp108;
- int err;
u32 config;
-
- if (!i2c_check_functionality(client->adapter,
- I2C_FUNC_SMBUS_WORD_DATA)) {
- dev_err(dev,
- "adapter doesn't support SMBus word transactions\n");
- return -ENODEV;
- }
+ int err;
tmp108 = devm_kzalloc(dev, sizeof(*tmp108), GFP_KERNEL);
if (!tmp108)
return -ENOMEM;
dev_set_drvdata(dev, tmp108);
-
- tmp108->regmap = devm_regmap_init_i2c(client, &tmp108_regmap_config);
- if (IS_ERR(tmp108->regmap)) {
- err = PTR_ERR(tmp108->regmap);
- dev_err(dev, "regmap init failed: %d", err);
- return err;
- }
+ tmp108->regmap = regmap;
err = regmap_read(tmp108->regmap, TMP108_REG_CONF, &config);
if (err < 0) {
@@ -383,13 +369,30 @@ static int tmp108_probe(struct i2c_client *client)
return err;
}
- hwmon_dev = devm_hwmon_device_register_with_info(dev, client->name,
+ hwmon_dev = devm_hwmon_device_register_with_info(dev, name,
tmp108,
&tmp108_chip_info,
NULL);
return PTR_ERR_OR_ZERO(hwmon_dev);
}
+static int tmp108_probe(struct i2c_client *client)
+{
+ struct device *dev = &client->dev;
+ struct regmap *regmap;
+
+ if (!i2c_check_functionality(client->adapter,
+ I2C_FUNC_SMBUS_WORD_DATA))
+ return dev_err_probe(dev, -ENODEV,
+ "adapter doesn't support SMBus word transactions\n");
+
+ regmap = devm_regmap_init_i2c(client, &tmp108_regmap_config);
+ if (IS_ERR(regmap))
+ return dev_err_probe(dev, PTR_ERR(regmap), "regmap init failed");
+
+ return tmp108_common_probe(dev, regmap, client->name);
+}
+
static int tmp108_suspend(struct device *dev)
{
struct tmp108 *tmp108 = dev_get_drvdata(dev);
--
2.43.0
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 6.1.y-cip 20/22] hwmon: (tmp108) Add support for I3C device
2026-01-08 9:28 [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E Tommaso Merciai
` (18 preceding siblings ...)
2026-01-08 9:28 ` [PATCH 6.1.y-cip 19/22] hwmon: (tmp108) Add helper function tmp108_common_probe() to prepare I3C support Tommaso Merciai
@ 2026-01-08 9:28 ` Tommaso Merciai
2026-01-09 10:32 ` [cip-dev] " Pavel Machek
2026-01-08 9:28 ` [PATCH 6.1.y-cip 21/22] hwmon: (tmp108) Do not fail in I3C probe when I3C regmap is a module Tommaso Merciai
` (2 subsequent siblings)
22 siblings, 1 reply; 34+ messages in thread
From: Tommaso Merciai @ 2026-01-08 9:28 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Frank Li <Frank.Li@nxp.com>
commit c40655e3310649866c4ebf7a10f0d53802ebdfa9 upstream.
Add support for I3C device in the tmp108 driver to handle the P3T1085
sensor. Register the I3C device driver to enable I3C functionality for the
sensor.
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Message-ID: <20241112-p3t1085-v4-2-a1334314b1e6@nxp.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
drivers/hwmon/Kconfig | 1 +
drivers/hwmon/tmp108.c | 35 ++++++++++++++++++++++++++++++++++-
2 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index df7a0d3b59ce..da55b19f244f 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -2061,6 +2061,7 @@ config SENSORS_TMP108
tristate "Texas Instruments TMP108"
depends on I2C
select REGMAP_I2C
+ select REGMAP_I3C if I3C
help
If you say yes here you get support for Texas Instruments TMP108
sensor chips and NXP P3T1085.
diff --git a/drivers/hwmon/tmp108.c b/drivers/hwmon/tmp108.c
index 63c2eaa59d21..55277ec7c54b 100644
--- a/drivers/hwmon/tmp108.c
+++ b/drivers/hwmon/tmp108.c
@@ -13,6 +13,7 @@
#include <linux/mutex.h>
#include <linux/of.h>
#include <linux/i2c.h>
+#include <linux/i3c/device.h>
#include <linux/init.h>
#include <linux/jiffies.h>
#include <linux/regmap.h>
@@ -440,7 +441,39 @@ static struct i2c_driver tmp108_driver = {
.id_table = tmp108_i2c_ids,
};
-module_i2c_driver(tmp108_driver);
+static const struct i3c_device_id p3t1085_i3c_ids[] = {
+ I3C_DEVICE(0x011b, 0x1529, NULL),
+ {}
+};
+MODULE_DEVICE_TABLE(i3c, p3t1085_i3c_ids);
+
+static int p3t1085_i3c_probe(struct i3c_device *i3cdev)
+{
+ struct device *dev = i3cdev_to_dev(i3cdev);
+ struct regmap *regmap;
+
+#ifdef CONFIG_REGMAP_I3C
+ regmap = devm_regmap_init_i3c(i3cdev, &tmp108_regmap_config);
+#else
+ regmap = ERR_PTR(-ENODEV);
+#endif
+
+ if (IS_ERR(regmap))
+ return dev_err_probe(dev, PTR_ERR(regmap),
+ "Failed to register i3c regmap\n");
+
+ return tmp108_common_probe(dev, regmap, "p3t1085_i3c");
+}
+
+static struct i3c_driver p3t1085_driver = {
+ .driver = {
+ .name = "p3t1085_i3c",
+ },
+ .probe = p3t1085_i3c_probe,
+ .id_table = p3t1085_i3c_ids,
+};
+
+module_i3c_i2c_driver(p3t1085_driver, &tmp108_driver)
MODULE_AUTHOR("John Muir <john@jmuir.com>");
MODULE_DESCRIPTION("Texas Instruments TMP108 temperature sensor driver");
--
2.43.0
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 6.1.y-cip 21/22] hwmon: (tmp108) Do not fail in I3C probe when I3C regmap is a module
2026-01-08 9:28 [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E Tommaso Merciai
` (19 preceding siblings ...)
2026-01-08 9:28 ` [PATCH 6.1.y-cip 20/22] hwmon: (tmp108) Add support for I3C device Tommaso Merciai
@ 2026-01-08 9:28 ` Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 22/22] hwmon: (tmp108) Add basic regulator support Tommaso Merciai
2026-01-09 10:39 ` [cip-dev] [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E Pavel Machek
22 siblings, 0 replies; 34+ messages in thread
From: Tommaso Merciai @ 2026-01-08 9:28 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Jarkko Nikula <jarkko.nikula@linux.intel.com>
commit 8281d627905dc72241ca3969ee18f3e029e96d00 upstream.
I3C device probe fails when CONFIG_REGMAP_I3C=m:
p3t1085_i3c 0-23615290090: error -ENODEV: Failed to register i3c regmap
Fix this by using the IS_ENABLED(CONFIG_REGMAP_I3C) macro in the code.
Fixes: c40655e33106 ("hwmon: (tmp108) Add support for I3C device")
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Message-ID: <20241121121819.393104-1-jarkko.nikula@linux.intel.com>
[groeck: Remove #ifdef entirely; it is not needed due to dead code elimination]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
drivers/hwmon/tmp108.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/hwmon/tmp108.c b/drivers/hwmon/tmp108.c
index 55277ec7c54b..955e6cd378dd 100644
--- a/drivers/hwmon/tmp108.c
+++ b/drivers/hwmon/tmp108.c
@@ -452,12 +452,7 @@ static int p3t1085_i3c_probe(struct i3c_device *i3cdev)
struct device *dev = i3cdev_to_dev(i3cdev);
struct regmap *regmap;
-#ifdef CONFIG_REGMAP_I3C
regmap = devm_regmap_init_i3c(i3cdev, &tmp108_regmap_config);
-#else
- regmap = ERR_PTR(-ENODEV);
-#endif
-
if (IS_ERR(regmap))
return dev_err_probe(dev, PTR_ERR(regmap),
"Failed to register i3c regmap\n");
--
2.43.0
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 6.1.y-cip 22/22] hwmon: (tmp108) Add basic regulator support
2026-01-08 9:28 [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E Tommaso Merciai
` (20 preceding siblings ...)
2026-01-08 9:28 ` [PATCH 6.1.y-cip 21/22] hwmon: (tmp108) Do not fail in I3C probe when I3C regmap is a module Tommaso Merciai
@ 2026-01-08 9:28 ` Tommaso Merciai
2026-01-09 10:39 ` [cip-dev] [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E Pavel Machek
22 siblings, 0 replies; 34+ messages in thread
From: Tommaso Merciai @ 2026-01-08 9:28 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Stanislav Jakubek <stano.jakubek@gmail.com>
commit bddbb9cff4ab97ad367692201a0abe680a59d44d upstream.
TMP108/P3T1085 are powered by the V+/VCC regulator, add support for it.
Signed-off-by: Stanislav Jakubek <stano.jakubek@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
drivers/hwmon/tmp108.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/hwmon/tmp108.c b/drivers/hwmon/tmp108.c
index 955e6cd378dd..d389b698d3bc 100644
--- a/drivers/hwmon/tmp108.c
+++ b/drivers/hwmon/tmp108.c
@@ -17,6 +17,7 @@
#include <linux/init.h>
#include <linux/jiffies.h>
#include <linux/regmap.h>
+#include <linux/regulator/consumer.h>
#include <linux/slab.h>
#define DRIVER_NAME "tmp108"
@@ -331,6 +332,10 @@ static int tmp108_common_probe(struct device *dev, struct regmap *regmap, char *
u32 config;
int err;
+ err = devm_regulator_get_enable(dev, "vcc");
+ if (err)
+ return dev_err_probe(dev, err, "Failed to enable regulator\n");
+
tmp108 = devm_kzalloc(dev, sizeof(*tmp108), GFP_KERNEL);
if (!tmp108)
return -ENOMEM;
--
2.43.0
^ permalink raw reply related [flat|nested] 34+ messages in thread
* Re: [cip-dev] [PATCH 6.1.y-cip 04/22] i3c: master: Add basic driver for the Renesas I3C controller
2026-01-08 9:28 ` [PATCH 6.1.y-cip 04/22] i3c: master: Add basic driver for the Renesas I3C controller Tommaso Merciai
@ 2026-01-09 10:22 ` Pavel Machek
2026-01-09 11:58 ` Tommaso Merciai
2026-01-14 11:53 ` Pavel Machek
1 sibling, 1 reply; 34+ messages in thread
From: Pavel Machek @ 2026-01-09 10:22 UTC (permalink / raw)
To: tommaso.merciai.xr
Cc: cip-dev, Nobuhiro Iwamatsu, Biju Das, Lad Prabhakar, tomm.merciai
[-- Attachment #1: Type: text/plain, Size: 3304 bytes --]
Hi!
Some comments and questions are below.
> Add a basic driver for the I3C controller found in Renesas RZ/G3S and
> G3E SoCs. Support I3C pure busses (tested with two targets) and mixed
> busses (two I3C devices plus various I2C targets). DAA and communication
> with temperature sensors worked reliably at various speeds.
>
> Missing features such as IBI, HotJoin, and target mode will be added
> incrementally.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> Tested-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> Reviewed-by: Frank Li <Frank.Li@nxp.com>
> Link: https://lore.kernel.org/r/20250724094146.6443-5-wsa+renesas@sang-engineering.com
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> [tommaso.merciai:
> - Removed __counted_by(ncmds) from struct renesas_i3c_cmd cmds[]
> - Added struct reset_control *tresetn, *presetn into struct
> renesas_i3c
> - Use devm_reset_control_get_optional_exclusive() into probe function +
> reset_control_deassert() and devm_add_action_or_reset() for tresetn,
> presetn error path.
> - Fixed renesas_i3c_remove() from static void to static int]
> Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> diff --git a/drivers/i3c/master/renesas-i3c.c b/drivers/i3c/master/renesas-i3c.c
> new file mode 100644
> index 000000000000..432be328a4e4
> --- /dev/null
> +++ b/drivers/i3c/master/renesas-i3c.c
...
> + /* Initialize Queue/Buffer threshold */
> + renesas_writel(i3c->regs, NQTHCTL, NQTHCTL_IBIDSSZ(6) |
> + NQTHCTL_CMDQTH(1));
> +
> + /* The only supported configuration is two entries*/
Add a space before */.
...
> + /* Hot-Join Acknowlege setting. */
> + renesas_set_bit(i3c->regs, BCTL, BCTL_HJACKCTL);
I would not mind consistency in the dots at the end of comment. Normal
convention is not to have them unless comment is a sentence.
> +static int renesas_i3c_priv_xfers(struct i3c_dev_desc *dev, struct i3c_priv_xfer *i3c_xfers,
> + int i3c_nxfers)
> +{
> + struct i3c_master_controller *m = i3c_dev_get_master(dev);
> + struct renesas_i3c *i3c = to_renesas_i3c(m);
> + struct renesas_i3c_i2c_dev_data *data = i3c_dev_get_master_data(dev);
> + struct renesas_i3c_xfer *xfer;
> + int i;
> +
> + /* Enable I3C bus. */
> + renesas_i3c_bus_enable(m, true);
> +
> + xfer = renesas_i3c_alloc_xfer(i3c, 1);
> + if (!xfer)
> + return -ENOMEM;
...where is xfer freed?
> + xfer = i3c->xferqueue.cur;
> + cmd = xfer->cmds;
> +
> + /* Clear the Respone Queue Full status flag*/
> + renesas_clear_bit(i3c->regs, NTST, NTST_RSPQFF);
Space before */, please.
> + ret = reset_control_deassert(i3c->tresetn);
> + if (ret)
> + return ret;
> +
> + ret = reset_control_deassert(i3c->presetn);
> + if (ret)
## BUG: return ret;
> + ret = devm_add_action_or_reset(&pdev->dev, renesas_i3c_reset_control_assert,
> + i3c->tresetn);
> + if (ret)
> + return ret;
> +
> + ret = devm_add_action_or_reset(&pdev->dev, renesas_i3c_reset_control_assert,
> + i3c->presetn);
> + if (ret)
> + return ret;
This is wrong, AFAICT. If return happens at marked line, we'll leave
tresetn asserted.
Best regards,
Pavel
--
In cooperation with Nabla.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [cip-dev] [PATCH 6.1.y-cip 11/22] i3c: master: Add inline i3c_readl_fifo() and i3c_writel_fifo()
2026-01-08 9:28 ` [PATCH 6.1.y-cip 11/22] i3c: master: Add inline i3c_readl_fifo() and i3c_writel_fifo() Tommaso Merciai
@ 2026-01-09 10:26 ` Pavel Machek
0 siblings, 0 replies; 34+ messages in thread
From: Pavel Machek @ 2026-01-09 10:26 UTC (permalink / raw)
To: tommaso.merciai.xr
Cc: cip-dev, Nobuhiro Iwamatsu, Biju Das, Lad Prabhakar, tomm.merciai
[-- Attachment #1: Type: text/plain, Size: 1832 bytes --]
Hi!
> From: Jorge Marques <jorge.marques@analog.com>
>
> commit 733b439375b494e8a6950ab47d18a4b615b73cb3 upstream.
>
> The I3C abstraction expects u8 buffers, but some controllers operate with
> a 32-bit bus width FIFO and cannot flag valid bytes individually. To avoid
> reading or writing outside the buffer bounds, use 32-bit accesses where
> possible and apply memcpy for any remaining bytes
> +++ b/drivers/i3c/internals.h
> @@ -24,4 +24,41 @@ int i3c_dev_enable_ibi_locked(struct i3c_dev_desc *dev);
> int i3c_dev_request_ibi_locked(struct i3c_dev_desc *dev,
> const struct i3c_ibi_setup *req);
> void i3c_dev_free_ibi_locked(struct i3c_dev_desc *dev);
> +
> +/**
> + * i3c_writel_fifo - Write data buffer to 32bit FIFO
> + * @addr: FIFO Address to write to
> + * @buf: Pointer to the data bytes to write
> + * @nbytes: Number of bytes to write
> + */
> +static inline void i3c_writel_fifo(void __iomem *addr, const void *buf,
> + int nbytes)
> +{
> + writesl(addr, buf, nbytes / 4);
> + if (nbytes & 3) {
> + u32 tmp = 0;
> +
> + memcpy(&tmp, buf + (nbytes & ~3), nbytes & 3);
> + writel(tmp, addr);
> + }
> +}
That's quite an interesting code. Will it work correctly on both endianness?
> +/**
> + * i3c_readl_fifo - Read data buffer from 32bit FIFO
> + * @addr: FIFO Address to read from
> + * @buf: Pointer to the buffer to store read bytes
> + * @nbytes: Number of bytes to read
> + */
> +static inline void i3c_readl_fifo(const void __iomem *addr, void *buf,
> + int nbytes)
> +{
> + readsl(addr, buf, nbytes / 4);
> + if (nbytes & 3) {
> + u32 tmp;
> +
> + tmp = readl(addr);
> + memcpy(buf + (nbytes & ~3), &tmp, nbytes & 3);
> + }
> +}
Same question here.
Best regards,
Pavel
--
In cooperation with Nabla.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [cip-dev] [PATCH 6.1.y-cip 18/22] hwmon: (tmp108) Add NXP p3t1085 support
2026-01-08 9:28 ` [PATCH 6.1.y-cip 18/22] hwmon: (tmp108) Add NXP p3t1085 support Tommaso Merciai
@ 2026-01-09 10:29 ` Pavel Machek
0 siblings, 0 replies; 34+ messages in thread
From: Pavel Machek @ 2026-01-09 10:29 UTC (permalink / raw)
To: tommaso.merciai.xr
Cc: cip-dev, Nobuhiro Iwamatsu, Biju Das, Lad Prabhakar, tomm.merciai
[-- Attachment #1: Type: text/plain, Size: 694 bytes --]
Hi!
> Add compatible string 'nxp,p3t1085' since p3t1085's register layout is the
> same as tmp108.
> +++ b/drivers/hwmon/Kconfig
> @@ -2063,7 +2063,7 @@ config SENSORS_TMP108
> select REGMAP_I2C
> help
> If you say yes here you get support for Texas Instruments TMP108
> - sensor chips.
> + sensor chips and NXP P3T1085.
>
I believe this should be something like
"Enable this driver to get get support for Texas Instruments TMP108
and NXP P3T1085 sensor chips."
Plus, this should really modify the config "" text, otherwise users
will not see this supports P3T1085 unless they open help...?
Best regards,
Pavel
--
In cooperation with Nabla.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [cip-dev] [PATCH 6.1.y-cip 20/22] hwmon: (tmp108) Add support for I3C device
2026-01-08 9:28 ` [PATCH 6.1.y-cip 20/22] hwmon: (tmp108) Add support for I3C device Tommaso Merciai
@ 2026-01-09 10:32 ` Pavel Machek
0 siblings, 0 replies; 34+ messages in thread
From: Pavel Machek @ 2026-01-09 10:32 UTC (permalink / raw)
To: tommaso.merciai.xr
Cc: cip-dev, Nobuhiro Iwamatsu, Biju Das, Lad Prabhakar, tomm.merciai
[-- Attachment #1: Type: text/plain, Size: 1412 bytes --]
Hi!
> From: Frank Li <Frank.Li@nxp.com>
>
> commit c40655e3310649866c4ebf7a10f0d53802ebdfa9 upstream.
>
> Add support for I3C device in the tmp108 driver to handle the P3T1085
> sensor. Register the I3C device driver to enable I3C functionality for the
> sensor.
>
...
> +++ b/drivers/hwmon/Kconfig
> @@ -2061,6 +2061,7 @@ config SENSORS_TMP108
> tristate "Texas Instruments TMP108"
> depends on I2C
> select REGMAP_I2C
> + select REGMAP_I3C if I3C
> help
> If you say yes here you get support for Texas Instruments TMP108
> sensor chips and NXP P3T1085.
Ok, so config says "enable this for P3T1085 support", and we allow
user to enable this without I3C.
> +++ b/drivers/hwmon/tmp108.c
> @@ -440,7 +441,39 @@ static struct i2c_driver tmp108_driver = {
> +static int p3t1085_i3c_probe(struct i3c_device *i3cdev)
> +{
> + struct device *dev = i3cdev_to_dev(i3cdev);
> + struct regmap *regmap;
> +
> +#ifdef CONFIG_REGMAP_I3C
> + regmap = devm_regmap_init_i3c(i3cdev, &tmp108_regmap_config);
> +#else
> + regmap = ERR_PTR(-ENODEV);
> +#endif
> +
> + if (IS_ERR(regmap))
> + return dev_err_probe(dev, PTR_ERR(regmap),
> + "Failed to register i3c regmap\n");
> +
And then we fail the probe with "Failed to register i3c regmap"
message. That looks quite confusing to me.
Best regards,
Pavel
--
In cooperation with Nabla.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [cip-dev] [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E
2026-01-08 9:28 [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E Tommaso Merciai
` (21 preceding siblings ...)
2026-01-08 9:28 ` [PATCH 6.1.y-cip 22/22] hwmon: (tmp108) Add basic regulator support Tommaso Merciai
@ 2026-01-09 10:39 ` Pavel Machek
2026-01-09 12:08 ` Tommaso Merciai
22 siblings, 1 reply; 34+ messages in thread
From: Pavel Machek @ 2026-01-09 10:39 UTC (permalink / raw)
To: tommaso.merciai.xr
Cc: cip-dev, Nobuhiro Iwamatsu, Biju Das, Lad Prabhakar, tomm.merciai
[-- Attachment #1: Type: text/plain, Size: 878 bytes --]
Hi!
> This series adds I3C support for the Renesas RZ/G3E SoC into
> linux-6.1.y-cip kernel. This includes also nxp,p3t1085 I3C backporting
> for testing purposes.
> Tested using the NXP P3T1085UK-ARD connected to the RZ/G3E SMARC SoM
> via the RZ/G3E SMARC BREAKOUT board.
Do we really need to add nxp,p3t1085 ? AFAICT people would need
special hardware, and then would have to patch their dts anyway.
I'd propose not to include these in -cip, as we could test them in the
test farm, and it is just for testing anyway.
I had some minor comments, but those should not block the merge.
Reviewed-by: Pavel Machek <pavel@nabladev.com>
I can apply the series after 6.12 version, if it passes testing and
there are no other comments.
Best regards,
Pavel
--
In cooperation with Nabla.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [cip-dev] [PATCH 6.1.y-cip 04/22] i3c: master: Add basic driver for the Renesas I3C controller
2026-01-09 10:22 ` [cip-dev] " Pavel Machek
@ 2026-01-09 11:58 ` Tommaso Merciai
2026-01-14 11:43 ` Pavel Machek
0 siblings, 1 reply; 34+ messages in thread
From: Tommaso Merciai @ 2026-01-09 11:58 UTC (permalink / raw)
To: Pavel Machek
Cc: cip-dev, Nobuhiro Iwamatsu, Biju Das, Lad Prabhakar, tomm.merciai
Hi Pavel,
Thanks for your review!
On Fri, Jan 09, 2026 at 11:22:42AM +0100, Pavel Machek wrote:
> Hi!
>
> Some comments and questions are below.
>
> > Add a basic driver for the I3C controller found in Renesas RZ/G3S and
> > G3E SoCs. Support I3C pure busses (tested with two targets) and mixed
> > busses (two I3C devices plus various I2C targets). DAA and communication
> > with temperature sensors worked reliably at various speeds.
> >
> > Missing features such as IBI, HotJoin, and target mode will be added
> > incrementally.
> >
> > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> > Tested-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> > Reviewed-by: Frank Li <Frank.Li@nxp.com>
> > Link: https://lore.kernel.org/r/20250724094146.6443-5-wsa+renesas@sang-engineering.com
> > Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> > [tommaso.merciai:
> > - Removed __counted_by(ncmds) from struct renesas_i3c_cmd cmds[]
> > - Added struct reset_control *tresetn, *presetn into struct
> > renesas_i3c
> > - Use devm_reset_control_get_optional_exclusive() into probe function +
> > reset_control_deassert() and devm_add_action_or_reset() for tresetn,
> > presetn error path.
> > - Fixed renesas_i3c_remove() from static void to static int]
> > Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
>
> > diff --git a/drivers/i3c/master/renesas-i3c.c b/drivers/i3c/master/renesas-i3c.c
> > new file mode 100644
> > index 000000000000..432be328a4e4
> > --- /dev/null
> > +++ b/drivers/i3c/master/renesas-i3c.c
> ...
> > + /* Initialize Queue/Buffer threshold */
> > + renesas_writel(i3c->regs, NQTHCTL, NQTHCTL_IBIDSSZ(6) |
> > + NQTHCTL_CMDQTH(1));
> > +
> > + /* The only supported configuration is two entries*/
>
> Add a space before */.
Ack, thanks.
>
> ...
> > + /* Hot-Join Acknowlege setting. */
> > + renesas_set_bit(i3c->regs, BCTL, BCTL_HJACKCTL);
>
> I would not mind consistency in the dots at the end of comment. Normal
> convention is not to have them unless comment is a sentence.
Oks, thanks.
>
>
> > +static int renesas_i3c_priv_xfers(struct i3c_dev_desc *dev, struct i3c_priv_xfer *i3c_xfers,
> > + int i3c_nxfers)
> > +{
> > + struct i3c_master_controller *m = i3c_dev_get_master(dev);
> > + struct renesas_i3c *i3c = to_renesas_i3c(m);
> > + struct renesas_i3c_i2c_dev_data *data = i3c_dev_get_master_data(dev);
> > + struct renesas_i3c_xfer *xfer;
> > + int i;
> > +
> > + /* Enable I3C bus. */
> > + renesas_i3c_bus_enable(m, true);
> > +
> > + xfer = renesas_i3c_alloc_xfer(i3c, 1);
> > + if (!xfer)
> > + return -ENOMEM;
>
> ...where is xfer freed?
Please correct me if I'm wrong but xfer is freed at the end of
renesas_i3c_send_ccc_cmd()
>
> > + xfer = i3c->xferqueue.cur;
> > + cmd = xfer->cmds;
> > +
> > + /* Clear the Respone Queue Full status flag*/
> > + renesas_clear_bit(i3c->regs, NTST, NTST_RSPQFF);
>
> Space before */, please.
>
> > + ret = reset_control_deassert(i3c->tresetn);
> > + if (ret)
> > + return ret;
> > +
> > + ret = reset_control_deassert(i3c->presetn);
> > + if (ret)
> ## BUG: return ret;
>
> > + ret = devm_add_action_or_reset(&pdev->dev, renesas_i3c_reset_control_assert,
> > + i3c->tresetn);
> > + if (ret)
> > + return ret;
> > +
> > + ret = devm_add_action_or_reset(&pdev->dev, renesas_i3c_reset_control_assert,
> > + i3c->presetn);
> > + if (ret)
> > + return ret;
>
> This is wrong, AFAICT. If return happens at marked line, we'll leave
> tresetn asserted.
Ouch, you are right!
This should be:
ret = reset_control_deassert(i3c->tresetn);
if (ret)
return ret;
ret = reset_control_deassert(i3c->presetn);
if (ret) {
reset_control_assert(i3c->tresetn);
return ret;
}
As I've introduce these calls because of missing
devm_reset_control_get_optional_exclusive_deasserted()
Should I fix in v2? Or you can take of this while applying?
Thanks.
>
> Best regards,
> Pavel
> --
> In cooperation with Nabla.
Kind Regards,
Tommaso
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [cip-dev] [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E
2026-01-09 10:39 ` [cip-dev] [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E Pavel Machek
@ 2026-01-09 12:08 ` Tommaso Merciai
2026-01-13 5:43 ` nobuhiro.iwamatsu.x90
0 siblings, 1 reply; 34+ messages in thread
From: Tommaso Merciai @ 2026-01-09 12:08 UTC (permalink / raw)
To: Pavel Machek
Cc: cip-dev, Nobuhiro Iwamatsu, Biju Das, Lad Prabhakar, tomm.merciai
Hi Pavel,
Thanks for your review!
On Fri, Jan 09, 2026 at 11:39:56AM +0100, Pavel Machek wrote:
> Hi!
>
> > This series adds I3C support for the Renesas RZ/G3E SoC into
> > linux-6.1.y-cip kernel. This includes also nxp,p3t1085 I3C backporting
> > for testing purposes.
>
> > Tested using the NXP P3T1085UK-ARD connected to the RZ/G3E SMARC SoM
> > via the RZ/G3E SMARC BREAKOUT board.
>
> Do we really need to add nxp,p3t1085 ? AFAICT people would need
> special hardware, and then would have to patch their dts anyway.
>
> I'd propose not to include these in -cip, as we could test them in the
> test farm, and it is just for testing anyway.
Just FYI for testing on RZ/G3E I used this series + [0] + configs
i3c related enable.
>
> I had some minor comments, but those should not block the merge.
>
> Reviewed-by: Pavel Machek <pavel@nabladev.com>
>
> I can apply the series after 6.12 version, if it passes testing and
> there are no other comments.
>
> Best regards,
> Pavel
> --
> In cooperation with Nabla.
Kind Regards,
Tommaso
[0] https://patchwork.kernel.org/project/linux-renesas-soc/patch/9d1cf2cdb1c11f24378404142e4c8aff680c6961.1763638659.git.tommaso.merciai.xr@bp.renesas.com/
^ permalink raw reply [flat|nested] 34+ messages in thread
* RE: [cip-dev] [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E
2026-01-09 12:08 ` Tommaso Merciai
@ 2026-01-13 5:43 ` nobuhiro.iwamatsu.x90
2026-01-15 8:50 ` Pavel Machek
0 siblings, 1 reply; 34+ messages in thread
From: nobuhiro.iwamatsu.x90 @ 2026-01-13 5:43 UTC (permalink / raw)
To: tommaso.merciai.xr, pavel
Cc: cip-dev, biju.das.jz, prabhakar.mahadev-lad.rj, tomm.merciai
Hi all,
> -----Original Message-----
> From: cip-dev@lists.cip-project.org <cip-dev@lists.cip-project.org> On Behalf
> Of Tommaso Merciai via lists.cip-project.org
> Sent: Friday, January 9, 2026 9:08 PM
> To: Pavel Machek <pavel@nabladev.com>
> Cc: cip-dev@lists.cip-project.org; iwamatsu nobuhiro(岩松 信洋 □DITC○C
> PT) <nobuhiro.iwamatsu.x90@mail.toshiba>; Biju Das
> <biju.das.jz@bp.renesas.com>; Lad Prabhakar
> <prabhakar.mahadev-lad.rj@bp.renesas.com>; tomm.merciai@gmail.com
> Subject: Re: [cip-dev] [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E
>
> Hi Pavel,
> Thanks for your review!
>
>
> On Fri, Jan 09, 2026 at 11:39:56AM +0100, Pavel Machek wrote:
> > Hi!
> >
> > > This series adds I3C support for the Renesas RZ/G3E SoC into
> > > linux-6.1.y-cip kernel. This includes also nxp,p3t1085 I3C
> > > backporting for testing purposes.
> >
> > > Tested using the NXP P3T1085UK-ARD connected to the RZ/G3E SMARC
> SoM
> > > via the RZ/G3E SMARC BREAKOUT board.
> >
> > Do we really need to add nxp,p3t1085 ? AFAICT people would need
> > special hardware, and then would have to patch their dts anyway.
> >
> > I'd propose not to include these in -cip, as we could test them in the
> > test farm, and it is just for testing anyway.
Since these patches are necessary for the working of the ICs connected to the board's I3C bus,
I have no problem applying nxp,p3t1085 patches.
Additionally, the contents of these patches also appear to be fine.
>
> Just FYI for testing on RZ/G3E I used this series + [0] + configs i3c related
> enable.
Thanks for your testing.
>
> >
> > I had some minor comments, but those should not block the merge.
> >
> > Reviewed-by: Pavel Machek <pavel@nabladev.com>
> >
> > I can apply the series after 6.12 version, if it passes testing and
> > there are no other comments.
Looks good to me too.
Reviewed-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.x90@mail.toshiba>
> >
> > Best regards,
> > Pavel
> > --
> > In cooperation with Nabla.
>
> Kind Regards,
> Tommaso
>
> [0]
> https://patchwork.kernel.org/project/linux-renesas-soc/patch/9d1cf2cdb1c11f
> 24378404142e4c8aff680c6961.1763638659.git.tommaso.merciai.xr@bp.renesas
> .com/
Best regards,
Nobuhiro
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [cip-dev] [PATCH 6.1.y-cip 04/22] i3c: master: Add basic driver for the Renesas I3C controller
2026-01-09 11:58 ` Tommaso Merciai
@ 2026-01-14 11:43 ` Pavel Machek
0 siblings, 0 replies; 34+ messages in thread
From: Pavel Machek @ 2026-01-14 11:43 UTC (permalink / raw)
To: tommaso.merciai.xr
Cc: Pavel Machek, cip-dev, Nobuhiro Iwamatsu, Biju Das, Lad Prabhakar,
tomm.merciai
[-- Attachment #1: Type: text/plain, Size: 2179 bytes --]
Hi!
> > > +static int renesas_i3c_priv_xfers(struct i3c_dev_desc *dev, struct i3c_priv_xfer *i3c_xfers,
> > > + int i3c_nxfers)
> > > +{
> > > + struct i3c_master_controller *m = i3c_dev_get_master(dev);
> > > + struct renesas_i3c *i3c = to_renesas_i3c(m);
> > > + struct renesas_i3c_i2c_dev_data *data = i3c_dev_get_master_data(dev);
> > > + struct renesas_i3c_xfer *xfer;
> > > + int i;
> > > +
> > > + /* Enable I3C bus. */
> > > + renesas_i3c_bus_enable(m, true);
> > > +
> > > + xfer = renesas_i3c_alloc_xfer(i3c, 1);
> > > + if (!xfer)
> > > + return -ENOMEM;
> >
> > ...where is xfer freed?
>
> Please correct me if I'm wrong but xfer is freed at the end of
> renesas_i3c_send_ccc_cmd()
Can you check the code again? It looked to me like ccc_cmd() does its
own allocation, and frees it. priv_xfers() does allocation, but does
not free it, otherwise being similar to ccc_cmd().
> > > + ret = devm_add_action_or_reset(&pdev->dev, renesas_i3c_reset_control_assert,
> > > + i3c->tresetn);
> > > + if (ret)
> > > + return ret;
> > > +
> > > + ret = devm_add_action_or_reset(&pdev->dev, renesas_i3c_reset_control_assert,
> > > + i3c->presetn);
> > > + if (ret)
> > > + return ret;
> >
> > This is wrong, AFAICT. If return happens at marked line, we'll leave
> > tresetn asserted.
>
> Ouch, you are right!
> This should be:
>
> ret = reset_control_deassert(i3c->tresetn);
> if (ret)
> return ret;
>
> ret = reset_control_deassert(i3c->presetn);
> if (ret) {
> reset_control_assert(i3c->tresetn);
> return ret;
> }
>
> As I've introduce these calls because of missing
>
> devm_reset_control_get_optional_exclusive_deasserted()
Yeah, and then we would need to do two more asserts when the devm_
setup fails.
Perhaps backporting
devm_reset_control_get_optional_exclusive_deasserted() would be best?
> Should I fix in v2? Or you can take of this while applying?
> Thanks.
I won't do fixing this. I'll likely apply patch with known problems,
and will expect you to fix it up in follow up patches.
Best regards,
Pavel
--
In cooperation with Nabla.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 6.1.y-cip 04/22] i3c: master: Add basic driver for the Renesas I3C controller
2026-01-08 9:28 ` [PATCH 6.1.y-cip 04/22] i3c: master: Add basic driver for the Renesas I3C controller Tommaso Merciai
2026-01-09 10:22 ` [cip-dev] " Pavel Machek
@ 2026-01-14 11:53 ` Pavel Machek
1 sibling, 0 replies; 34+ messages in thread
From: Pavel Machek @ 2026-01-14 11:53 UTC (permalink / raw)
To: Tommaso Merciai
Cc: cip-dev, Nobuhiro Iwamatsu, Biju Das, Lad Prabhakar, tomm.merciai
[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]
Hi!
I see incosistency here: ccc_cmd() does kfree(), priv_xfers does not;
and I don't see who does free xfer in case of priv_xfers. I summarized
functions below to point out the memory leak.
If I'm misunderstanding the code, please point out where xfer is freed
in renesas_i3c_priv_xfers().
Best regards,
Pavel
> +++ b/drivers/i3c/master/renesas-i3c.c
> +static int renesas_i3c_send_ccc_cmd(struct i3c_master_controller *m,
> + struct i3c_ccc_cmd *ccc)
> +{
...
> + struct renesas_i3c_xfer *xfer;
...
> + xfer = renesas_i3c_alloc_xfer(i3c, 1);
> + if (!xfer)
> + return -ENOMEM;
...
> + renesas_i3c_wait_xfer(i3c, xfer);
...
> + kfree(xfer);
> +
> + return ret;
> +}
> +
> +static int renesas_i3c_priv_xfers(struct i3c_dev_desc *dev, struct i3c_priv_xfer *i3c_xfers,
> + int i3c_nxfers)
> +{
...
> + struct renesas_i3c_xfer *xfer;
...
> + xfer = renesas_i3c_alloc_xfer(i3c, 1);
> + if (!xfer)
> + return -ENOMEM;
> +
> + init_completion(&xfer->comp);
> +
> + for (i = 0; i < i3c_nxfers; i++) {
...
> + renesas_i3c_wait_xfer(i3c, xfer);
> + }
> +
> + return 0;
> +}
--
In cooperation with Nabla.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [cip-dev] [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E
2026-01-13 5:43 ` nobuhiro.iwamatsu.x90
@ 2026-01-15 8:50 ` Pavel Machek
0 siblings, 0 replies; 34+ messages in thread
From: Pavel Machek @ 2026-01-15 8:50 UTC (permalink / raw)
To: nobuhiro.iwamatsu.x90
Cc: tommaso.merciai.xr, pavel, cip-dev, biju.das.jz,
prabhakar.mahadev-lad.rj, tomm.merciai
[-- Attachment #1: Type: text/plain, Size: 509 bytes --]
Hi!
> > > I had some minor comments, but those should not block the merge.
> > >
> > > Reviewed-by: Pavel Machek <pavel@nabladev.com>
> > >
> > > I can apply the series after 6.12 version, if it passes testing and
> > > there are no other comments.
>
> Looks good to me too.
> Reviewed-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.x90@mail.toshiba>
Thanks for review. I applied patches up-to "Add the I3C node to RZ/G3E
SoC DTSI."
Best regards,
Pavel
--
In cooperation with Nabla.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 34+ messages in thread
end of thread, other threads:[~2026-01-15 8:51 UTC | newest]
Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-08 9:28 [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 01/22] bitops: add generic parity calculation for u8 Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 02/22] dt-bindings: i3c: Add Renesas I3C controller Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 03/22] i3c: controllers do not need to depend on I3C Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 04/22] i3c: master: Add basic driver for the Renesas I3C controller Tommaso Merciai
2026-01-09 10:22 ` [cip-dev] " Pavel Machek
2026-01-09 11:58 ` Tommaso Merciai
2026-01-14 11:43 ` Pavel Machek
2026-01-14 11:53 ` Pavel Machek
2026-01-08 9:28 ` [PATCH 6.1.y-cip 05/22] i3c: Document I3C_ADDR_SLOT_EXT_STATUS_MASK Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 06/22] i3c: Remove the const qualifier from i2c_msg pointer in i2c_xfers API Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 07/22] i3c: Standardize defines for specification parameters Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 08/22] i3c: Add more parameters for controllers to the header Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 09/22] i3c: master: Add helpers for DMA mapping and bounce buffer handling Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 10/22] i3c: document i3c_xfers Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 11/22] i3c: master: Add inline i3c_readl_fifo() and i3c_writel_fifo() Tommaso Merciai
2026-01-09 10:26 ` [cip-dev] " Pavel Machek
2026-01-08 9:28 ` [PATCH 6.1.y-cip 12/22] i3c: Correct the macro module_i3c_i2c_driver Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 13/22] i3c: export SETDASA method Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 14/22] clk: renesas: r9a09g047: Add I3C0 clocks and resets Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 15/22] arm64: dts: renesas: r9a09g047: Add I3C node Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 16/22] dt-bindings: hwmon: ti,tmp108: document V+ supply, add short description Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 17/22] dt-bindings: hwmon: ti,tmp108: Add nxp,p3t1085 compatible string Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 18/22] hwmon: (tmp108) Add NXP p3t1085 support Tommaso Merciai
2026-01-09 10:29 ` [cip-dev] " Pavel Machek
2026-01-08 9:28 ` [PATCH 6.1.y-cip 19/22] hwmon: (tmp108) Add helper function tmp108_common_probe() to prepare I3C support Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 20/22] hwmon: (tmp108) Add support for I3C device Tommaso Merciai
2026-01-09 10:32 ` [cip-dev] " Pavel Machek
2026-01-08 9:28 ` [PATCH 6.1.y-cip 21/22] hwmon: (tmp108) Do not fail in I3C probe when I3C regmap is a module Tommaso Merciai
2026-01-08 9:28 ` [PATCH 6.1.y-cip 22/22] hwmon: (tmp108) Add basic regulator support Tommaso Merciai
2026-01-09 10:39 ` [cip-dev] [PATCH 6.1.y-cip 00/22] Add I3C support for RZ/G3E Pavel Machek
2026-01-09 12:08 ` Tommaso Merciai
2026-01-13 5:43 ` nobuhiro.iwamatsu.x90
2026-01-15 8:50 ` Pavel Machek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox