AHCI协议阅读笔记

SCRx Port Register

SCR0~SCR4寄存器,可判断端口Link状态,是否Link Up,端口速度等
299

系统内存分配

HBA寄存器指向系统内存空间,最多32个端口,每个端口包含Command ListReceived FIS Structure
300
Command List最多32个,
301
Received FIS Structure大小是256字节,

  1. DMA setup FIS被拷贝到DSFIS
  2. PIO setup FIS被拷贝到PSFIS
  3. D2H Register FIS被拷贝到RFIS
  4. Set Device Bits FIS被拷贝到SDBFIS
  5. When an unknown FIS arrives from the device, the HBA copies it to the UFIS area in this structure, and
    sets PxSERR.DIAG.F, which is reflected in PxIS.UFS when the FIS is posted to memory. A maximum of
    64-bytes of an unknown FIS type may be sent to an HBA. If an unknown FIS arrives that is longer than
    64-bytes, the FIS is considered illegal and is handled as described in section 6.1.2. While the length of
    the FIS is unknown to the HBA, it is expected to be known by system software, and therefore only the
    valid bytes shall be processed by software. The HBA is not required to tolerate receiving an unknown FIS
    when the HBA is expecting a Data FIS from the device or when the HBA is about to transfer a Data FIS to
    the device based on the command protocol being used.

302
Command List的每一项Command Header的结构,每一个Command Header都指向一个Command TablePRDTL指示Command Table里有多少项(第二级了),16bit,最多65535个,W指示数据方向,A指示这是一个ATAPI命令,CFL指示Command FIS的长度,PRDBC指示读写长度,32bit,所以单个Command Header最大传输2GB数据,每页4KB,则最大0xFFFF000,256MB-4KB。
303
304
305
Command Table结构如下,CFIS长度由CFL决定,最大64字节,ACMD只有在ATAPI命令时才用到,PRDT的每一项最大指向一片4MB的内存。
306
307

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章