kolibri-ahci:

- make some padding and reserved field anonymous
- correct mistake in FIS_DMA_SETUP, some fileds were absent
- small fixes

git-svn-id: svn://kolibrios.org@9072 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Rustem Gimadutdinov (rgimad) 2021-07-21 15:33:47 +00:00
parent 4f24fcab0f
commit f195324958

View File

@ -62,8 +62,8 @@ struct HBA_MEM
em_ctl dd ? ; 0x20, Enclosure management control em_ctl dd ? ; 0x20, Enclosure management control
cap2 dd ? ; 0x24, Host capabilities extended cap2 dd ? ; 0x24, Host capabilities extended
bohc dd ? ; 0x28, BIOS/OS handoff control and status bohc dd ? ; 0x28, BIOS/OS handoff control and status
reserved rb (0xA0-0x2C) ; 0x2C - 0x9F, Reserved reserved rb (0xA0-HBA_MEM.reserved) ; 0x2C - 0x9F, Reserved
vendor rb (0x100-0xA0) ; 0xA0 - 0xFF, Vendor specific vendor rb (0x100-HBA_MEM.vendor) ; 0xA0 - 0xFF, Vendor specific
ports rb (sizeof.HBA_PORT*AHCI_MAX_PORTS) ; 0x100 - 0x10FF, Port control registers, max AHCI_MAX_PORTS ports rb (sizeof.HBA_PORT*AHCI_MAX_PORTS) ; 0x100 - 0x10FF, Port control registers, max AHCI_MAX_PORTS
ends ends
@ -102,13 +102,13 @@ struct HBA_CMD_HDR
prdbc dd ? ; Physical region descriptor byte count transferred prdbc dd ? ; Physical region descriptor byte count transferred
ctba dd ? ; Command table descriptor base address ctba dd ? ; Command table descriptor base address
ctbau dd ? ; Command table descriptor base address upper 32 bits ctbau dd ? ; Command table descriptor base address upper 32 bits
rsv1 rd 4 ; Reserved rd 4 ; Reserved
ends ends
struct HBA_PRDT_ENTRY struct HBA_PRDT_ENTRY
dba dd ? ; Data base address dba dd ? ; Data base address
dbau dd ? ; Data base address upper 32 bits dbau dd ? ; Data base address upper 32 bits
rsv0 dd ? ; Reserved dd ? ; Reserved
_flags dd ? ; 0bIR..RD..D, I (1 bit) - Interrupt on completion, _flags dd ? ; 0bIR..RD..D, I (1 bit) - Interrupt on completion,
; R (9 bits) - Reserved, D (22 bits) - Byte count, 4M max ; R (9 bits) - Reserved, D (22 bits) - Byte count, 4M max
ends ends
@ -116,7 +116,7 @@ ends
struct HBA_CMD_TBL struct HBA_CMD_TBL
cfis rb 64 ; 0x00, Command FIS cfis rb 64 ; 0x00, Command FIS
acmd rb 16 ; 0x40, ATAPI command, 12 or 16 bytes acmd rb 16 ; 0x40, ATAPI command, 12 or 16 bytes
rsv rb 48 ; 0x50, Reserved rb 48 ; 0x50, Reserved
prdt_entry HBA_PRDT_ENTRY ; 0x80, Physical region descriptor table entries, 0 ~ 65535 prdt_entry HBA_PRDT_ENTRY ; 0x80, Physical region descriptor table entries, 0 ~ 65535
; so, this structure is variable-length ; so, this structure is variable-length
ends ends
@ -153,7 +153,7 @@ struct FIS_REG_H2D
icc db ? ; Isochronous command completion icc db ? ; Isochronous command completion
control db ? ; Control register control db ? ; Control register
rsv1 rb 4 ; Reserved rb 4 ; Reserved
ends ends
; Register FIS Device to Host ; Register FIS Device to Host
@ -174,20 +174,20 @@ struct FIS_REG_D2H
lba3 db ? ; LBA register, 31:24 lba3 db ? ; LBA register, 31:24
lba4 db ? ; LBA register, 39:32 lba4 db ? ; LBA register, 39:32
lba5 db ? ; LBA register, 47:40 lba5 db ? ; LBA register, 47:40
rsv2 db ? ; Reserved db ? ; Reserved
countl db ? ; Count register, 7:0 countl db ? ; Count register, 7:0
counth db ? ; Count register, 15:8 counth db ? ; Count register, 15:8
rsv3 rb 2 ; Reserved rb 2 ; Reserved
rsv4 rb 4 ; Reserved rb 4 ; Reserved
ends ends
; Data FIS Bidirectional ; Data FIS Bidirectional
struct FIS_DATA struct FIS_DATA
fis_type db ? ; FIS_TYPE_DATA fis_type db ? ; FIS_TYPE_DATA
_flags db ? ; 0bRRRRPPPP, R - Reserved, P - Port multiplier _flags db ? ; 0bRRRRPPPP, R - Reserved, P - Port multiplier
rsv1 rb 2 ; Reserved rb 2 ; Reserved
; DWORD 1 ~ N (?) ; DWORD 1 ~ N (?)
data rd 1 ; Payload data rd 1 ; Payload
ends ends
@ -210,15 +210,15 @@ struct FIS_PIO_SETUP
lba3 db ? ; LBA register, 31:24 lba3 db ? ; LBA register, 31:24
lba4 db ? ; LBA register, 39:32 lba4 db ? ; LBA register, 39:32
lba5 db ? ; LBA register, 47:40 lba5 db ? ; LBA register, 47:40
rsv2 db ? ; Reserved db ? ; Reserved
countl db ? ; Count register, 7:0 countl db ? ; Count register, 7:0
counth db ? ; Count register, 15:8 counth db ? ; Count register, 15:8
rsv3 db ? ; Reserved db ? ; Reserved
e_status db ? ; New value of status register e_status db ? ; New value of status register
tc dw ? ; Transfer count tc dw ? ; Transfer count
rsv4 rb 2 ; Reserved rb 2 ; Reserved
ends ends
; DMA Setup Device to Host ; DMA Setup Device to Host
@ -228,14 +228,16 @@ struct FIS_DMA_SETUP
; I - Interrupt bit, D - Data transfer direction, 1 - device to host, ; I - Interrupt bit, D - Data transfer direction, 1 - device to host,
; R - Reserved, P - Port multiplier ; R - Reserved, P - Port multiplier
rsved rb 2 ; Reserved rb 2 ; Reserved
DMAbufferID dq ? ; DMA Buffer Identifier. DMAbufferID dq ? ; DMA Buffer Identifier.
; Used to Identify DMA buffer in host memory. ; Used to Identify DMA buffer in host memory.
; SATA Spec says host specific and not in Spec. ; SATA Spec says host specific and not in Spec.
; Trying AHCI spec might work. ; Trying AHCI spec might work.
dd ? ; Reserved
DMAbufOffset dd ? ; Byte offset into buffer. First 2 bits must be 0
TransferCount dd ? ; Number of bytes to transfer. Bit 0 must be 0 TransferCount dd ? ; Number of bytes to transfer. Bit 0 must be 0
resvd dd ? ; Reserved dd ? ; Reserved
ends ends
; Set device bits FIS - device to host ; Set device bits FIS - device to host
@ -252,19 +254,19 @@ ends
struct HBA_FIS struct HBA_FIS
dsfis FIS_DMA_SETUP ; 0x00, DMA Setup FIS dsfis FIS_DMA_SETUP ; 0x00, DMA Setup FIS
pad0 rb 4 ; rb 4 ; padding
psfis FIS_PIO_SETUP ; 0x20, PIO Setup FIS psfis FIS_PIO_SETUP ; 0x20, PIO Setup FIS
pad1 rb 12 ; rb 12 ; padding
rfis FIS_REG_D2H ; 0x40, Register - Device to Host FIS rfis FIS_REG_D2H ; 0x40, Register - Device to Host FIS
pad2 rb 4 ; rb 4 ; padding
sdbfis FIS_DEV_BITS ; 0x58, Set Device Bit FIS sdbfis FIS_DEV_BITS ; 0x58, Set Device Bit FIS
ufis rb 64 ; 0x60 ufis rb 64 ; 0x60
rsv rb (0x100 - 0xA0) ; 0xA0 rb (0x100 - 0xA0) ; 0xA0, Reserved
ends ends
; -------------------------------------------------- ; --------------------------------------------------