All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Implement some missing UFS Functionality
@ 2026-11-30  3:00 Anirudh Srinivasan
  2026-11-30  3:00 ` [PATCH 1/2] hw/ufs: Make num rx/tx lanes reported to the guest configurable Anirudh Srinivasan
  2026-11-30  3:00 ` [PATCH 2/2] hw/ufs: Add minimal model for M-PHY TX/RX FSM states Anirudh Srinivasan
  0 siblings, 2 replies; 4+ messages in thread
From: Anirudh Srinivasan @ 2026-11-30  3:00 UTC (permalink / raw)
  To: qemu-devel
  Cc: Jeuk Kim, Pierrick Bouvier, Kevin Wolf, Hanna Reitz, qemu-block,
	mps, tgamblin, Anirudh Srinivasan

This series contains 2 patches to implement missing functionality in the
UFS implementation.

Patch 1 adds a qdev property to allow configuring num_lanes reported to
the guest. Linux fails to probe the UFS controller if this value doesn't 
match a corresponding value in the DT. Patch 2 adds a minimal
implementation of M-PHY FSM states that are to do with entering
hibernation. This is needed to surpress repeated error prints in Linux
while the device is in use.

Both these patches are needed to get UFS working in Linux on the
spacemit-k3 QEMU machine, which is under review [1]. UFS works in linux
on this machine after adding the 2 patches in this series, plus this
small fix to the machine to set num-lanes for the UFS controller to the
correct alue.

diff --git a/hw/ufs/spacemit_k3_ufs.c b/hw/ufs/spacemit_k3_ufs.c
index 03a631e45f..addca022bb 100644
--- a/hw/ufs/spacemit_k3_ufs.c
+++ b/hw/ufs/spacemit_k3_ufs.c
@@ -64,6 +64,7 @@ static void spacemit_k3_ufs_realize(DeviceState *dev, Error **errp)
                        K3_UFS_VENDOR_BASE + K3_UFS_VENDOR_SIZE);
     sysbus_init_mmio(sbd, &s->container);
 
+    qdev_prop_set_uint8(DEVICE(&s->ufs), "num-lanes", 2);
     sysbus_realize(ufs_sbd, errp);
     memory_region_add_subregion(&s->container, 0,
                                 sysbus_mmio_get_region(ufs_sbd, 0));

[1] https://lore.kernel.org/qemu-riscv/20261129-spacemit_k3-v2-0-462c078463e9@oss.tenstorrent.com/

Signed-off-by: Anirudh Srinivasan <asrinivasan@oss.tenstorrent.com>
---
Anirudh Srinivasan (2):
      hw/ufs: Make num rx/tx lanes reported to the guest configurable
      hw/ufs: Add minimal model for M-PHY TX/RX FSM states

 docs/system/devices/ufs.rst | 11 ++++++++---
 hw/ufs/ufs-pci.c            |  1 +
 hw/ufs/ufs-sysbus.c         |  1 +
 hw/ufs/ufs.c                | 27 ++++++++++++++++++++++-----
 hw/ufs/ufs.h                |  2 ++
 include/block/ufs.h         | 10 ++++++++++
 6 files changed, 44 insertions(+), 8 deletions(-)
---
base-commit: 9cda597a1a3903d090e8e55e23f5b8a859da88ab
change-id: 20261129-ufs_fixes-da2a51db8b93

Best regards,
--  
Anirudh Srinivasan <asrinivasan@oss.tenstorrent.com>



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-12-02 17:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30  3:00 [PATCH 0/2] Implement some missing UFS Functionality Anirudh Srinivasan
2026-11-30  3:00 ` [PATCH 1/2] hw/ufs: Make num rx/tx lanes reported to the guest configurable Anirudh Srinivasan
2026-11-30  3:00 ` [PATCH 2/2] hw/ufs: Add minimal model for M-PHY TX/RX FSM states Anirudh Srinivasan
2026-12-02 17:24   ` Milan P. Stanić

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.