* [PATCH v2 1/4] i3c: dw: make resets optional in probe
2026-07-09 9:12 [PATCH v2 0/4] i3c: dw: fix slave device setup and probe issues Pranav Tilak
@ 2026-07-09 9:12 ` Pranav Tilak
2026-07-09 9:12 ` [PATCH v2 2/4] cmd: i3c: fix list and current needing pre-selected controller Pranav Tilak
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Pranav Tilak @ 2026-07-09 9:12 UTC (permalink / raw)
To: u-boot, michal.simek; +Cc: git, padmarao.begari, Pranav Tilak, Dinesh, Tom Rini
Treat -ENOENT and -ENOTSUPP from reset_get_bulk() as non-fatal to
support platforms where no resets are defined in the DTS. The resets
property is not yet documented in the DT binding.
Fixes: 1009c96f1590 ("drivers: i3c: Add driver for MIPI DWI3C")
Signed-off-by: Pranav Tilak <pranav.vinaytilak@amd.com>
---
drivers/i3c/master/dw-i3c-master.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
index 0c4af7e528a..c6ce54a1d3b 100644
--- a/drivers/i3c/master/dw-i3c-master.c
+++ b/drivers/i3c/master/dw-i3c-master.c
@@ -972,7 +972,7 @@ static int dw_i3c_probe(struct udevice *dev)
}
ret = reset_get_bulk(dev, &master->resets);
- if (ret) {
+ if (ret && ret != -ENOTSUPP && ret != -ENOENT) {
dev_err(dev, "Can't get reset: %d\n", ret);
return ret;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH v2 2/4] cmd: i3c: fix list and current needing pre-selected controller
2026-07-09 9:12 [PATCH v2 0/4] i3c: dw: fix slave device setup and probe issues Pranav Tilak
2026-07-09 9:12 ` [PATCH v2 1/4] i3c: dw: make resets optional in probe Pranav Tilak
@ 2026-07-09 9:12 ` Pranav Tilak
2026-07-09 9:12 ` [PATCH v2 3/4] configs: versal2: enable I3C support Pranav Tilak
2026-07-09 9:12 ` [PATCH v2 4/4] i3c: dw: fix slave device setup after DAA Pranav Tilak
3 siblings, 0 replies; 5+ messages in thread
From: Pranav Tilak @ 2026-07-09 9:12 UTC (permalink / raw)
To: u-boot, michal.simek
Cc: git, padmarao.begari, Pranav Tilak, Dinesh Maniyam, Tom Rini
The !currdev guard in do_i3c() was placed before the list and current
handlers, causing both to fail when no controller is pre-selected.
Move the guard to only protect device_list, write and read which
actually need a controller.
Fixes: b875409da737 ("cmd: Add i3c command support.")
Signed-off-by: Pranav Tilak <pranav.vinaytilak@amd.com>
Reviewed-by: Dinesh Maniyam <dinesh.maniyam@altera.com>
---
cmd/i3c.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/cmd/i3c.c b/cmd/i3c.c
index 08957f4d447..ba99a937990 100644
--- a/cmd/i3c.c
+++ b/cmd/i3c.c
@@ -240,16 +240,17 @@ static int do_i3c(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
if (!is_i3c_subcommand(subcmd))
return handle_i3c_select(subcmd);
+ if (!strcmp(subcmd, "list"))
+ return handle_i3c_list();
+ else if (!strcmp(subcmd, "current"))
+ return handle_i3c_current();
+
if (!currdev) {
printf("i3c: No I3C controller selected\n");
return CMD_RET_FAILURE;
}
- if (!strcmp(subcmd, "list"))
- return handle_i3c_list();
- else if (!strcmp(subcmd, "current"))
- return handle_i3c_current();
- else if (!strcmp(subcmd, "device_list"))
+ if (!strcmp(subcmd, "device_list"))
return handle_i3c_device_list();
else if (!strcmp(subcmd, "write"))
return handle_i3c_write(argc, argv);
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH v2 3/4] configs: versal2: enable I3C support
2026-07-09 9:12 [PATCH v2 0/4] i3c: dw: fix slave device setup and probe issues Pranav Tilak
2026-07-09 9:12 ` [PATCH v2 1/4] i3c: dw: make resets optional in probe Pranav Tilak
2026-07-09 9:12 ` [PATCH v2 2/4] cmd: i3c: fix list and current needing pre-selected controller Pranav Tilak
@ 2026-07-09 9:12 ` Pranav Tilak
2026-07-09 9:12 ` [PATCH v2 4/4] i3c: dw: fix slave device setup after DAA Pranav Tilak
3 siblings, 0 replies; 5+ messages in thread
From: Pranav Tilak @ 2026-07-09 9:12 UTC (permalink / raw)
To: u-boot, michal.simek; +Cc: git, padmarao.begari, Pranav Tilak, Tom Rini
Enable I3C controller driver and command support for Versal Gen 2 by
adding CONFIG_CMD_I3C, CONFIG_I3C and CONFIG_DW_I3C_MASTER.
Signed-off-by: Pranav Tilak <pranav.vinaytilak@amd.com>
Acked-by: Michal Simek <michal.simek@amd.com>
---
configs/amd_versal2_virt_defconfig | 3 +++
1 file changed, 3 insertions(+)
diff --git a/configs/amd_versal2_virt_defconfig b/configs/amd_versal2_virt_defconfig
index 00ccc81a83b..ea02b0c011b 100644
--- a/configs/amd_versal2_virt_defconfig
+++ b/configs/amd_versal2_virt_defconfig
@@ -46,6 +46,7 @@ CONFIG_CMD_CLK=y
CONFIG_CMD_DFU=y
CONFIG_CMD_GPIO=y
CONFIG_CMD_I2C=y
+CONFIG_CMD_I3C=y
CONFIG_CMD_LSBLK=y
CONFIG_CMD_MMC=y
CONFIG_MMC_SPEED_MODE_SET=y
@@ -103,6 +104,8 @@ CONFIG_SYS_I2C_CADENCE=y
CONFIG_I2C_MUX=y
CONFIG_I2C_MUX_PCA9541=y
CONFIG_I2C_MUX_PCA954x=y
+CONFIG_I3C=y
+CONFIG_DW_I3C_MASTER=y
CONFIG_DM_MAILBOX=y
CONFIG_ZYNQMP_IPI=y
CONFIG_MISC=y
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 4/4] i3c: dw: fix slave device setup after DAA
2026-07-09 9:12 [PATCH v2 0/4] i3c: dw: fix slave device setup and probe issues Pranav Tilak
` (2 preceding siblings ...)
2026-07-09 9:12 ` [PATCH v2 3/4] configs: versal2: enable I3C support Pranav Tilak
@ 2026-07-09 9:12 ` Pranav Tilak
3 siblings, 0 replies; 5+ messages in thread
From: Pranav Tilak @ 2026-07-09 9:12 UTC (permalink / raw)
To: u-boot, michal.simek; +Cc: git, padmarao.begari, Pranav Tilak, Dinesh, Tom Rini
i3c_master_add_i3c_dev_locked() incorrectly set master->this to the
newly discovered slave device, causing i3c_master_attach_i3c_dev()
to skip the attach_i3c_dev() callback. As a result the slave device
never got its master_priv (DAT slot index) allocated, free_pos was
never updated, and the DAT entry was never written.
Fix by removing the incorrect master->this assignment. Store the
slave descriptor directly in master->i3cdev[pos] inside
dw_i3c_master_attach_i3c_dev() where the DAT slot index is already
known. Also check the return value of i3c_master_add_i3c_dev_locked()
and skip num_i3cdevs increment on failure, fixing dummy devices shown
when no slaves are present on the bus.
Fixes: 1009c96f1590 ("drivers: i3c: Add driver for MIPI DWI3C")
Signed-off-by: Pranav Tilak <pranav.vinaytilak@amd.com>
---
drivers/i3c/master.c | 1 -
drivers/i3c/master/dw-i3c-master.c | 5 +++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
index 019167a2dc5..1cf1ffd99cc 100644
--- a/drivers/i3c/master.c
+++ b/drivers/i3c/master.c
@@ -1443,7 +1443,6 @@ int i3c_master_add_i3c_dev_locked(struct i3c_master_controller *master,
if (IS_ERR(newdev))
return PTR_ERR(newdev);
- master->this = newdev;
ret = i3c_master_attach_i3c_dev(master, newdev);
if (ret)
goto err_free_dev;
diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
index c6ce54a1d3b..25933adf010 100644
--- a/drivers/i3c/master/dw-i3c-master.c
+++ b/drivers/i3c/master/dw-i3c-master.c
@@ -671,8 +671,8 @@ static int dw_i3c_master_daa(struct i3c_master_controller *m)
for (pos = 0; pos < master->maxdevs; pos++) {
if (newdevs & BIT(pos)) {
- i3c_master_add_i3c_dev_locked(m, master->addrs[pos]);
- master->i3cdev[pos] = m->this;
+ if (i3c_master_add_i3c_dev_locked(m, master->addrs[pos]))
+ continue;
master->num_i3cdevs++;
}
}
@@ -806,6 +806,7 @@ static int dw_i3c_master_attach_i3c_dev(struct i3c_dev_desc *dev)
master->addrs[pos] = dev->info.dyn_addr ? : dev->info.static_addr;
master->free_pos &= ~BIT(pos);
i3c_dev_set_master_data(dev, data);
+ master->i3cdev[pos] = dev;
writel(DEV_ADDR_TABLE_DYNAMIC_ADDR(master->addrs[pos]),
master->regs +
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread