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

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