fuchsia.hardware.ufs.phy

Added: HEAD

PROTOCOLS

UfsPhy

Defined in fuchsia.hardware.ufs.phy/ufs_phy.fidl

GetProperties

Returns the PHY driver's static capabilities. The controller driver calls this once at initialization to decide which power-management features it may use. A PHY driver that does not implement this method is treated as supporting none of the optional features.

Request

<EMPTY>

Response

NameType
payload UfsPhy_GetProperties_Result

Init

Perform the UFS PHY specific initialization which happens before link startup.

Request

NameType
ufs_hci client_end:Ufshci

Response

NameType
payload UfsPhy_Init_Result

PrePowerModeChange

Perform PHY calibration and configuration prior to power mode / gear change.

Request

<EMPTY>

Response

NameType
payload UfsPhy_PrePowerModeChange_Result

SetPowerState

Transitions the PHY to state. See PowerState for the hardware preconditions of each target state.

Power States and Held Resources

Each lower power state holds a strict subset of the resources held by the state above it:

| State | Power Domains | Core Clocks & Rails | M-PHY Low-V Rail | Aux Clock | |-------------------|---------------|---------------------|------------------|-----------| | ACTIVE | ON | ON | ON | ON | | LINK_IDLE | ON | ON | ON | OFF | | HIBERNATE_SLEEP | ON | ON | OFF | OFF | | POWER_DOWN | OFF | OFF | OFF | OFF |

Allowed Transitions

  • Same state (S -> S): Always idempotent; returns ZX_OK without modifying hardware.
  • Higher power to lower power (ACTIVE -> LINK_IDLE, ACTIVE/LINK_IDLE -> HIBERNATE_SLEEP, or ACTIVE/LINK_IDLE/HIBERNATE_SLEEP -> POWER_DOWN): Allowed. Releases the additional resources not required in the target state.
  • Any lower power state to ACTIVE (LINK_IDLE/HIBERNATE_SLEEP/POWER_DOWN -> ACTIVE): Allowed. Restores all resources required for ACTIVE.
  • Lower power to a higher non-ACTIVE state (POWER_DOWN -> LINK_IDLE, POWER_DOWN -> HIBERNATE_SLEEP, or HIBERNATE_SLEEP -> LINK_IDLE): Rejected with ZX_ERR_BAD_STATE. The caller must transition to ACTIVE first.

Error Semantics

  • Transitions to ACTIVE, LINK_IDLE, or HIBERNATE_SLEEP: On failure, the PHY rolls back any partial changes (best-effort) and remains in its previous state.
  • Transitions to POWER_DOWN: Every power-down step is attempted even if an earlier step fails, the first error is returned, and the PHY transitions to POWER_DOWN.

Reentrancy

The UFS driver may call SetPowerState while holding the locks that serialize its own UIC traffic (it does so for the ACTIVE and LINK_IDLE votes issued around doorbells and interrupts). Implementations must therefore complete SetPowerState without calling back into Ufshci (DmeGet/DmeSet); any DME work belongs in Init or PrePowerModeChange.

Request

NameType
state PowerState

Response

NameType
payload UfsPhy_SetPowerState_Result

Ufshci

Defined in fuchsia.hardware.ufs.phy/ufs_phy.fidl

Interface provided by the UFS MAC (controller driver) to the PHY driver, allowing the PHY driver to send UIC commands (like DME_SET) or access MAC-level registers required for PHY initialization.

DmeGet

Send a UIC DME_GET command to the UFS controller. If the MIB attribute's value has not been set via the DME_SET command, a hardware reset default value is returned by the device. For invalid mib_attribute or gen_selector_index values, a ZX_ERR_INTERNAL error is returned.

Request

NameType
mib_attribute uint16
gen_selector_index uint16

Response

NameType
payload Ufshci_DmeGet_Result

DmeSet

Send a UIC DME_SET command to the UFS controller.

Request

NameType
mib_attribute uint16
gen_selector_index uint16
value uint32

Response

NameType
payload Ufshci_DmeSet_Result

STRUCTS

UfsPhy_Init_Response

Defined in fuchsia.hardware.ufs.phy/ufs_phy.fidl

<EMPTY>

UfsPhy_PrePowerModeChange_Response

Defined in fuchsia.hardware.ufs.phy/ufs_phy.fidl

<EMPTY>

UfsPhy_SetPowerState_Response

Defined in fuchsia.hardware.ufs.phy/ufs_phy.fidl

<EMPTY>

Ufshci_DmeGet_Response

Defined in fuchsia.hardware.ufs.phy/ufs_phy.fidl

FieldTypeDescriptionDefault
value uint32 No default

Ufshci_DmeSet_Response

Defined in fuchsia.hardware.ufs.phy/ufs_phy.fidl

<EMPTY>

ENUMS

PowerState flexible

Type: uint8

Defined in fuchsia.hardware.ufs.phy/ufs_phy.fidl

Operating power states of the UFS PHY, ordered from highest to lowest power consumption.

NameValueDescription
1

All PHY power domains, regulators, and auxiliary clocks are enabled; UFSHCI registers and the UniPro link are accessible.

Can be entered from any state with no hardware preconditions. When waking from POWER_DOWN, the caller must subsequently re-enable the host controller (HCE = 1) and call Init to re-initialize the M-PHY before starting the link.

3

The UFS device is in Sleep (START STOP UNIT) and the UniPro link is in software Hibern8 (DME_HIBERNATE_ENTER). Low-voltage M-PHY analog supplies and auxiliary clocks may be disabled while device VCC and core power domains remain powered so wake to ACTIVE does not require link re-startup.

Preconditions: Can only be entered from ACTIVE or LINK_IDLE after Init has succeeded. The UFS device must be in Sleep (START STOP UNIT) and the UniPro link must be in software Hibern8 (DME_HIBERNATE_ENTER). While in HIBERNATE_SLEEP, UFSHCI registers must not be accessed and DME_HIBERNATE_EXIT must not be issued.

4

The host controller is stopped (HCE = 0) and all UFS device rails, PHY resets, regulators, clocks, and power domains are powered down.

Preconditions: Can be entered from any state after the caller has stopped the host controller (HCE = 0). While in POWER_DOWN, UFSHCI registers must not be accessed and Ufshci calls fail with ZX_ERR_BAD_STATE.

TABLES

UfsPhy_GetProperties_Response

Defined in fuchsia.hardware.ufs.phy/ufs_phy.fidl

OrdinalFieldTypeDescription
supports_suspend_resume bool

Whether POWER_DOWN suspend and resume are implemented, i.e. the PHY can power down the UFS device, PHY, and host controller power domains and bring them back up. When unset or false the controller driver only uses link hibernation for system suspend.

UNIONS

UfsPhy_GetProperties_Result strict

Defined in fuchsia.hardware.ufs.phy/ufs_phy.fidl

OrdinalVariantTypeDescription
response UfsPhy_GetProperties_Response
framework_err internal

UfsPhy_Init_Result strict

Defined in fuchsia.hardware.ufs.phy/ufs_phy.fidl

OrdinalVariantTypeDescription
response UfsPhy_Init_Response
err zx/Status
framework_err internal

UfsPhy_PrePowerModeChange_Result strict

Defined in fuchsia.hardware.ufs.phy/ufs_phy.fidl

OrdinalVariantTypeDescription
response UfsPhy_PrePowerModeChange_Response
err zx/Status
framework_err internal

UfsPhy_SetPowerState_Result strict

Defined in fuchsia.hardware.ufs.phy/ufs_phy.fidl

OrdinalVariantTypeDescription
response UfsPhy_SetPowerState_Response
err zx/Status
framework_err internal

Ufshci_DmeGet_Result strict

Defined in fuchsia.hardware.ufs.phy/ufs_phy.fidl

OrdinalVariantTypeDescription
response Ufshci_DmeGet_Response
err zx/Status
framework_err internal

Ufshci_DmeSet_Result strict

Defined in fuchsia.hardware.ufs.phy/ufs_phy.fidl

OrdinalVariantTypeDescription
response Ufshci_DmeSet_Response
err zx/Status
framework_err internal

SERVICES

Service

Defined in fuchsia.hardware.ufs.phy/ufs_phy.fidl

NameTypeTransport
phy fuchsia.hardware.ufs.phy/UfsPhy Channel
inline_crypto fuchsia.hardware.inlineencryption/Controller Channel