Skip to content

Add support for UFS driver #93528

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

neeliajay
Copy link

This pull request re-opens the PR: #87201

  • UFS (Universal Flash Storage) support to Zephyr
  • support for SCSI, UFS subsystems
  • AMD Versal Gen 2 UFSHC (UFS Host Controller) driver
  • UFS disk driver
  • SCSI, UFS testing
  • doc for UFSHC (UFS Host Controller) peripheral

Ajay Neeli added 10 commits May 5, 2025 17:39
Introduce core components of the SCSI subsystem, including support for
device initialization, command dispatching, and basic I/O operations.

Provide foundation for future integration with UFS and other SCSI-based
devices.

Signed-off-by: Ajay Neeli <ajay.neeli@amd.com>
Introduce initial support for the UFS subsystem in Zephyr, providing
core infrastructure to enable UFS device functionality.

This lays the foundation for further enhancements to the UFS
subsystem in Zephyr.

Key features introduced in this patch:
 - UFS controller initialization support.
 - Handling of SCSI command transfer requests.
 - UFS device configuration support.
 - Interrupt-driven UFS operations.

Limitations:
 - Does not support task management functionality.
 - Does not include RPMB (Replay Protected Memory Block) support.
 - Asynchronous transfers are not supported.

Signed-off-by: Ajay Neeli <ajay.neeli@amd.com>
Add amd,versal2-ufs.yaml for AMD Versal Gen 2 UFS Host Controller.
Add ufs-common.yaml for common properties of UFS Host Controllers.

Signed-off-by: Ajay Neeli <ajay.neeli@amd.com>
Add support for the UFS Host Controller (UFSHC) driver on the AMD Versal
Gen 2 platform.

The implementation includes necessary configurations for M-PHY, RMMI,
and Unipro, as well as programming of vendor-specific registers during
controller initialization.

Signed-off-by: Ajay Neeli <ajay.neeli@amd.com>
Add device tree binding for UFS disks in Zephyr, enabling interaction
with UFS storage via the Zephyr disk subsystem.

This binding ensures correct handling of UFS devices, including support
for multiple LUNs, enabling filesystem operations in Zephyr.

Key properties:
 - lun: Defines the Logical Unit Number (LUN) for the UFS disk,
   defaulting to 0. This is essential for systems with multiple LUNs.
 - disk-name: A required string specifying the UFS disk's name for
   proper registration in the disk subsystem.

Signed-off-by: Ajay Neeli <ajay.neeli@amd.com>
Add UFS disk driver, enabling interaction with UFS storage devices
via the filesystem interface.

It recognizes Logical Unit Numbers (LUNs) as separate disks and presents
UFS devices as block devices for standard filesystem operations.

This driver ensures UFS devices are recognized and usable within
Zephyr’s filesystem.

Key features:
 - Initialization: Initializes the UFS disk using LUN and disk-name
   properties from the device tree.
 - Disk Operations: Registers essential operations, including  read,
   write, and ioctl.

Signed-off-by: Ajay Neeli <ajay.neeli@amd.com>
Add a test for the UFS subsystem to verify the functionality of UFS
stack implementation.

The test performs basic read operations on a UFS card after
initialization.

Test components:
 - Init: Verifies the UFS host controller can detect card presence and
   initialize the UFS subsystem.
 - Configuration: Ensures that the UFS stack reports a valid
   configuration for the UFS card after initialization.

Signed-off-by: Ajay Neeli <ajay.neeli@amd.com>
Add a test to verify the SCSI subsystem's functionality with UFS
devices.

Test Components:
 - Init Test: Verifies SCSI device initialization via the UFS host
   controller.
 - IOCTL Test: Checks SCSI IOCTL operations using SG_IO.
 - R/W Test: Confirms data can be written to and read from the UFS
   device without errors.

Requirements:
 - UFS device must be connected.
 - Write operations are disabled by default (can be enabled via
   configuration).

Signed-off-by: Ajay Neeli <ajay.neeli@amd.com>
Extend disk_access test suite to support UFS disk driver.

Signed-off-by: Ajay Neeli <ajay.neeli@amd.com>
Add documentation for the UFS Host Controller (UFSHC) driver, which
provides a generic interface for interacting with UFS host controller
devices. It is used by the UFS subsystem to manage UFS-based storage
devices.

The documentation covers key aspects of the UFSHC, including
initialization, transfer request handling, query requests, and
configuration options, helping developers understand how to integrate
and work with the UFS subsystem effectively.

Signed-off-by: Ajay Neeli <ajay.neeli@amd.com>
@neeliajay
Copy link
Author

#87201 - Reopening the closed PR

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants