47#ifndef REQUEST_SCHEDULE_H_
48#define REQUEST_SCHEDULE_H_
54#define LUN_0_BASE_ADDR 0x00000000
55#define LUN_1_BASE_ADDR 0x00100000
57#define PSEUDO_BAD_BLOCK_MARK 0
68#define DIE_STATE_IDLE 0
69#define DIE_STATE_EXE 1
71#define REQ_STATUS_CHECK_OPT_NONE 0
72#define REQ_STATUS_CHECK_OPT_CHECK 1
73#define REQ_STATUS_CHECK_OPT_REPORT 2
74#define REQ_STATUS_CHECK_OPT_COMPLETION_FLAG 3
80#define REQ_STATUS_RUNNING 0
81#define REQ_STATUS_DONE 1
82#define REQ_STATUS_FAIL 2
83#define REQ_STATUS_WARNING 3
85#define ERROR_INFO_FAIL 0
86#define ERROR_INFO_PASS 1
87#define ERROR_INFO_WARNING 2
210void IssueNandReq(
unsigned int chNo,
unsigned int wayNo);
214unsigned int CheckReqStatus(
unsigned int chNo,
unsigned int wayNo);
217void ExecuteNandReq(
unsigned int chNo,
unsigned int wayNo,
unsigned int reqStatus);
#define ERROR_INFO_WORD_COUNT
unsigned int GenerateDataBufAddr(unsigned int reqSlotTag)
Get the corresponding data buffer entry address of the given request.
struct _WAY_PRIORITY_ENTRY WAY_PRIORITY_ENTRY
The way priority table of this channel.
void SyncReleaseEraseReq(unsigned int chNo, unsigned int wayNo, unsigned int blockNo)
Issuing requests until the specified block can be erased.
void PutToNandEraseList(unsigned int chNo, unsigned int wayNo)
Append the specified die to the tail of the erase list of its channel.
struct _STATUS_REPORT_TABLE * P_STATUS_REPORT_TABLE
struct _ERROR_INFO_TABLE * P_ERROR_INFO_TABLE
struct _STATUS_REPORT_TABLE STATUS_REPORT_TABLE
void IssueNandReq(unsigned int chNo, unsigned int wayNo)
Issue a flash operations to the storage controller.
struct _RETRY_LIMIT_TABLE * P_RETRY_LIMIT_TABLE
P_RETRY_LIMIT_TABLE retryLimitTablePtr
P_DIE_STATE_TABLE dieStatusTablePtr
P_COMPLETE_FLAG_TABLE completeFlagTablePtr
void SelectiveGetFromNandReadTriggerList(unsigned int chNo, unsigned int wayNo)
Remove the specified die from the read trigger list of its channel.
void SelectivGetFromNandIdleList(unsigned int chNo, unsigned int wayNo)
Remove the specified die from the idle list of its channel.
void SyncAllLowLevelReqDone()
Do schedule until all the requests are done.
void InitReqScheduler()
Initialize scheduling related tables.
void SelectivGetFromNandStatusReportList(unsigned int chNo, unsigned int wayNo)
Remove the specified die from the status report list of its channel.
unsigned int GenerateSpareDataBufAddr(unsigned int reqSlotTag)
Get the corresponding sparse data buffer entry address of the given request.
void PutToNandReadTriggerList(unsigned int chNo, unsigned int wayNo)
Append the specified die to the tail of the read trigger list of its channel.
struct _COMPLETE_FLAG_TABLE * P_COMPLETE_FLAG_TABLE
void SyncAvailFreeReq()
Try release request entries by doing scheduling (both NVMe and NAND).
struct _WAY_PRIORITY_TABLE * P_WAY_PRIORITY_TABLE
struct _RETRY_LIMIT_TABLE RETRY_LIMIT_TABLE
unsigned int CheckEccErrorInfo(unsigned int chNo, unsigned int wayNo)
unsigned int CheckReqStatus(unsigned int chNo, unsigned int wayNo)
Update the die status and return the request status.
void SchedulingNandReqPerCh(unsigned int chNo)
The main function to schedule NAND requests on the specified channel.
P_WAY_PRIORITY_TABLE wayPriorityTablePtr
void PutToNandStatusReportList(unsigned int chNo, unsigned int wayNo)
Append the specified die to the tail of the status report list of its channel.
void SelectiveGetFromNandWriteList(unsigned int chNo, unsigned int wayNo)
Remove the specified die from the write list of its channel.
struct _DIE_STATE_TABLE * P_DIE_STATE_TABLE
void PutToNandWayPriorityTable(unsigned int reqSlotTag, unsigned int chNo, unsigned int wayNo)
Append the specified die to a NAND state list based on the request type of the given request.
struct _WAY_PRIORITY_TABLE WAY_PRIORITY_TABLE
The channel status table, each entry contains 7 lists.
void PutToNandStatusCheckList(unsigned int chNo, unsigned int wayNo)
Append the specified die to the tail of the status check list of its channel.
void SelectiveGetFromNandEraseList(unsigned int chNo, unsigned int wayNo)
Remove the specified die from the erase list of its channel.
void PutToNandWriteList(unsigned int chNo, unsigned int wayNo)
Append the specified die to the tail of the write list of its channel.
void ExecuteNandReq(unsigned int chNo, unsigned int wayNo, unsigned int reqStatus)
Update die state and issue new NAND requests if the die is in IDLE state.
P_ERROR_INFO_TABLE eccErrorInfoTablePtr
void SelectiveGetFromNandReadTransferList(unsigned int chNo, unsigned int wayNo)
Remove the specified die from the read transfer list of its channel.
struct _DIE_STATE_ENTRY * P_DIE_STATE_ENTRY
struct _WAY_PRIORITY_ENTRY * P_WAY_PRIORITY_ENTRY
void PutToNandIdleList(unsigned int chNo, unsigned int wayNo)
Append the specified die to the tail of the idle list of its channel.
struct _DIE_STATE_TABLE DIE_STATE_TABLE
The status table of each die on the flash memory.
P_STATUS_REPORT_TABLE statusReportTablePtr
struct _ERROR_INFO_TABLE ERROR_INFO_TABLE
unsigned int GenerateNandRowAddr(unsigned int reqSlotTag)
Get the nand row (block) address of the given request.
void PutToNandReadTransferList(unsigned int chNo, unsigned int wayNo)
Append the specified die to the tail of the read transfer list of its channel.
void SelectiveGetFromNandStatusCheckList(unsigned int chNo, unsigned int wayNo)
Remove the specified die from the status check list of its channel.
struct _COMPLETE_FLAG_TABLE COMPLETE_FLAG_TABLE
void SchedulingNandReq()
Iteratively do schedule on each channel by calling SchedulingNandReqPerCh.
struct _DIE_STATE_ENTRY DIE_STATE_ENTRY
unsigned int completeFlag[USER_CHANNELS][USER_WAYS]
unsigned int reqStatusCheckOpt
The status table of each die on the flash memory.
DIE_STATE_ENTRY dieState[USER_CHANNELS][USER_WAYS]
unsigned int errorInfo[USER_CHANNELS][USER_WAYS][ERROR_INFO_WORD_COUNT]
int retryLimit[USER_CHANNELS][USER_WAYS]
unsigned int statusReport[USER_CHANNELS][USER_WAYS]
The way priority table of this channel.
unsigned int readTransferHead
unsigned int readTriggerHead
unsigned int statusCheckTail
unsigned int statusReportHead
unsigned int statusCheckHead
unsigned int readTransferTail
unsigned int statusReportTail
unsigned int readTriggerTail
The channel status table, each entry contains 7 lists.
WAY_PRIORITY_ENTRY wayPriority[USER_CHANNELS]