Changeset 540 for soft/giet_vm/giet_drivers
- Timestamp:
- Mar 29, 2015, 2:22:06 PM (10 years ago)
- Location:
- soft/giet_vm/giet_drivers
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_drivers/hba_driver.c
r529 r540 36 36 // command list : up to 32 commands 37 37 __attribute__((section(".kdata"))) 38 hba_cmd_desc_t _hba_cmd_list[32] __attribute__((aligned(0x10 00)));38 hba_cmd_desc_t _hba_cmd_list[32] __attribute__((aligned(0x10))); 39 39 40 40 // command tables array : one command table per entry in command list … … 124 124 125 125 // 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; 129 129 130 130 // initialize command table header -
soft/giet_vm/giet_drivers/hba_driver.h
r529 r540 12 12 // supports only channel 0, because the GIET-VM uses only one physical disk. 13 13 // 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 15 19 // by different user tasks. These independant transfers are handled 16 20 // by the HBA device in the same order as they have been written by the … … 20 24 // and increment the write pointer. 21 25 // 22 // 3. This driver implements two operating mode:26 // 4. This driver implements two operating mode: 23 27 // - In synchronous mode, the calling task poll the HBA_PXCI register to 24 28 // detect the command completion (busy waiting). … … 26 30 // restart when the command is completed. 27 31 // 28 // 4. As several user tasks can concurrently register commands in the command32 // 5. As several user tasks can concurrently register commands in the command 29 33 // list, and there is only one HBA interrupt, this interrupt is not linked 30 34 // to a specific task. In descheduling mode, the HBA IRQ is a "global" IRQ … … 58 62 59 63 /////////////////////////////////////////////////////////////////////////////////// 60 // Data structures for command table array64 // Data structures for command table 61 65 /////////////////////////////////////////////////////////////////////////////////// 62 66 … … 83 87 } hba_cmd_header_t; 84 88 85 typedef struct hba_cmd_ entry_s // size = 16 bytes89 typedef struct hba_cmd_buffer_s // size = 16 bytes 86 90 { 87 91 unsigned int dba; // Buffer base address 32 LSB bits … … 90 94 unsigned int dbc; // Buffer byte count 91 95 92 } hba_cmd_ entry_t;96 } hba_cmd_buffer_t; 93 97 94 typedef struct hba_cmd_table_s // size = 4096 bytes98 typedef struct hba_cmd_table_s // size = 256 bytes 95 99 { 96 100 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 99 104 100 105 } hba_cmd_table_t;
Note: See TracChangeset
for help on using the changeset viewer.