Changes between Version 2 and Version 3 of Component/Vci Multi Ahci


Ignore:
Timestamp:
Mar 29, 2015, 1:13:54 PM (9 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Component/Vci Multi Ahci

    v2 v3  
    99and containing a complete disk image.
    1010Each 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 constructors parameters.
     11of 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.
    1212The number of channels cannot be larger than 8. The burst size must be a power of 2 between 8 and 64 bytes.
    1313The block size must be a power of 2 between 128 and 4096 bytes.
     
    2929== 2) Command List ==
    3030
    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:
     31For 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:
    3232
    3333{{{
    3434typedef struct hba_cmd_desc_s  // size = 16 bytes
    3535{
    36     unsigned char       flag[2];        // only one bit used : WRITE when bit 6 of flag[0] is set
    37     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
    3838    unsigned int        prdbc;          // Number of bytes actually transfered
    3939    unsigned int        ctba;           // Command Table base address 32 LSB bits
     
    4242}}}
    4343
    44 == 3) Command Table
     44== 3) Command Table ==
    4545
    46 == 2) Addressable registers ==
     46There 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{{{
     48typedef 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
     56typedef 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
     70typedef 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 ==
    4781
    4882Each channel[k] contains six 32 bits read/write registers:
    4983
    5084 * '''HBA_PXCLB'''
    51 32 LSB bits of the Command List array physical address.
     8532 LSB bits of the Command List physical base address.
     86This address must be aligned on a 16 bytes boundary.
    5287
    5388 * '''HBA_PXCLBU'''
    54 32 MSB bits of the Command List array physical address. *
     8932 MSB bits of the Command List array physical address.
    5590
    5691 * '''HBA_PXIS'''
    5792Channel status, used for error reporting.
     93||31||30||29||28     24||23    ...  8||7 ... 1||0||
    5894
    5995 * '''HBA_PXIE'''