64 requested.
dword = dword11;
65 xil_printf(
"Number of IO Submission Queues Requested (NSQR, zero-based): 0x%04X\r\n", requested.
NSQR);
66 xil_printf(
"Number of IO Completion Queues Requested (NCQR, zero-based): 0x%04X\r\n", requested.
NCQR);
84 xil_printf(
"Number of IO Submission Queues Allocated (NSQA, zero-based): 0x%04X\r\n", allocated.
NSQA);
85 xil_printf(
"Number of IO Completion Queues Allocated (NCQA, zero-based): 0x%04X\r\n", allocated.
NCQA);
87 return allocated.
dword;
100 nvmeCPL->
dword[0] = 0x0;
106 nvmeCPL->
dword[0] = 0x0;
112 nvmeCPL->
dword[0] = 0x0;
118 nvmeCPL->
dword[0] = 0x0;
124 xil_printf(
"Set VWC: %X\r\n", nvmeAdminCmd->
dword11);
126 nvmeCPL->
dword[0] = 0x0;
132 nvmeCPL->
dword[0] = 0x0;
138 nvmeCPL->
dword[0] = 0x0;
144 xil_printf(
"Not Support FID (Set): %X\r\n", features.
FID);
149 xil_printf(
"Set Feature FID:%X\r\n", features.
FID);
159 switch (features.
FID)
173 nvmeCPL->
dword[0] = 0x0;
181 nvmeCPL->
dword[0] = 0x0;
187 nvmeCPL->
dword[0] = 0x0;
193 nvmeCPL->
dword[0] = 0x0;
199 nvmeCPL->
dword[0] = 0x0;
205 xil_printf(
"Not Support FID (Get): %X\r\n", features.
FID);
210 xil_printf(
"Get Feature FID:%X\r\n", features.
FID);
218 unsigned int ioSqIdx;
223 xil_printf(
"create sq: 0x%08X, 0x%08X\r\n", sqInfo11.
dword, sqInfo10.
dword);
229 ASSERT((nvmeAdminCmd->
PRP1[0] & 0x3) == 0 && nvmeAdminCmd->
PRP1[1] < 0x10000);
233 ioSqIdx = sqInfo10.
QID - 1;
236 ioSqStatus->
valid = 1;
245 nvmeCPL->
dword[0] = 0;
253 unsigned int ioSqIdx;
257 xil_printf(
"delete sq: 0x%08X\r\n", sqInfo10.
dword);
259 ioSqIdx = (
unsigned int)sqInfo10.
QID - 1;
262 ioSqStatus->
valid = 0;
264 ioSqStatus->
qSzie = 0;
270 nvmeCPL->
dword[0] = 0;
279 unsigned int ioCqIdx;
284 xil_printf(
"create cq: 0x%08X, 0x%08X\r\n", cqInfo11.
dword, cqInfo10.
dword);
286 ASSERT(((nvmeAdminCmd->
PRP1[0] & 0x3) == 0) && (nvmeAdminCmd->
PRP1[1] < 0x10000));
287 ASSERT(cqInfo11.
IV < 8 && cqInfo10.
QSIZE < 0x100 && 0 < cqInfo10.
QID && cqInfo10.
QID <= 8);
289 ioCqIdx = cqInfo10.
QID - 1;
292 ioCqStatus->
valid = 1;
302 nvmeCPL->
dword[0] = 0;
310 unsigned int ioCqIdx;
314 xil_printf(
"delete cq: 0x%08X\r\n", cqInfo10.
dword);
316 ioCqIdx = (
unsigned int)cqInfo10.
QID - 1;
319 ioCqStatus->
valid = 0;
321 ioCqStatus->
qSzie = 0;
327 nvmeCPL->
dword[0] = 0;
340 if (identifyInfo.
CNS == 1)
342 if ((nvmeAdminCmd->
PRP1[0] & 0x3) != 0 || (nvmeAdminCmd->
PRP2[0] & 0x3) != 0)
343 xil_printf(
"CI: %X, %X, %X, %X\r\n", nvmeAdminCmd->
PRP1[1], nvmeAdminCmd->
PRP1[0],
344 nvmeAdminCmd->
PRP2[1], nvmeAdminCmd->
PRP2[0]);
346 ASSERT((nvmeAdminCmd->
PRP1[0] & 0x3) == 0 && (nvmeAdminCmd->
PRP2[0] & 0x3) == 0);
349 else if (identifyInfo.
CNS == 0)
351 if ((nvmeAdminCmd->
PRP1[0] & 0x3) != 0 || (nvmeAdminCmd->
PRP2[0] & 0x3) != 0)
352 xil_printf(
"NI: %X, %X, %X, %X\r\n", nvmeAdminCmd->
PRP1[1], nvmeAdminCmd->
PRP1[0],
353 nvmeAdminCmd->
PRP2[1], nvmeAdminCmd->
PRP2[0]);
355 ASSERT((nvmeAdminCmd->
PRP1[0] & 0x3) == 0 && (nvmeAdminCmd->
PRP2[0] & 0x3) == 0);
361 prp[0] = nvmeAdminCmd->
PRP1[0];
362 prp[1] = nvmeAdminCmd->
PRP1[1];
364 prpLen = 0x1000 - (prp[0] & 0xFFF);
367 if (prpLen != 0x1000)
369 pIdentifyData = pIdentifyData + prpLen;
370 prpLen = 0x1000 - prpLen;
371 prp[0] = nvmeAdminCmd->
PRP2[0];
372 prp[1] = nvmeAdminCmd->
PRP2[1];
380 nvmeCPL->
dword[0] = 0;
411 nvmeCPL->
dword[0] = 0;
420 unsigned int needCpl;
421 unsigned int needSlotRelease;
424 opc = (
unsigned int)nvmeAdminCmd->
OPC;
483 nvmeCPL.
dword[0] = 0;
496 nvmeCPL.
dword[0] = 0;
504 nvmeCPL.
dword[0] = 0;
510 xil_printf(
"Not Support Admin Command OPC: %X\r\n", opc);
518 else if (needSlotRelease == 1)
524 xil_printf(
"Done Admin Command OPC: %X\r\n", opc);
void set_auto_nvme_cpl(unsigned int cmdSlotTag, unsigned int specific, unsigned int statusFieldWord)
void set_nvme_cpl(unsigned int sqId, unsigned int cid, unsigned int specific, unsigned int statusFieldWord)
void check_direct_tx_dma_done()
void set_nvme_slot_release(unsigned int cmdSlotTag)
void set_io_sq(unsigned int ioSqIdx, unsigned int valid, unsigned int cqVector, unsigned int qSzie, unsigned int pcieBaseAddrL, unsigned int pcieBaseAddrH)
void set_direct_tx_dma(unsigned int devAddr, unsigned int pcieAddrH, unsigned int pcieAddrL, unsigned int len)
void set_io_cq(unsigned int ioCqIdx, unsigned int valid, unsigned int irqEn, unsigned int irqVector, unsigned int qSzie, unsigned int pcieBaseAddrL, unsigned int pcieBaseAddrH)
#define INTERRUPT_COALESCING
#define ADMIN_CREATE_IO_CQ
#define ASYNCHRONOUS_EVENT_CONFIGURATION
#define ADMIN_SECURITY_RECEIVE
#define TEMPERATURE_THRESHOLD
#define ADMIN_SET_FEATURES
#define Power_State_Transition
#define ADMIN_DELETE_IO_CQ
#define ADMIN_GET_FEATURES
#define ADMIN_ASYNCHRONOUS_EVENT_REQUEST
#define ADMIN_CREATE_IO_SQ
#define SC_INVALID_FIELD_IN_COMMAND
#define ADMIN_DOORBELL_BUFFER_CONFIG
#define VOLATILE_WRITE_CACHE
#define ADMIN_CMD_DRAM_DATA_BUFFER
#define ADMIN_GET_LOG_PAGE
#define ADMIN_DELETE_IO_SQ
void handle_nvme_admin_cmd(NVME_COMMAND *nvmeCmd)
void handle_get_features(NVME_ADMIN_COMMAND *nvmeAdminCmd, NVME_COMPLETION *nvmeCPL)
unsigned int get_num_of_queue(unsigned int dword11)
void handle_identify(NVME_ADMIN_COMMAND *nvmeAdminCmd, NVME_COMPLETION *nvmeCPL)
void handle_create_io_sq(NVME_ADMIN_COMMAND *nvmeAdminCmd, NVME_COMPLETION *nvmeCPL)
void handle_delete_io_sq(NVME_ADMIN_COMMAND *nvmeAdminCmd, NVME_COMPLETION *nvmeCPL)
void handle_delete_io_cq(NVME_ADMIN_COMMAND *nvmeAdminCmd, NVME_COMPLETION *nvmeCPL)
void handle_create_io_cq(NVME_ADMIN_COMMAND *nvmeAdminCmd, NVME_COMPLETION *nvmeCPL)
void handle_get_log_page(NVME_ADMIN_COMMAND *nvmeAdminCmd, NVME_COMPLETION *nvmeCPL)
void handle_set_features(NVME_ADMIN_COMMAND *nvmeAdminCmd, NVME_COMPLETION *nvmeCPL)
void identify_controller(unsigned int pBuffer)
void identify_namespace(unsigned int pBuffer)
unsigned short cmdSlotTag
unsigned int cmdDword[16]
The main structure of completion queue entry.
struct _NVME_COMPLETION::@72::@74::@76::@78 statusField
unsigned short statusFieldWord
unsigned int pcieBaseAddrH
unsigned int pcieBaseAddrL
unsigned int pcieBaseAddrH
unsigned int pcieBaseAddrL
NVME_IO_SQ_STATUS ioSqInfo[MAX_NUM_OF_IO_SQ]
unsigned short numOfIOSubmissionQueuesAllocated
NVME_IO_CQ_STATUS ioCqInfo[MAX_NUM_OF_IO_CQ]
unsigned short numOfIOCompletionQueuesAllocated