Changeset 540


Ignore:
Timestamp:
Mar 29, 2015, 2:22:06 PM (9 years ago)
Author:
alain
Message:

Simplify the Command Table C structure: only one physical buffer per command.

Location:
soft/giet_vm/giet_drivers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_drivers/hba_driver.c

    r529 r540  
    3636// command list : up to 32 commands
    3737__attribute__((section(".kdata")))
    38 hba_cmd_desc_t  _hba_cmd_list[32] __attribute__((aligned(0x1000)));   
     38hba_cmd_desc_t  _hba_cmd_list[32] __attribute__((aligned(0x10)));   
    3939
    4040// command tables array : one command table per entry in command list
     
    124124
    125125    // set  buffer descriptor in command table
    126     cmd_table->entry[0].dba  = (unsigned int)(buf_paddr);
    127     cmd_table->entry[0].dbau = (unsigned int)(buf_paddr >> 32);
    128     cmd_table->entry[0].dbc  = count * 512;
     126    cmd_table->buffer.dba  = (unsigned int)(buf_paddr);
     127    cmd_table->buffer.dbau = (unsigned int)(buf_paddr >> 32);
     128    cmd_table->buffer.dbc  = count * 512;
    129129
    130130    // initialize command table header
  • soft/giet_vm/giet_drivers/hba_driver.h

    r529 r540  
    1212//    supports only channel 0, because the GIET-VM uses only one physical disk.
    1313//
    14 // 2. The "command list" can contain up to 32 independant commands, posted
     14// 2. This HBA component support split memory buffers (several physical
     15//    buffers for one single command), but this driver supports only
     16//    single buffer commands.
     17//
     18// 3. The "command list" can contain up to 32 independant commands, posted
    1519//    by different user tasks. These independant transfers are handled
    1620//    by the HBA device in the same order as they have been written by the
     
    2024//    and increment the write pointer.
    2125//
    22 // 3. This driver implements two operating mode:
     26// 4. This driver implements two operating mode:
    2327//    - In synchronous mode, the calling task poll the HBA_PXCI register to
    2428//    detect the command completion (busy waiting).
     
    2630//    restart when the command is completed.
    2731//
    28 // 4. As several user tasks can concurrently register commands in the command
     32// 5. As several user tasks can concurrently register commands in the command
    2933//    list, and there is only one HBA interrupt, this interrupt is not linked
    3034//    to a specific task. In descheduling mode, the HBA IRQ is a "global" IRQ
     
    5862
    5963///////////////////////////////////////////////////////////////////////////////////
    60 // Data structures for command table array
     64// Data structures for command table
    6165///////////////////////////////////////////////////////////////////////////////////
    6266
     
    8387} hba_cmd_header_t;
    8488
    85 typedef struct hba_cmd_entry_s  // size = 16 bytes
     89typedef struct hba_cmd_buffer_s  // size = 16 bytes
    8690{
    8791    unsigned int        dba;        // Buffer base address 32 LSB bits
     
    9094    unsigned int        dbc;        // Buffer byte count
    9195
    92 } hba_cmd_entry_t;
     96} hba_cmd_buffer_t;
    9397
    94 typedef struct hba_cmd_table_s  // size = 4096 bytes
     98typedef struct hba_cmd_table_s  // size = 256 bytes
    9599{
    96100
    97     hba_cmd_header_t   header;     // contains LBA
    98     hba_cmd_entry_t    entry[248]; // 248 buffers max
     101    hba_cmd_header_t   header;      // contains LBA
     102    hba_cmd_buffer_t   buffer;      // only one physical buffer
     103    char               res[112];    // for 256 bytes alignment
    99104
    100105} hba_cmd_table_t;
Note: See TracChangeset for help on using the changeset viewer.