112 for (wayNo = 0; wayNo <
USER_WAYS; ++wayNo)
213 unsigned int readyBusy, wayNo, reqStatus, nextWay, waitWayCnt;
352 pr_debug(
"Ch[%u]: No idle way can be used to issue new request ...", chNo);
525 assert(!
"[WARNING] wrong reqCode [WARNING]");
1015 unsigned int reqSlotTag, rowAddr;
1017 void *spareDataBufAddr;
1018 unsigned int *errorInfo;
1019 unsigned int *completion;
1070 assert(!
"[WARNING] not defined nand req [WARNING]");
1087 unsigned int rowAddr, lun, virtualBlockNo, tempBlockNo, phyBlockNo, tempPageNo, dieNo;
1123 assert(!
"[WARNING] wrong nand addr option [WARNING]");
1196 assert(!
"[WARNING] wrong reqOpt-dataBufFormat [WARNING]");
1199 assert(!
"[WARNING] wrong reqType [WARNING]");
1238 assert(!
"[WARNING] wrong reqOpt-dataBufFormat [WARNING]");
1241 assert(!
"[WARNING] wrong reqType [WARNING]");
1259 unsigned int reqSlotTag, completeFlag, statusReport, errorInfo, readyBusy, status;
1260 unsigned int *statusReportPtr;
1316 assert(!
"[WARNING] wrong request status check option [WARNING]");
1323 unsigned int errorInfo0, errorInfo1, reqSlotTag;
1388 unsigned int reqSlotTag, rowAddr, phyBlockNo;
1389 unsigned char *badCheck;
1428 pr_warn(
"Read Trigger FAIL on ");
1430 pr_warn(
"Read Transfer FAIL on ");
1437 pr_warn(
"ch %x way %x rowAddr 0x%x: completeFlag 0x%x statusReport 0x%x", chNo, wayNo, rowAddr,
1461 xil_printf(
"ECC Uncorrectable Soon on ch %x way %x rowAddr %x / completion %x statusReport %x \r\n",
1477 assert(!
"[WARNING] wrong req status [WARNING]");
void UpdatePhyBlockMapForGrownBadBlock(unsigned int dieNo, unsigned int phyBlockNo)
Mark the given physical block bad block and update the bbt later.
P_PHY_BLOCK_MAP phyBlockMapPtr
#define Vsa2VpageTranslation(virtualSliceAddr)
#define Pcw2VdieTranslation(chNo, wayNo)
Get die number from physical channel number and way number.
#define Vsa2VdieTranslation(virtualSliceAddr)
#define Vblock2PblockOfTbsTranslation(blockNo)
Get the PBA (in total block space) of the given VBN.
#define Vsa2VblockTranslation(virtualSliceAddr)
#define pr_debug(fmt,...)
T4REGS chCtlReg[USER_CHANNELS]
#define BIT_ERROR_THRESHOLD_PER_CHUNK
#define TOTAL_BLOCKS_PER_LUN
#define BYTES_PER_DATA_REGION_OF_SLICE
#define BYTES_PER_NVME_BLOCK
#define BYTES_PER_SPARE_REGION_OF_SLICE
#define PAGES_PER_MLC_BLOCK
#define MAIN_BLOCKS_PER_LUN
#define RESERVED_DATA_BUFFER_BASE_ADDR
#define ERROR_INFO_TABLE_ADDR
#define TEMPORARY_DATA_BUFFER_BASE_ADDR
#define STATUS_REPORT_TABLE_ADDR
#define SPARE_DATA_BUFFER_BASE_ADDR
#define RETRY_LIMIT_TABLE_ADDR
#define DIE_STATE_TABLE_ADDR
#define TEMPORARY_PAY_LOAD_ADDR
#define TEMPORARY_SPARE_DATA_BUFFER_BASE_ADDR
#define WAY_PRIORITY_TABLE_ADDR
#define DATA_BUFFER_BASE_ADDR
The base address of buffer for DMA requests.
#define COMPLETE_FLAG_TABLE_ADDR
void V2FReadPageTransferAsync(T4REGS *t4regs, int way, void *pageDataBuffer, void *spareDataBuffer, unsigned int *errorInformation, unsigned int *completion, unsigned int rowAddress)
void V2FReadPageTransferRawAsync(T4REGS *t4regs, int way, void *pageDataBuffer, unsigned int *completion)
void V2FReadPageTriggerAsync(T4REGS *t4regs, int way, unsigned int rowAddress)
#define V2FRequestReportDone(statusReport)
#define V2FEnterToggleMode(dev, way, payLoadAddr)
#define V2FIsControllerBusy(t4regs)
void V2FStatusCheckAsync(T4REGS *t4regs, int way, unsigned int *statusReport)
void V2FEraseBlockAsync(T4REGS *t4regs, int way, unsigned int rowAddress)
#define V2FCrcValid(errorInformation)
#define V2FRequestComplete(statusReport)
#define V2FRequestFail(statusReport)
void V2FProgramPageAsync(T4REGS *t4regs, int way, unsigned int rowAddress, void *pageDataBuffer, void *spareDataBuffer)
#define V2FTransferComplete(completeFlag)
#define V2FEliminateReportDoneFlag(statusReport)
#define V2FWorstChunkErrorCount(errorInformation)
unsigned int V2FReadyBusyAsync(T4REGS *t4regs)
#define V2FWayReady(readyBusy, wayNo)
void V2FResetSync(T4REGS *t4regs, int way)
unsigned int blockedReqCnt
NVME_DMA_REQUEST_QUEUE nvmeDmaReqQ
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.
unsigned int notCompletedNandReqCnt
NAND_REQUEST_QUEUE nandReqQ[USER_CHANNELS][USER_WAYS]
FREE_REQUEST_QUEUE freeReqQ
#define REQ_SLOT_TAG_NONE
unsigned int GenerateDataBufAddr(unsigned int reqSlotTag)
Get the corresponding data buffer entry address of the given request.
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.
void IssueNandReq(unsigned int chNo, unsigned int wayNo)
Issue a flash operations to the storage controller.
P_RETRY_LIMIT_TABLE retryLimitTablePtr
P_COMPLETE_FLAG_TABLE completeFlagTablePtr
P_DIE_STATE_TABLE dieStateTablePtr
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.
void SyncAvailFreeReq()
Try release request entries by doing scheduling (both NVMe and NAND).
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.
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.
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.
void PutToNandIdleList(unsigned int chNo, unsigned int wayNo)
Append the specified die to the tail of the idle list of its channel.
P_STATUS_REPORT_TABLE statusReportTablePtr
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.
void SchedulingNandReq()
Iteratively do schedule on each channel by calling SchedulingNandReqPerCh.
struct _STATUS_REPORT_TABLE * P_STATUS_REPORT_TABLE
struct _ERROR_INFO_TABLE * P_ERROR_INFO_TABLE
struct _RETRY_LIMIT_TABLE * P_RETRY_LIMIT_TABLE
#define REQ_STATUS_CHECK_OPT_COMPLETION_FLAG
#define ERROR_INFO_WARNING
#define REQ_STATUS_RUNNING
struct _COMPLETE_FLAG_TABLE * P_COMPLETE_FLAG_TABLE
struct _WAY_PRIORITY_TABLE * P_WAY_PRIORITY_TABLE
#define REQ_STATUS_CHECK_OPT_NONE
struct _DIE_STATE_TABLE * P_DIE_STATE_TABLE
#define PSEUDO_BAD_BLOCK_MARK
#define REQ_STATUS_CHECK_OPT_REPORT
#define REQ_STATUS_CHECK_OPT_CHECK
#define REQ_STATUS_WARNING
#define RETRY_LIMIT
The max number of times a request can retry if it failed.
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]
unsigned int physicalBlock
unsigned int physicalPage
unsigned int virtualSliceAddr
unsigned int nvmeBlockOffset
unsigned int remappedPhyBlock
PHY_BLOCK_ENTRY phyBlock[USER_DIES][TOTAL_BLOCKS_PER_DIE]
unsigned int nandEccWarning
unsigned int dataBufFormat
Type of address stored in the SSD_REQ_FORMAT::dataBufInfo.
unsigned int nandAddr
Type of address stored in the SSD_REQ_FORMAT::nandInfo.
SSD_REQ_FORMAT reqPool[AVAILABLE_OUNTSTANDING_REQ_COUNT]
int retryLimit[USER_CHANNELS][USER_WAYS]
unsigned int blockedEraseReqFlag
ROW_ADDR_DEPENDENCY_ENTRY block[USER_CHANNELS][USER_WAYS][MAIN_BLOCKS_PER_DIE]
unsigned int statusReport[USER_CHANNELS][USER_WAYS]
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]