一. UFS Power Mode Change简介
1.UFS Power Mode指的是Unipro层的Power State, 也可以称为链路(Link)上的Power Mode, 可以通过配置Unipro Attribute, 然后控制切换Unipro Power State, 当前Power Mode Change有两种触发方式:
(1) 通过DME Power Mode Change触发Power Mode Change
(2)通过DME SET PA_PWRMode[0x1571]触发Power Mode Change
目前主流的安卓平台(QCOM/MTK)使用第二种方式,先设置好本地端(Local )Local 端的Power Mode属性, 然后通过发送DME SET PA_PWRMode切换对端(Peer)的Power Mode.
UFS Power Mode相关的Unipro Attribute:
(1)PA_ACTIVETXDATALANES[0x1560]/PA_ACTIVERXDATALANES[0x1580]: Number of active Data Lanes per direction, 通过DME GET 获取对应的属性值,
(2)PA_RxGear[0x1583]/PA_TxGear[0x1568]: PWM-GEAR per direction, 默认Link Startup之后的状态就是PWM_G1
(3)PA_RxGear[0x1583]/PA_TxGear[0x1568]: HS-GEAR used per direction, 需要通过DME SET PA_PWRMode从PWM_G1切换到HS Gear1~ HS Gear4, UFS3.1最高支持HS Gear4, UFS4.0最高支持HS Gear5
(4)PA_HSSeries[0x156A]: HS RATE series (same value used for both directions)
(5)PA_TxTermination[0x1569]/PA_RxTermination[0x1584]: Line termination per direction
(6)PA_PWRMode[0x1571]: Power Mode for each direction combined into a single PA_PWRMode Attribute, 安卓UFS驱动就是通过DME SET PA_PWRMode触发Peer端Power Mode Change流程
UniPro Power Modes:
Power Mode | Description | UniPro Power State |
Fast_Mode | The Fast_Mode is capable of the highest data transmission rate of all Power Modes. The Link is always ready to send and receive data while providing a well-defined latency, which is the lowest of any UniPro Power Modes. The actual data rate per Data Lane in the Fast_Mode is PHY-specific. |
FAST_STATE |
Slow_Mode | The Slow_Mode is also capable of transmitting data. It should be less than, or equal to, the data rate in Fast_Mode and consume less, or equal, power. The provided latency is welldefined but might be higher than in the Fast_Mode. The actual data rate in the Slow_Mode is PHY-specific. | SLOW_STATE |
FastAuto_Mode | The FastAuto_Mode allows the UniPro stack to autonomously switch between the FAST_STATE and the SLEEP_STATE, depending whether or not the DL Layer has data to send. By switching between states, the FastAuto_Mode might save power compared to the Fast_Mode, but at the cost of a possibly less well-defined latency. UniPro does not dictate a certain method for the autonomous switching. In any case, a PA Layer shall be able to transmit DL Layer data when in FastAuto_Mode. |
FAST_STATE, SLEEP_STATE |
SlowAuto_Mode | The SlowAuto_Mode allows the UniPro stack to autonomously switch between the SLOW_STATE and the SLEEP_STATE, depending on whether or not the DL Layer has data to send. By switching between states, the SlowAuto_Mode might save power compared to the Slow_Mode, but at the cost of a possibly less well-defined latency. UniPro does n |