[PATCH v2 0/9] MT8195: add ufs support

Julien Stephan jstephan at baylibre.com
Wed Mar 18 17:50:52 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>
---
Changes in v2:
- Add dependency on [1] that rename the genio defconfig
- rename mt8395_evk_ufs_defconfig to the new name
  mt8395_genio_1200_evk_ufs_defconfig
- introduce mt8195.config to avoid duplicating mt8395_genio_1200_evk defconfig
- Added new reviewed-by by tag
- add missing clk_enable in ufs driver and fix error path
- remove pmic commits from this series. As suggested by David, this
  driver need some rework and deserve it's own series. UFS still
  works, since previous bootloader stage is already doing some
  initialization
- Link to v1: https://lore.kernel.org/r/20260317-mt8195-add-ufs-support-v1-0-7d731ec438ae@baylibre.com

[1]:  https://patchwork.ozlabs.org/project/uboot/patch/20260318-rename-genio-defconfigs-v1-1-1440312442f0@baylibre.com/

---
Julien Stephan (9):
      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_genio_1200_evk_ufs

 board/mediatek/MAINTAINERS                  |   4 +-
 configs/mt8195.config                       |  24 ++++++
 configs/mt8395_genio_1200_evk_defconfig     |  26 +-----
 configs/mt8395_genio_1200_evk_ufs_defconfig |  13 +++
 drivers/phy/phy-mtk-ufs.c                   | 128 ++++++++++++----------------
 drivers/ufs/ufs-mediatek.c                  |  40 ++++++---
 drivers/ufs/ufs-mediatek.h                  |   2 +-
 7 files changed, 123 insertions(+), 114 deletions(-)
---
base-commit: 142c805d470cd02470146d6d70aa9c522d4da16c
change-id: 20260311-mt8195-add-ufs-support-535ebedbb323
prerequisite-message-id: <20260318-rename-genio-defconfigs-v1-1-1440312442f0 at baylibre.com>
prerequisite-patch-id: 76f64e540256592f97d1b274e6072dde36fee2f9

Best regards,
-- 
Julien Stephan <jstephan at baylibre.com>



More information about the U-Boot mailing list