OpenSSD Cosmos+ Platform Firmware  0.0.2
The firmware of Cosmos+ OpenSSD Platform for TOSHIBA nand flash module.
host_lld.c File Reference
#include "stdio.h"
#include "xil_exception.h"
#include "xil_printf.h"
#include "debug.h"
#include "io_access.h"
#include "nvme.h"
#include "host_lld.h"
Include dependency graph for host_lld.c:

Go to the source code of this file.

Functions

void dev_irq_init ()
 
void dev_irq_handler ()
 
unsigned int check_nvme_cc_en ()
 
void pcie_async_reset (unsigned int rstCnt)
 
void set_link_width (unsigned int linkNum)
 
void set_nvme_csts_rdy (unsigned int rdy)
 
void set_nvme_csts_shst (unsigned int shst)
 
void set_nvme_admin_queue (unsigned int sqValid, unsigned int cqValid, unsigned int cqIrqEn)
 
unsigned int get_nvme_cmd (unsigned short *qID, unsigned short *cmdSlotTag, unsigned int *cmdSeqNum, unsigned int *cmdDword)
 
void set_auto_nvme_cpl (unsigned int cmdSlotTag, unsigned int specific, unsigned int statusFieldWord)
 
void set_nvme_slot_release (unsigned int cmdSlotTag)
 
void set_nvme_cpl (unsigned int sqId, unsigned int cid, unsigned int specific, unsigned int statusFieldWord)
 
void set_io_sq (unsigned int ioSqIdx, unsigned int valid, unsigned int cqVector, unsigned int qSzie, unsigned int pcieBaseAddrL, unsigned int pcieBaseAddrH)
 
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)
 
void set_direct_tx_dma (unsigned int devAddr, unsigned int pcieAddrH, unsigned int pcieAddrL, unsigned int len)
 
void set_direct_rx_dma (unsigned int devAddr, unsigned int pcieAddrH, unsigned int pcieAddrL, unsigned int len)
 
void set_auto_tx_dma (unsigned int cmdSlotTag, unsigned int cmd4KBOffset, unsigned int devAddr, unsigned int autoCompletion)
 
void set_auto_rx_dma (unsigned int cmdSlotTag, unsigned int cmd4KBOffset, unsigned int devAddr, unsigned int autoCompletion)
 
void check_direct_tx_dma_done ()
 
void check_direct_rx_dma_done ()
 
void check_auto_tx_dma_done ()
 
void check_auto_rx_dma_done ()
 
unsigned int check_auto_tx_dma_partial_done (unsigned int tailIndex, unsigned int tailAssistIndex)
 
unsigned int check_auto_rx_dma_partial_done (unsigned int tailIndex, unsigned int tailAssistIndex)
 

Variables

NVME_CONTEXT g_nvmeTask
 
HOST_DMA_STATUS g_hostDmaStatus
 
HOST_DMA_ASSIST_STATUS g_hostDmaAssistStatus
 

Function Documentation

◆ check_auto_rx_dma_done()

void check_auto_rx_dma_done ( )

Definition at line 477 of file host_lld.c.

478{
480 {
482 }
483}
HOST_DMA_STATUS g_hostDmaStatus
Definition: host_lld.c:63
#define HOST_DMA_FIFO_CNT_REG_ADDR
Definition: host_lld.h:67
#define IO_READ32(addr)
Definition: io_access.h:51
unsigned int dword
Definition: host_lld.h:283
unsigned char autoDmaRx
Definition: host_lld.h:288
HOST_DMA_FIFO_CNT_REG fifoHead
Definition: host_lld.h:329
HOST_DMA_FIFO_CNT_REG fifoTail
Definition: host_lld.h:330

◆ check_auto_rx_dma_partial_done()

unsigned int check_auto_rx_dma_partial_done ( unsigned int  tailIndex,
unsigned int  tailAssistIndex 
)

Definition at line 524 of file host_lld.c.

525{
526 // xil_printf("check_auto_rx_dma_partial_done \r\n");
527
529
531 return 1;
532
533 if (g_hostDmaStatus.fifoHead.autoDmaRx < tailIndex)
534 {
535 if (g_hostDmaStatus.fifoTail.autoDmaRx < tailIndex)
536 {
538 return 1;
539 else if (g_hostDmaAssistStatus.autoDmaRxOverFlowCnt != (tailAssistIndex + 1))
540 return 1;
541 }
542 else if (g_hostDmaAssistStatus.autoDmaRxOverFlowCnt != tailAssistIndex)
543 return 1;
544 }
545 else if (g_hostDmaStatus.fifoHead.autoDmaRx == tailIndex)
546 return 1;
547 else
548 {
549 if (g_hostDmaStatus.fifoTail.autoDmaRx < tailIndex)
550 return 1;
551 else
552 {
554 return 1;
555 else if (g_hostDmaAssistStatus.autoDmaRxOverFlowCnt != tailAssistIndex)
556 return 1;
557 }
558 }
559
560 return 0;
561}
HOST_DMA_ASSIST_STATUS g_hostDmaAssistStatus
Definition: host_lld.c:64
unsigned int autoDmaRxOverFlowCnt
Definition: host_lld.h:340
Here is the caller graph for this function:

◆ check_auto_tx_dma_done()

void check_auto_tx_dma_done ( )

◆ check_auto_tx_dma_partial_done()

unsigned int check_auto_tx_dma_partial_done ( unsigned int  tailIndex,
unsigned int  tailAssistIndex 
)

Definition at line 485 of file host_lld.c.

486{
487 // xil_printf("check_auto_tx_dma_partial_done \r\n");
488
490
492 return 1;
493
494 if (g_hostDmaStatus.fifoHead.autoDmaTx < tailIndex)
495 {
496 if (g_hostDmaStatus.fifoTail.autoDmaTx < tailIndex)
497 {
499 return 1;
500 else if (g_hostDmaAssistStatus.autoDmaTxOverFlowCnt != (tailAssistIndex + 1))
501 return 1;
502 }
503 else if (g_hostDmaAssistStatus.autoDmaTxOverFlowCnt != tailAssistIndex)
504 return 1;
505 }
506 else if (g_hostDmaStatus.fifoHead.autoDmaTx == tailIndex)
507 return 1;
508 else
509 {
510 if (g_hostDmaStatus.fifoTail.autoDmaTx < tailIndex)
511 return 1;
512 else
513 {
515 return 1;
516 else if (g_hostDmaAssistStatus.autoDmaTxOverFlowCnt != tailAssistIndex)
517 return 1;
518 }
519 }
520
521 return 0;
522}
unsigned int autoDmaTxOverFlowCnt
Definition: host_lld.h:339
Here is the caller graph for this function:

◆ check_direct_rx_dma_done()

void check_direct_rx_dma_done ( )

◆ check_direct_tx_dma_done()

void check_direct_tx_dma_done ( )

Definition at line 453 of file host_lld.c.

Here is the caller graph for this function:

◆ check_nvme_cc_en()

unsigned int check_nvme_cc_en ( )

Definition at line 177 of file host_lld.c.

178{
179 NVME_STATUS_REG nvmeReg;
180
182
183 return (unsigned int)nvmeReg.ccEn;
184}
#define NVME_STATUS_REG_ADDR
Definition: host_lld.h:66
unsigned int ccEn
Definition: host_lld.h:155
unsigned int dword
Definition: host_lld.h:152
Here is the caller graph for this function:

◆ dev_irq_handler()

void dev_irq_handler ( )

Definition at line 86 of file host_lld.c.

87{
88 DEV_IRQ_REG devReg;
89 // Xil_ExceptionDisable();
90
93 // xil_printf("IRQ: 0x%X\r\n", devReg.dword);
94
95 if (devReg.pcieLink == 1)
96 {
97 PCIE_STATUS_REG pcieReg;
99 xil_printf("PCIe Link: %d\r\n", pcieReg.pcieLinkUp);
100 // set_link_width(0) //you can choose pcie lane width 0,2,4,8 mini board -> maximum 4, cosmos+ board ->
101 // maximum 8
102 if (pcieReg.pcieLinkUp == 0)
104 }
105
106 if (devReg.busMaster == 1)
107 {
108 PCIE_FUNC_REG pcieReg;
110 xil_printf("PCIe Bus Master: %d\r\n", pcieReg.busMaster);
111 }
112
113 if (devReg.pcieIrq == 1)
114 {
115 PCIE_FUNC_REG pcieReg;
117 xil_printf("PCIe IRQ Disable: %d\r\n", pcieReg.irqDisable);
118 }
119
120 if (devReg.pcieMsi == 1)
121 {
122 PCIE_FUNC_REG pcieReg;
124 xil_printf("PCIe MSI Enable: %d, 0x%x\r\n", pcieReg.msiEnable, pcieReg.msiVecNum);
125 }
126
127 if (devReg.pcieMsix == 1)
128 {
129 PCIE_FUNC_REG pcieReg;
131 xil_printf("PCIe MSI-X Enable: %d\r\n", pcieReg.msixEnable);
132 }
133
134 if (devReg.nvmeCcEn == 1)
135 {
136 NVME_STATUS_REG nvmeReg;
138 xil_printf("NVME CC.EN: %d\r\n", nvmeReg.ccEn);
139
140 if (nvmeReg.ccEn == 1)
142 else
144 }
145
146 if (devReg.nvmeCcShn == 1)
147 {
148 NVME_STATUS_REG nvmeReg;
150 xil_printf("NVME CC.SHN: %d\r\n", nvmeReg.ccShn);
151 if (nvmeReg.ccShn == 1)
153 }
154
155 if (devReg.mAxiWriteErr == 1)
156 {
157 xil_printf("mAxiWriteErr\r\n");
158 }
159
160 if (devReg.pcieMreqErr == 1)
161 {
162 xil_printf("pcieMreqErr\r\n");
163 }
164
165 if (devReg.pcieCpldErr == 1)
166 {
167 xil_printf("pcieCpldErr\r\n");
168 }
169
170 if (devReg.pcieCpldLenErr == 1)
171 {
172 xil_printf("pcieCpldLenErr\r\n");
173 }
174 // Xil_ExceptionEnable();
175}
NVME_CONTEXT g_nvmeTask
Definition: nvme_main.c:71
#define PCIE_STATUS_REG_ADDR
Definition: host_lld.h:63
#define DEV_IRQ_STATUS_REG_ADDR
Definition: host_lld.h:61
#define PCIE_FUNC_REG_ADDR
Definition: host_lld.h:64
#define DEV_IRQ_CLEAR_REG_ADDR
Definition: host_lld.h:60
#define IO_WRITE32(addr, val)
Definition: io_access.h:50
#define NVME_TASK_RESET
Definition: nvme.h:199
#define NVME_TASK_WAIT_CC_EN
Definition: nvme.h:195
#define NVME_TASK_SHUTDOWN
Definition: nvme.h:197
unsigned int busMaster
Definition: host_lld.h:99
unsigned int dword
Definition: host_lld.h:95
unsigned int pcieCpldErr
Definition: host_lld.h:108
unsigned int pcieLink
Definition: host_lld.h:98
unsigned int nvmeCcEn
Definition: host_lld.h:103
unsigned int nvmeCcShn
Definition: host_lld.h:104
unsigned int pcieMreqErr
Definition: host_lld.h:107
unsigned int mAxiWriteErr
Definition: host_lld.h:105
unsigned int pcieMsix
Definition: host_lld.h:102
unsigned int pcieIrq
Definition: host_lld.h:100
unsigned int pcieMsi
Definition: host_lld.h:101
unsigned int pcieCpldLenErr
Definition: host_lld.h:109
unsigned int ccShn
Definition: host_lld.h:156
unsigned int status
Definition: nvme.h:959
unsigned int busMaster
Definition: host_lld.h:137
unsigned int irqDisable
Definition: host_lld.h:140
unsigned int msiVecNum
Definition: host_lld.h:141
unsigned int dword
Definition: host_lld.h:134
unsigned int msixEnable
Definition: host_lld.h:139
unsigned int msiEnable
Definition: host_lld.h:138
unsigned int dword
Definition: host_lld.h:119
unsigned int pcieLinkUp
Definition: host_lld.h:124
Here is the caller graph for this function:

◆ dev_irq_init()

void dev_irq_init ( )

Definition at line 66 of file host_lld.c.

67{
68 DEV_IRQ_REG devReg;
69
70 devReg.dword = 0;
71 devReg.pcieLink = 1;
72 devReg.busMaster = 1;
73 devReg.pcieIrq = 1;
74 devReg.pcieMsi = 1;
75 devReg.pcieMsix = 1;
76 devReg.nvmeCcEn = 1;
77 devReg.nvmeCcShn = 1;
78 devReg.mAxiWriteErr = 1;
79 devReg.pcieMreqErr = 1;
80 devReg.pcieCpldErr = 1;
81 devReg.pcieCpldLenErr = 1;
82
84}
#define DEV_IRQ_MASK_REG_ADDR
Definition: host_lld.h:59
Here is the caller graph for this function:

◆ get_nvme_cmd()

unsigned int get_nvme_cmd ( unsigned short *  qID,
unsigned short *  cmdSlotTag,
unsigned int *  cmdSeqNum,
unsigned int *  cmdDword 
)

Definition at line 237 of file host_lld.c.

239{
240 NVME_CMD_FIFO_REG nvmeReg;
241
243
244 if (nvmeReg.cmdValid == 1)
245 {
246 unsigned int addr;
247 unsigned int idx;
248 *qID = nvmeReg.qID;
249 *cmdSlotTag = nvmeReg.cmdSlotTag;
250 *cmdSeqNum = nvmeReg.cmdSeqNum;
251 // xil_printf("nvmeReg.cmdSlotTag = 0x%X\r\n", nvmeReg.cmdSlotTag);
252 addr = NVME_CMD_SRAM_ADDR + (nvmeReg.cmdSlotTag * 64);
253 for (idx = 0; idx < 16; idx++)
254 *(cmdDword + idx) = IO_READ32(addr + (idx * 4));
255 }
256
257 return (unsigned int)nvmeReg.cmdValid;
258}
#define NVME_CMD_FIFO_REG_ADDR
Definition: host_lld.h:72
#define NVME_CMD_SRAM_ADDR
Definition: host_lld.h:76
unsigned int qID
Definition: host_lld.h:176
unsigned int cmdSeqNum
Definition: host_lld.h:180
unsigned int dword
Definition: host_lld.h:173
unsigned int cmdValid
Definition: host_lld.h:182
unsigned int cmdSlotTag
Definition: host_lld.h:178
Here is the caller graph for this function:

◆ pcie_async_reset()

void pcie_async_reset ( unsigned int  rstCnt)

Definition at line 186 of file host_lld.c.

187{
188 NVME_STATUS_REG nvmeReg;
189
190 nvmeReg.rstCnt = rstCnt;
191 xil_printf("rstCnt= %X \r\n", rstCnt);
193}
unsigned int rstCnt
Definition: host_lld.h:160
Here is the caller graph for this function:

◆ set_auto_nvme_cpl()

void set_auto_nvme_cpl ( unsigned int  cmdSlotTag,
unsigned int  specific,
unsigned int  statusFieldWord 
)

Definition at line 260 of file host_lld.c.

261{
262 NVME_CPL_FIFO_REG nvmeReg;
263
264 nvmeReg.specific = specific;
265 nvmeReg.cmdSlotTag = cmdSlotTag;
266 nvmeReg.statusFieldWord = statusFieldWord;
267 nvmeReg.cplType = AUTO_CPL_TYPE;
268
269 // IO_WRITE32(NVME_CPL_FIFO_REG_ADDR, nvmeReg.dword[0]);
270 IO_WRITE32((NVME_CPL_FIFO_REG_ADDR + 4), nvmeReg.dword[1]);
271 IO_WRITE32((NVME_CPL_FIFO_REG_ADDR + 8), nvmeReg.dword[2]);
272}
#define AUTO_CPL_TYPE
Definition: host_lld.h:85
#define NVME_CPL_FIFO_REG_ADDR
Definition: host_lld.h:73
unsigned short cplType
Definition: host_lld.h:206
unsigned short cmdSlotTag
Definition: host_lld.h:204
unsigned int specific
Definition: host_lld.h:202
unsigned int dword[3]
Definition: host_lld.h:192
unsigned short statusFieldWord
Definition: host_lld.h:210
Here is the caller graph for this function:

◆ set_auto_rx_dma()

void set_auto_rx_dma ( unsigned int  cmdSlotTag,
unsigned int  cmd4KBOffset,
unsigned int  devAddr,
unsigned int  autoCompletion 
)

Definition at line 419 of file host_lld.c.

421{
422 HOST_DMA_CMD_FIFO_REG hostDmaReg;
423 unsigned char tempTail;
424
425 ASSERT(cmd4KBOffset < 256);
426
430
431 hostDmaReg.devAddr = devAddr;
432
433 hostDmaReg.dword[3] = 0;
434 hostDmaReg.dmaType = HOST_DMA_AUTO_TYPE;
436 hostDmaReg.cmd4KBOffset = cmd4KBOffset;
437 hostDmaReg.cmdSlotTag = cmdSlotTag;
438 hostDmaReg.autoCompletion = autoCompletion;
439
441 // IO_WRITE32((HOST_DMA_CMD_FIFO_REG_ADDR + 4), hostDmaReg.dword[1]);
442 // IO_WRITE32((HOST_DMA_CMD_FIFO_REG_ADDR + 8), hostDmaReg.dword[2]);
443 IO_WRITE32((HOST_DMA_CMD_FIFO_REG_ADDR + 12), hostDmaReg.dword[3]);
444 IO_WRITE32((HOST_DMA_CMD_FIFO_REG_ADDR + 16), hostDmaReg.dword[4]); // slot_modified
445
447 if (tempTail > g_hostDmaStatus.fifoTail.autoDmaRx)
449
451}
#define ASSERT(cond,...)
Definition: debug.h:96
#define HOST_DMA_AUTO_TYPE
Definition: host_lld.h:79
#define HOST_DMA_RX_DIRECTION
Definition: host_lld.h:82
#define HOST_DMA_CMD_FIFO_REG_ADDR
Definition: host_lld.h:74
unsigned int devAddr
Definition: host_lld.h:302
unsigned int cmdSlotTag
Definition: host_lld.h:314
unsigned int cmd4KBOffset
Definition: host_lld.h:309
unsigned int autoCompletion
Definition: host_lld.h:308
unsigned int dword[5]
Definition: host_lld.h:299
unsigned int dmaType
Definition: host_lld.h:312
unsigned int dmaDirection
Definition: host_lld.h:311
unsigned int autoDmaRxCnt
Definition: host_lld.h:334
Here is the caller graph for this function:

◆ set_auto_tx_dma()

void set_auto_tx_dma ( unsigned int  cmdSlotTag,
unsigned int  cmd4KBOffset,
unsigned int  devAddr,
unsigned int  autoCompletion 
)

Definition at line 385 of file host_lld.c.

387{
388 HOST_DMA_CMD_FIFO_REG hostDmaReg;
389 unsigned char tempTail;
390
391 ASSERT(cmd4KBOffset < 256);
392
396
397 hostDmaReg.devAddr = devAddr;
398
399 hostDmaReg.dword[3] = 0;
400 hostDmaReg.dmaType = HOST_DMA_AUTO_TYPE;
402 hostDmaReg.cmd4KBOffset = cmd4KBOffset;
403 hostDmaReg.cmdSlotTag = cmdSlotTag;
404 hostDmaReg.autoCompletion = autoCompletion;
405
407 // IO_WRITE32((HOST_DMA_CMD_FIFO_REG_ADDR + 4), hostDmaReg.dword[1]);
408 // IO_WRITE32((HOST_DMA_CMD_FIFO_REG_ADDR + 8), hostDmaReg.dword[2]);
409 IO_WRITE32((HOST_DMA_CMD_FIFO_REG_ADDR + 12), hostDmaReg.dword[3]);
410 IO_WRITE32((HOST_DMA_CMD_FIFO_REG_ADDR + 16), hostDmaReg.dword[4]); // slot_modified
411
413 if (tempTail > g_hostDmaStatus.fifoTail.autoDmaTx)
415
417}
#define HOST_DMA_TX_DIRECTION
Definition: host_lld.h:81
unsigned int autoDmaTxCnt
Definition: host_lld.h:333
Here is the caller graph for this function:

◆ set_direct_rx_dma()

void set_direct_rx_dma ( unsigned int  devAddr,
unsigned int  pcieAddrH,
unsigned int  pcieAddrL,
unsigned int  len 
)

Definition at line 361 of file host_lld.c.

362{
363 HOST_DMA_CMD_FIFO_REG hostDmaReg;
364
365 ASSERT((len <= 0x1000) && ((pcieAddrL & 0x3) == 0)); // modified
366
367 hostDmaReg.devAddr = devAddr;
368 hostDmaReg.pcieAddrH = pcieAddrH;
369 hostDmaReg.pcieAddrL = pcieAddrL;
370
371 hostDmaReg.dword[3] = 0;
372 hostDmaReg.dmaType = HOST_DMA_DIRECT_TYPE;
374 hostDmaReg.dmaLen = len;
375
377 IO_WRITE32((HOST_DMA_CMD_FIFO_REG_ADDR + 4), hostDmaReg.dword[1]);
378 IO_WRITE32((HOST_DMA_CMD_FIFO_REG_ADDR + 8), hostDmaReg.dword[2]);
379 IO_WRITE32((HOST_DMA_CMD_FIFO_REG_ADDR + 12), hostDmaReg.dword[3]);
380 IO_WRITE32((HOST_DMA_CMD_FIFO_REG_ADDR + 16), hostDmaReg.dword[4]); // slot_modified
383}
#define HOST_DMA_DIRECT_TYPE
Definition: host_lld.h:78
unsigned int pcieAddrH
Definition: host_lld.h:303
unsigned int pcieAddrL
Definition: host_lld.h:304
unsigned int dmaLen
Definition: host_lld.h:307
unsigned int directDmaRxCnt
Definition: host_lld.h:332

◆ set_direct_tx_dma()

void set_direct_tx_dma ( unsigned int  devAddr,
unsigned int  pcieAddrH,
unsigned int  pcieAddrL,
unsigned int  len 
)

Definition at line 336 of file host_lld.c.

337{
338 HOST_DMA_CMD_FIFO_REG hostDmaReg;
339
340 ASSERT((len <= 0x1000) && ((pcieAddrL & 0x3) == 0)); // modified
341
342 hostDmaReg.devAddr = devAddr;
343 hostDmaReg.pcieAddrL = pcieAddrL;
344 hostDmaReg.pcieAddrH = pcieAddrH;
345
346 hostDmaReg.dword[3] = 0;
347 hostDmaReg.dmaType = HOST_DMA_DIRECT_TYPE;
349 hostDmaReg.dmaLen = len;
350
352 IO_WRITE32((HOST_DMA_CMD_FIFO_REG_ADDR + 4), hostDmaReg.dword[1]);
353 IO_WRITE32((HOST_DMA_CMD_FIFO_REG_ADDR + 8), hostDmaReg.dword[2]);
354 IO_WRITE32((HOST_DMA_CMD_FIFO_REG_ADDR + 12), hostDmaReg.dword[3]);
355 IO_WRITE32((HOST_DMA_CMD_FIFO_REG_ADDR + 16), hostDmaReg.dword[4]); // slot_modified
356
359}
unsigned int directDmaTxCnt
Definition: host_lld.h:331
Here is the caller graph for this function:

◆ set_io_cq()

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 
)

Definition at line 318 of file host_lld.c.

320{
321 NVME_IO_CQ_SET_REG nvmeReg;
322 unsigned int addr;
323
324 nvmeReg.valid = valid;
325 nvmeReg.irqEn = irqEn;
326 nvmeReg.irqVector = irqVector;
327 nvmeReg.cqSize = qSzie;
328 nvmeReg.pcieBaseAddrL = pcieBaseAddrL;
329 nvmeReg.pcieBaseAddrH = pcieBaseAddrH;
330
331 addr = NVME_IO_CQ_SET_REG_ADDR + (ioCqIdx * 8);
332 IO_WRITE32(addr, nvmeReg.dword[0]);
333 IO_WRITE32((addr + 4), nvmeReg.dword[1]);
334}
#define NVME_IO_CQ_SET_REG_ADDR
Definition: host_lld.h:70
unsigned int irqEn
Definition: host_lld.h:271
unsigned int irqVector
Definition: host_lld.h:270
unsigned int pcieBaseAddrL
Definition: host_lld.h:267
unsigned int valid
Definition: host_lld.h:269
unsigned int pcieBaseAddrH
Definition: host_lld.h:268
unsigned int cqSize
Definition: host_lld.h:273
unsigned int dword[2]
Definition: host_lld.h:264
Here is the caller graph for this function:

◆ set_io_sq()

void set_io_sq ( unsigned int  ioSqIdx,
unsigned int  valid,
unsigned int  cqVector,
unsigned int  qSzie,
unsigned int  pcieBaseAddrL,
unsigned int  pcieBaseAddrH 
)

Definition at line 301 of file host_lld.c.

303{
304 NVME_IO_SQ_SET_REG nvmeReg;
305 unsigned int addr;
306
307 nvmeReg.valid = valid;
308 nvmeReg.cqVector = cqVector;
309 nvmeReg.sqSize = qSzie;
310 nvmeReg.pcieBaseAddrL = pcieBaseAddrL;
311 nvmeReg.pcieBaseAddrH = pcieBaseAddrH;
312
313 addr = NVME_IO_SQ_SET_REG_ADDR + (ioSqIdx * 8);
314 IO_WRITE32(addr, nvmeReg.dword[0]);
315 IO_WRITE32((addr + 4), nvmeReg.dword[1]);
316}
#define NVME_IO_SQ_SET_REG_ADDR
Definition: host_lld.h:69
unsigned int sqSize
Definition: host_lld.h:254
unsigned int pcieBaseAddrH
Definition: host_lld.h:250
unsigned int cqVector
Definition: host_lld.h:252
unsigned int dword[2]
Definition: host_lld.h:246
unsigned int valid
Definition: host_lld.h:251
unsigned int pcieBaseAddrL
Definition: host_lld.h:249
Here is the caller graph for this function:

◆ set_link_width()

void set_link_width ( unsigned int  linkNum)

Definition at line 195 of file host_lld.c.

196{
197 NVME_STATUS_REG nvmeReg;
198
199 nvmeReg.linkNum = linkNum;
200 nvmeReg.linkEn = 1;
201 xil_printf("linkNum= %X \r\n", linkNum);
203}
unsigned int linkNum
Definition: host_lld.h:161
unsigned int linkEn
Definition: host_lld.h:162

◆ set_nvme_admin_queue()

void set_nvme_admin_queue ( unsigned int  sqValid,
unsigned int  cqValid,
unsigned int  cqIrqEn 
)

Definition at line 225 of file host_lld.c.

226{
228
230 nvmeReg.sqValid = sqValid;
231 nvmeReg.cqValid = cqValid;
232 nvmeReg.cqIrqEn = cqIrqEn;
233
235}
#define NVME_ADMIN_QUEUE_SET_REG_ADDR
Definition: host_lld.h:68
unsigned int cqIrqEn
Definition: host_lld.h:235
unsigned int cqValid
Definition: host_lld.h:233
unsigned int sqValid
Definition: host_lld.h:234
Here is the caller graph for this function:

◆ set_nvme_cpl()

void set_nvme_cpl ( unsigned int  sqId,
unsigned int  cid,
unsigned int  specific,
unsigned int  statusFieldWord 
)

Definition at line 286 of file host_lld.c.

287{
288 NVME_CPL_FIFO_REG nvmeReg;
289
290 nvmeReg.cid = cid;
291 nvmeReg.sqId = sqId;
292 nvmeReg.specific = specific;
293 nvmeReg.statusFieldWord = statusFieldWord;
294 nvmeReg.cplType = ONLY_CPL_TYPE;
295
297 IO_WRITE32((NVME_CPL_FIFO_REG_ADDR + 4), nvmeReg.dword[1]);
298 IO_WRITE32((NVME_CPL_FIFO_REG_ADDR + 8), nvmeReg.dword[2]);
299}
#define ONLY_CPL_TYPE
Definition: host_lld.h:84
unsigned int sqId
Definition: host_lld.h:198
unsigned int cid
Definition: host_lld.h:197
Here is the caller graph for this function:

◆ set_nvme_csts_rdy()

void set_nvme_csts_rdy ( unsigned int  rdy)

Definition at line 205 of file host_lld.c.

206{
207 NVME_STATUS_REG nvmeReg;
208
210 nvmeReg.cstsRdy = rdy;
211
213}
unsigned int cstsRdy
Definition: host_lld.h:158
Here is the caller graph for this function:

◆ set_nvme_csts_shst()

void set_nvme_csts_shst ( unsigned int  shst)

Definition at line 215 of file host_lld.c.

216{
217 NVME_STATUS_REG nvmeReg;
218
220 nvmeReg.cstsShst = shst;
221
223}
unsigned int cstsShst
Definition: host_lld.h:159
Here is the caller graph for this function:

◆ set_nvme_slot_release()

void set_nvme_slot_release ( unsigned int  cmdSlotTag)

Definition at line 274 of file host_lld.c.

275{
276 NVME_CPL_FIFO_REG nvmeReg;
277
278 nvmeReg.cmdSlotTag = cmdSlotTag;
280
281 // IO_WRITE32(NVME_CPL_FIFO_REG_ADDR, nvmeReg.dword[0]);
282 // IO_WRITE32((NVME_CPL_FIFO_REG_ADDR + 4), nvmeReg.dword[1]);
283 IO_WRITE32((NVME_CPL_FIFO_REG_ADDR + 8), nvmeReg.dword[2]);
284}
#define CMD_SLOT_RELEASE_TYPE
Definition: host_lld.h:86
Here is the caller graph for this function:

Variable Documentation

◆ g_hostDmaAssistStatus

HOST_DMA_ASSIST_STATUS g_hostDmaAssistStatus

Definition at line 64 of file host_lld.c.

◆ g_hostDmaStatus

HOST_DMA_STATUS g_hostDmaStatus

Definition at line 63 of file host_lld.c.

◆ g_nvmeTask

NVME_CONTEXT g_nvmeTask
extern

Definition at line 71 of file nvme_main.c.