All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH u-boot 0/8] ufs: Sony Yoshino/Tama (MSM8998 / SDM845) UFS bring-up
@ 2026-10-04 19:22 ` Petr Hodina via B4 Relay
  0 siblings, 0 replies; 26+ messages in thread
From: Petr Hodina @ 2026-10-04 19:22 UTC (permalink / raw)
  To: u-boot, Sumit Garg, u-boot-qcom
  Cc: Neil Armstrong, Bhupesh Sharma, Neha Malcom Francis,
	Casey Connolly, Tom Rini, Angelo Gioacchino Del Regno,
	David Heidelberg, Marek Vasut, Padmarao Begari, Macpaul Lin,
	Julien Stephan, Kunihiko Hayashi, Shawn Lin, Jared McArthur,
	Michal Simek, Udit Kumar, Igor Belwon, Tuyen Dang, Alexey Charkov,
	Balaji Selvanathan, Simon Glass, Aswin Murugan, Bin Meng,
	Marek Vasut, David Lechner, Ilias Apalodimas, Kory Maincent,
	Peng Fan, Kuan-Wei Chiu, Janne Grunau, Julien Masson, Raymond Mao,
	Quentin Schulz, Philip Molloy, Jerome Forissier, Markus Niebel,
	Petr Pavlata, Petr Hodina

This series brings up UFS on the Sony Xperia "Yoshino" (MSM8998) and
"Tama" (SDM845) families.

The work falls into four layers:

1. A small refactor that extends ufs_dev_desc with the product revision
   string and the UFS spec version (patch 1). No behaviour change.

2. A device-quirk infrastructure (patches 2-4) that lets us match
   per-device link / power-mode workarounds against manufacturer id,
   model and fw revision:

     - patch 2: generic ufs_fixups[] table and ufshcd_fixup_dev_quirks(),
       called from ufs_start() before power-mode negotiation
     - patch 3: UFS_DEVICE_QUIRK_EXTEND_SYNC_LENGTH for SK Hynix devices
       that need PA_TxHsG{1,2,3}SyncLength programmed to 0x48
     - patch 4: CONFIG_UFS_RESTRICT_TX_LANES build-time knob for boards
       with only a single reliable TX lane. Defaults to N so nothing
       else is affected.

3. The NO_PURGE quirk for devices that brick if issued PURGE / UNMAP
   (patches 5-7):

     - patch 5: refuse erase/UNMAP in the SCSI uclass when NO_PURGE
       is set on the underlying UFS device
     - patch 6: print device identification (vendor / model / rev /
       spec version) at probe so quirk matching is observable on the
       console
     - patch 7: a platform gate that auto-enables NO_PURGE on Sony
       Yoshino/Tama compatibles because per-UFS-chip rows can't see
       blank string descriptors on some affected boards.

4. Akatsuki DTS enablement (patch 8): re-enable the UFS controller node.

Background on NO_PURGE: on the affected Sony platforms the SCSI ERASE /
UNMAP / WRITE_BUFFER PURGE operation overwrites the bootloader region
and permanently bricks the device.

Based on the linux patches by Angelo:
https://github.com/kholk/kernel/commit/2e7a9ee1c91a016baa0b826a7752ec45663a0561

Tested on Sony XZ3 (akatsuki, SDM845) where U-Boot enumerates UFS LUN0
and exposes the GPT.

```
UFS Device Information (ufshc@1d84000)
  Manufacturer:    Samsung (0x01ce)
  Model:           (unset)
  Revision:        (unset)
  Spec Version:    0x0210
  Gear  - RX: 3, TX: 3
  Lane  - RX: 2, TX: 2
  Power - RX: 1, TX: 1, HS rate: 2
  Device Quirks:   0x00000001
  NO_PURGE Quirk:  Yes

...

=> scsi erase 0 1

scsi erase: device 0 block # 0, count 1 ... scsi_erase: erase not supported on this device
0 blocks erased: ERROR
=> 
```

Signed-off-by: Petr Hodina <petr.hodina@protonmail.com>
---
Petr Hodina (8):
      ufs: read product revision and spec version into ufs_dev_desc
      ufs: add device-quirk infrastructure
      ufs: program extended HS sync length for SK Hynix devices
      ufs: add CONFIG_UFS_RESTRICT_TX_LANES
      scsi: ufs: refuse erase/UNMAP on NO_PURGE devices
      ufs: print device information at probe
      ufs: gate NO_PURGE on Sony Yoshino/Tama platform compatible
      arm: dts: qcom: akatsuki: re-enable the UFS controller node

 MAINTAINERS                                        |   1 +
 .../sdm845-sony-xperia-tama-akatsuki-u-boot.dtsi   |   9 +
 drivers/scsi/scsi.c                                |   5 +
 drivers/ufs/Kconfig                                |  14 ++
 drivers/ufs/ufs-uclass.c                           | 197 +++++++++++++++++++++
 drivers/ufs/ufs.h                                  |   7 +
 drivers/ufs/ufs_quirks.h                           |  94 ++++++++++
 drivers/ufs/unipro.h                               |   3 +
 include/scsi.h                                     |   5 +
 9 files changed, 335 insertions(+)
---
base-commit: ece349ade2973e220f524ce59e59711cc919263f
change-id: 20260611-b4-ufs-sony-794325f6f4af

Best regards,
--  
Petr Hodina <petr.hodina@protonmail.com>


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

end of thread, other threads:[~2026-10-06 14:33 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-04 19:22 [PATCH u-boot 0/8] ufs: Sony Yoshino/Tama (MSM8998 / SDM845) UFS bring-up Petr Hodina
2026-10-04 19:22 ` Petr Hodina via B4 Relay
2026-10-04 19:22 ` [PATCH u-boot 1/8] ufs: read product revision and spec version into ufs_dev_desc Petr Hodina
2026-10-04 19:22   ` Petr Hodina via B4 Relay
2026-10-04 19:22 ` [PATCH u-boot 2/8] ufs: add device-quirk infrastructure Petr Hodina
2026-10-04 19:22   ` Petr Hodina via B4 Relay
2026-10-05  9:40   ` Neil Armstrong
2026-10-06 13:23     ` phodina
2026-10-06 13:31       ` Neil Armstrong
2026-10-06 13:39         ` phodina
2026-10-04 19:22 ` [PATCH u-boot 3/8] ufs: program extended HS sync length for SK Hynix devices Petr Hodina
2026-10-04 19:22   ` Petr Hodina via B4 Relay
2026-10-04 19:22 ` [PATCH u-boot 4/8] ufs: add CONFIG_UFS_RESTRICT_TX_LANES Petr Hodina
2026-10-04 19:22   ` Petr Hodina via B4 Relay
2026-10-05  9:41   ` Neil Armstrong
2026-10-04 19:22 ` [PATCH u-boot 5/8] scsi: ufs: refuse erase/UNMAP on NO_PURGE devices Petr Hodina
2026-10-04 19:22   ` Petr Hodina via B4 Relay
2026-10-05  9:37   ` Neil Armstrong
2026-10-04 19:22 ` [PATCH u-boot 6/8] ufs: print device information at probe Petr Hodina
2026-10-04 19:22   ` Petr Hodina via B4 Relay
2026-10-05  9:36   ` Neil Armstrong
2026-10-04 19:22 ` [PATCH u-boot 7/8] ufs: gate NO_PURGE on Sony Yoshino/Tama platform compatible Petr Hodina
2026-10-04 19:22   ` Petr Hodina via B4 Relay
2026-10-04 19:22 ` [PATCH u-boot 8/8] arm: dts: qcom: akatsuki: re-enable the UFS controller node Petr Hodina
2026-10-04 19:22   ` Petr Hodina via B4 Relay
2026-10-04 19:30 ` [PATCH u-boot 0/8] ufs: Sony Yoshino/Tama (MSM8998 / SDM845) UFS bring-up David Heidelberg

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.