Changes between Version 2 and Version 3 of Component/Vci Multi Ahci
- Timestamp:
- Mar 29, 2015, 1:13:54 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Component/Vci Multi Ahci
v2 v3 9 9 and containing a complete disk image. 10 10 Each channel[k] can perform data transfers between file[k] and a buffer in the physical memory 11 of the virtual system. he number of supported channels, the file name(s), the VCI burst size, and the block size are hardware parameters,defined as constructorsparameters.11 of the virtual system. The number of supported channels, the file name(s), the VCI burst size, and the block size are hardware parameters, defined as constructor parameters. 12 12 The number of channels cannot be larger than 8. The burst size must be a power of 2 between 8 and 64 bytes. 13 13 The block size must be a power of 2 between 128 and 4096 bytes. … … 29 29 == 2) Command List == 30 30 31 For each channel, the VciMultiAhci driver must use two arrays to register commands: The Command Descriptor array (32 entries) define the Command List (software FIFO). Each Command Descriptor occupies 16 bytes, with the following format:31 For each channel, the VciMultiAhci driver must use a software FIFO to register a command: The Command Descriptor array (32 entries) define the Command List. Each Command Descriptor occupies 16 bytes, and contains mainly the physical address of the associated Command Table. A command Descriptor is defined by the following C structure: 32 32 33 33 {{{ 34 34 typedef struct hba_cmd_desc_s // size = 16 bytes 35 35 { 36 unsigned char flag[2]; // only one bit used :WRITE when bit 6 of flag[0] is set37 unsigned char prdtl[2]; // Number of buffers (no more than 16535)36 unsigned char flag[2]; // WRITE when bit 6 of flag[0] is set 37 unsigned char prdtl[2]; // Number of buffers 38 38 unsigned int prdbc; // Number of bytes actually transfered 39 39 unsigned int ctba; // Command Table base address 32 LSB bits … … 42 42 }}} 43 43 44 == 3) Command Table 44 == 3) Command Table == 45 45 46 == 2) Addressable registers == 46 There is one Command Table for each Command descriptor. For a given command, there is one single LBA (Logic Bloc Address) on the block device, coded on 48 bits, but the source (or destination) memory buffer can be split in a variable number of contiguous buffers. Therefore, the Command Table contains two parts: a fixed size Header, defining the LBA, and an array of buffer descriptors containing up to 248 buffer descriptors. A Command Table occupies 4 Kbytes, and is defined by the following C structures: 47 {{{ 48 typedef struct hba_cmd_table_s // size = 4 Kbytes 49 { 50 51 hba_cmd_header_t header; // contains LBA 52 hba_cmd_buffer_t buffer[248]; // 248 buffers max 53 54 } hba_cmd_table_t; 55 56 typedef struct hba_cmd_header_s // size = 128 bytes 57 { 58 unsigned int res0; // reserved 59 unsigned char lba0; // LBA 7:0 60 unsigned char lba1; // LBA 15:8 61 unsigned char lba2; // LBA 23:16 62 unsigned char res1; // reserved 63 unsigned char lba3; // LBA 31:24 64 unsigned char lba4; // LBA 39:32 65 unsigned char lba5; // LBA 47:40 66 unsigned char res2; // reserved 67 unsigned int res[29]; // reserved 68 } hba_cmd_header_t; 69 70 typedef struct hba_cmd_buffer_s // size = 16 bytes 71 { 72 unsigned int dba; // Buffer base address 32 LSB bits 73 unsigned int dbau; // Buffer base address 32 MSB bits 74 unsigned int res0; // reserved 75 unsigned int dbc; // Buffer byte count 76 77 } hba_cmd_buffer_t; 78 }}} 79 80 == 4) Addressable registers == 47 81 48 82 Each channel[k] contains six 32 bits read/write registers: 49 83 50 84 * '''HBA_PXCLB''' 51 32 LSB bits of the Command List array physical address. 85 32 LSB bits of the Command List physical base address. 86 This address must be aligned on a 16 bytes boundary. 52 87 53 88 * '''HBA_PXCLBU''' 54 32 MSB bits of the Command List array physical address. *89 32 MSB bits of the Command List array physical address. 55 90 56 91 * '''HBA_PXIS''' 57 92 Channel status, used for error reporting. 93 ||31||30||29||28 24||23 ... 8||7 ... 1||0|| 58 94 59 95 * '''HBA_PXIE'''