OpenSSD Cosmos+ Platform Firmware
0.0.2
The firmware of Cosmos+ OpenSSD Platform for TOSHIBA nand flash module.
|
Go to the source code of this file.
Functions | |
void | InitReqPool () |
Initialize the request pool and the request queues. More... | |
void | PutToFreeReqQ (unsigned int reqSlotTag) |
Add the given request to the free request queue. More... | |
unsigned int | GetFromFreeReqQ () |
Get a free request from the free request queue. More... | |
void | PutToSliceReqQ (unsigned int reqSlotTag) |
Add the given request to the slice request queue. More... | |
unsigned int | GetFromSliceReqQ () |
Get a slice request from the slice request queue. More... | |
void | PutToBlockedByBufDepReqQ (unsigned int reqSlotTag) |
Add the given request to blockedByBufDepReqQ . More... | |
void | SelectiveGetFromBlockedByBufDepReqQ (unsigned int reqSlotTag) |
Remove the given request from the blockedByBufDepReqQ . More... | |
void | PutToBlockedByRowAddrDepReqQ (unsigned int reqSlotTag, unsigned int chNo, unsigned int wayNo) |
Add the given request to blockedByRowAddrDepReqQ . More... | |
void | SelectiveGetFromBlockedByRowAddrDepReqQ (unsigned int reqSlotTag, unsigned int chNo, unsigned int wayNo) |
Remove the given request from the blockedByRowAddrDepReqQ . More... | |
void | PutToNvmeDmaReqQ (unsigned int reqSlotTag) |
Add the given request to the NVMe DMA request queue and update its status. More... | |
void | SelectiveGetFromNvmeDmaReqQ (unsigned int reqSlotTag) |
Move the specified entry from the nvmeDmaReqQ to the freeReqQ . More... | |
void | PutToNandReqQ (unsigned int reqSlotTag, unsigned chNo, unsigned wayNo) |
Add the given request to nandReqQ of the specified die. More... | |
void | GetFromNandReqQ (unsigned int chNo, unsigned int wayNo, unsigned int reqStatus, unsigned int reqCode) |
Move the head request of the specified nandReqQ queue to freeReqQ . More... | |
unsigned int GetFromFreeReqQ | ( | ) |
Get a free request from the free request queue.
Try to get the first entry (FIFO) from the free queue. If the freeReqQ
is empty, use the function SyncAvailFreeReq()
to release some requests and recycle the request pool entries occupied by them.
Definition at line 172 of file request_allocation.c.
void GetFromNandReqQ | ( | unsigned int | chNo, |
unsigned int | wayNo, | ||
unsigned int | reqStatus, | ||
unsigned int | reqCode | ||
) |
Move the head request of the specified nandReqQ
queue to freeReqQ
.
Similar to GetFromSliceReqQ()
and SelectiveGetFromNvmeDmaReqQ()
.
reqStatus
and reqCode
not usedchNo | the target channel |
wayNo | the target way |
reqStatus | the status of the previous request executed on the specified die. |
reqCode | the command code of the request attempt to execute on the specified die. |
Definition at line 548 of file request_allocation.c.
unsigned int GetFromSliceReqQ | ( | ) |
Get a slice request from the slice request queue.
Try to pop the first request of the slice request queue.
REQ_SLOT_TAG_FAIL
if the slice request queue is empty. Definition at line 241 of file request_allocation.c.
void InitReqPool | ( | ) |
Initialize the request pool and the request queues.
At the beginning, all the requests are stored in the freeReqQ
, therefore the size of freeReqQ
should equal to the size of request pool, and the others request queue will be initialized to be empty.
After all the queues are initialized, we next have to initialize the request pool:
freeReqQ
by defaultprevBlockingReq
and nextBlockingReq
should be NONE Definition at line 77 of file request_allocation.c.
void PutToBlockedByBufDepReqQ | ( | unsigned int | reqSlotTag | ) |
Add the given request to blockedByBufDepReqQ
.
Similar to PutToFreeReqQ()
.
blockedReqCnt
should also be increased.reqSlotTag | the request pool entry index of the request to be added |
Definition at line 277 of file request_allocation.c.
void PutToBlockedByRowAddrDepReqQ | ( | unsigned int | reqSlotTag, |
unsigned int | chNo, | ||
unsigned int | wayNo | ||
) |
Add the given request to blockedByRowAddrDepReqQ
.
Similar to PutToBlockedByBufDepReqQ()
.
blockedReqCnt
thus should also be increased.reqSlotTag | the request pool entry index of the request to be added. |
chNo | the channel number of the specified queue. |
wayNo | the die number of the specified queue. |
Definition at line 357 of file request_allocation.c.
void PutToFreeReqQ | ( | unsigned int | reqSlotTag | ) |
Add the given request to the free request queue.
Insert the given request into the tail of the free queue and update the corresponding field of the given request.
prevReq
of the next request in the original request queue. That is, the prev request entry index of the original next request may still be reqSlotTag
.prevBlockingReq
and nextBlockingReq
of the original request.reqSlotTag | the request pool entry index of the request to be added. |
Definition at line 142 of file request_allocation.c.
void PutToNandReqQ | ( | unsigned int | reqSlotTag, |
unsigned | chNo, | ||
unsigned | wayNo | ||
) |
Add the given request to nandReqQ
of the specified die.
Similar to PutToFreeReqQ()
.
reqSlotTag | the request pool entry index of the request to be added. |
chNo | the channel number of the specified queue. |
wayNo | the die number of the specified queue. |
Definition at line 512 of file request_allocation.c.
void PutToNvmeDmaReqQ | ( | unsigned int | reqSlotTag | ) |
Add the given request to the NVMe DMA request queue and update its status.
Similar to PutToFreeReqQ()
.
reqSlotTag | the request pool entry index of the request to be added |
Definition at line 431 of file request_allocation.c.
void PutToSliceReqQ | ( | unsigned int | reqSlotTag | ) |
Add the given request to the slice request queue.
Similar to PutToFreeReqQ()
.
reqSlotTag | the request pool entry index of the request to be added |
Definition at line 210 of file request_allocation.c.
void SelectiveGetFromBlockedByBufDepReqQ | ( | unsigned int | reqSlotTag | ) |
Remove the given request from the blockedByBufDepReqQ
.
Similar to GetFromSliceReqQ()
, but the entry to be removed is specified by the param reqSlotTag
.
blockedReqCnt
reqSlotTag | the request pool entry index of the request to be removed |
Definition at line 309 of file request_allocation.c.
void SelectiveGetFromBlockedByRowAddrDepReqQ | ( | unsigned int | reqSlotTag, |
unsigned int | chNo, | ||
unsigned int | wayNo | ||
) |
Remove the given request from the blockedByRowAddrDepReqQ
.
Similar to SelectiveGetFromBlockedByBufDepReqQ()
.
reqSlotTag | the request pool entry index of the request to be removed. |
chNo | the channel number of the specified queue. |
wayNo | the die number of the specified queue. |
Definition at line 388 of file request_allocation.c.
void SelectiveGetFromNvmeDmaReqQ | ( | unsigned int | reqSlotTag | ) |
Move the specified entry from the nvmeDmaReqQ
to the freeReqQ
.
Remove the given request entry from the NVMe DMA request queue, and then insert into the free request queue.
PutToFreeReqQ()
and its friends won't modify the prevBlockingReq
and the nextBlockingReq
of the specified request entry, therefore after request being added to free request queue, we should also try to remove the specified request from the blocking request by calling the function ReleaseBlockedByBufDepReq()
. // FIXMEreqSlotTag | the request pool entry index of the request to be removed |
Definition at line 465 of file request_allocation.c.
BLOCKED_BY_BUFFER_DEPENDENCY_REQUEST_QUEUE blockedByBufDepReqQ |
Definition at line 53 of file request_allocation.c.
BLOCKED_BY_ROW_ADDR_DEPENDENCY_REQUEST_QUEUE blockedByRowAddrDepReqQ[USER_CHANNELS][USER_WAYS] |
Definition at line 54 of file request_allocation.c.
unsigned int blockedReqCnt |
Definition at line 59 of file request_allocation.c.
FREE_REQUEST_QUEUE freeReqQ |
Definition at line 51 of file request_allocation.c.
NAND_REQUEST_QUEUE nandReqQ[USER_CHANNELS][USER_WAYS] |
Definition at line 56 of file request_allocation.c.
unsigned int notCompletedNandReqCnt |
Definition at line 58 of file request_allocation.c.
NVME_DMA_REQUEST_QUEUE nvmeDmaReqQ |
Definition at line 55 of file request_allocation.c.
P_REQ_POOL reqPoolPtr |
Definition at line 50 of file request_allocation.c.
SLICE_REQUEST_QUEUE sliceReqQ |
Definition at line 52 of file request_allocation.c.