AHCI介绍


AHCI Memory Structure


Receive FIS Structure


Command List Structure


Command Table Structure



Step1 Check Device在哪一个AHCI port上
Example code:
PxSSTS寄存器

     PortData = ReadMmioDword(Abar+Port*0x80+100+HBA_PORTS_SSTS);

     if((PortData&0x0f)==3)  //Device on this port!

Step2 Get Device Type

PxSIG寄存器

 PortData = ReadMmioDword(Abar+Port*0x80+0x100+HBA_PORTS_SIG);
 if((PortData&0xffff0000) = 0xeb140000)
  DeviceType ATAPI
 else    
Device Type ATA

Step3 Build command table 之CFIS


CFIS Structure

Type = 0x27 C = 1
Command = 0xec //ATA device identify
Sector Number = 1

Step4 Build command table之PRDT table


PRDT Structure

DBC = Identify data count
DW3 BIT0 BIT1 置1
DBA = Identify data buffer address

Step5 Build Command List Structure


Command List Structure

CFL=CFIS长度 = 5

PRDTL = PRDT entry number,对于Identify command PRDTL = 1
CTBA = command table base address

Step6: Start Command

Register PxCI port command issue

选择command list中的某个command例如:

PxCI Bit0 = 1 ,选择command 0
Register PxCMD
Set Bit0 to 1,执行命令

展开阅读全文

页面更新:2024-04-22

标签:寄存器   数据传输   详尽   长度   接口   命令   本文   定义   概念   传统

1 2 3 4 5

上滑加载更多 ↓
推荐阅读:
友情链接:
更多:

本站资料均由网友自行发布提供,仅用于学习交流。如有版权问题,请与我联系,QQ:4156828  

© CopyRight 2008-2024 All Rights Reserved. Powered By bs178.com 闽ICP备11008920号-3
闽公网安备35020302034844号

Top