[PATCH 00/11] MT8195: add ufs support
Julien Stephan
jstephan at baylibre.com
Tue Mar 17 15:24:18 CET 2026
This series adds ufs support MT8195.
I also include in this series some cleanup on phy-mtk-ufs.c phy driver
and ufs-mediatek.c mediatek ufs driver, and pmic support for MT8195.
UFS boot has been tested on a MT8395_EVK board.
To enable ufs boot, we first need to erase mmc partitions.
The configs in config mt8395_evk_ufs are the minimum configs needed to
enable UFS. This has been validating with the following commands on
u-boot (extra configs needed for non generic configuration):
=> scsi reset
Reset SCSI
scanning bus for devices...
mediatek-ufshci ufshci at 11270000: Failed to get PHY: -19.
mediatek-ufshci ufshci at 11270000: [RX, TX]: gear=[3, 3], lane[1, 1], pwr[FAST MODE, FAST MODE], rate = 2
Device 0: (0:0) Vendor: MICRON Prod.: MT064GASAO2U21 Rev: 0203
Type: Hard Disk
Capacity: 4.0 MB = 0.0 GB (1024 x 4096)
Device 1: (0:1) Vendor: MICRON Prod.: MT064GASAO2U21 Rev: 0203
Type: Hard Disk
Capacity: 4.0 MB = 0.0 GB (1024 x 4096)
Device 2: (0:2) Vendor: MICRON Prod.: MT064GASAO2U21 Rev: 0203
Type: Hard Disk
Capacity: 61016.0 MB = 59.5 GB (15620096 x 4096)
=> part list scsi 2
Partition Map for scsi device 2 -- Partition Type: EFI
Part Start LBA End LBA Name
Attributes
Type GUID
Partition GUID
1 0x00000080 0x0000047f "bootloaders"
attrs: 0x0000000000000000
type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
guid: 1614eda4-a234-4789-a6e8-328dcb7c46e8
2 0x00000480 0x0000087f "bootloaders_b"
attrs: 0x0000000000000000
type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
guid: 20435df4-5b1e-4361-8157-6ce997561c6a
3 0x00000880 0x0000287f "firmware"
attrs: 0x0000000000000000
type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
guid: 24dad941-6425-492e-9d1c-118a52af67ba
4 0x00002880 0x0000487f "firmware_b"
attrs: 0x0000000000000000
type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
guid: 547e79be-8019-45a9-8d28-b127607a5019
5 0x00004880 0x000048ff "dramk"
attrs: 0x0000000000000000
type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
guid: d267a4ba-68b3-415d-92d5-f977848c8c6e
6 0x00004900 0x000049ff "misc"
attrs: 0x0000000000000000
type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
guid: ce1e2472-6342-4220-9f8c-b9bfac4827cf
7 0x00004a00 0x000069ff "bootassets"
attrs: 0x0000000000000000
type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
guid: 60581d1e-088a-4137-8be2-f3d2ee6cd187
8 0x00006a00 0x0000cdff "EFI_system_partition"
attrs: 0x0000000000000000
type: c12a7328-f81f-11d2-ba4b-00a0c93ec93b
guid: 08ddd30a-cbce-49ae-b5c1-ded897018d2e
9 0x0000ce00 0x0000edff "kernel"
attrs: 0x0000000000000000
type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
guid: 0334e60c-ce99-4652-a8f0-1088b4716b65
10 0x0000ee00 0x00068587 "rootfs"
attrs: 0x0000000000000004
type: b921b045-1df0-41c3-af44-4c6f280d3fae
guid: 6244fcea-b124-44f5-94a4-c1c38946bd90
=> scsi dev 2
Device 2: (0:2) Vendor: MICRON Prod.: MT064GASAO2U21 Rev: 0203
Type: Hard Disk
Capacity: 61016.0 MB = 59.5 GB (15620096 x 4096)
... is now current device
=> load scsi 2:a ${scriptaddr} /boot/fitImage
21005248 bytes read in 47 ms (426.2 MiB/s)
=> source ${scriptaddr}
Signed-off-by: Julien Stephan <jstephan at baylibre.com>
---
Julien Stephan (11):
power: pmic: mtk-pwrap: add MT8195 support
power: pmic: mtk-pwrap: use tabs for alignment
drivers: phy: phy-mtk-ufs: cleanup headers
drivers: phy: phy-mtk-ufs: use tab to indent defines
drivers: phy: phy-mtk-ufs: use clk_bulk functions
drivers: phy: phy-mtk-ufs: disable clk in power_off
drivers: phy: phy-mtk-ufs: do not alloc priv with priv_auto
drivers: ufs: ufs-mediatek: fix phy handling
drivers: ufs: ufs-mediatek: implement clocking
drivers: ufs: ufs-mediatek: add MT8195 compatible
configs: add new defconfig for mt8395_evk_ufs
board/mediatek/MAINTAINERS | 3 +-
configs/mt8395_evk_ufs_defconfig | 33 ++++++++++
drivers/phy/phy-mtk-ufs.c | 128 ++++++++++++++++-----------------------
drivers/power/pmic/mtk-pwrap.c | 59 +++++++++++++-----
drivers/ufs/ufs-mediatek.c | 38 ++++++++----
drivers/ufs/ufs-mediatek.h | 2 +-
6 files changed, 160 insertions(+), 103 deletions(-)
---
base-commit: d31f96cac1e25153779c44f1fe014978f9b06032
change-id: 20260311-mt8195-add-ufs-support-535ebedbb323
Best regards,
--
Julien Stephan <jstephan at baylibre.com>
More information about the U-Boot
mailing list