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.
Data Structures | |
struct | _LOGICAL_SLICE_ENTRY |
Exactly the Virtual Slice Address. More... | |
struct | _LOGICAL_SLICE_MAP |
The Logical -> Virtual Slice Address mapping table. More... | |
struct | _VIRTUAL_SLICE_ENTRY |
Exactly the Logical Slice Address. More... | |
struct | _VIRTUAL_SLICE_MAP |
The Virtual -> Logical Slice mapping table. More... | |
struct | _VIRTUAL_BLOCK_ENTRY |
The metadata for this block. More... | |
struct | _VIRTUAL_BLOCK_MAP |
The block metadata table for all the blocks. More... | |
struct | _VIRTUAL_DIE_ENTRY |
The metadata for this die. More... | |
struct | _VIRTUAL_DIE_MAP |
The metadata table for all user dies. More... | |
struct | _FRRE_BLOCK_ALLOCATION_LIST |
struct | _BAD_BLOCK_TABLE_INFO_ENTRY |
The bad block table for this die. More... | |
struct | _BAD_BLOCK_TABLE_INFO_MAP |
The bad block tables. More... | |
struct | _PHY_BLOCK_ENTRY |
The metadata of the physical block. More... | |
struct | _PHY_BLOCK_MAP |
The metadata table for all the physical blocks. More... | |
Macros | |
#define | LSA_NONE 0xffffffff |
#define | LSA_FAIL 0xffffffff |
#define | VSA_NONE 0xffffffff |
#define | VSA_FAIL 0xffffffff |
#define | PAGE_NONE 0xffff |
#define | BLOCK_NONE 0xffff |
#define | BLOCK_FAIL 0xffff |
#define | DIE_NONE 0xff |
#define | DIE_FAIL 0xff |
#define | RESERVED_FREE_BLOCK_COUNT 0x1 |
#define | GET_FREE_BLOCK_NORMAL 0x0 |
#define | GET_FREE_BLOCK_GC 0x1 |
#define | BLOCK_STATE_NORMAL 0 |
#define | BLOCK_STATE_BAD 1 |
#define | DIE_STATE_BAD_BLOCK_TABLE_NOT_EXIST 0 |
#define | DIE_STATE_BAD_BLOCK_TABLE_EXIST 1 |
#define | DIE_STATE_BAD_BLOCK_TABLE_HOLD 2 |
#define | DIE_STATE_BAD_BLOCK_TABLE_UPDATE 3 |
#define | BAD_BLOCK_TABLE_MAKER_IDLE 0 |
#define | BAD_BLOCK_TABLE_MAKER_TRIGGER 1 |
#define | CLEAN_DATA_IN_BYTE 0xff |
#define | USED_PAGES_FOR_BAD_BLOCK_TABLE_PER_DIE (TOTAL_BLOCKS_PER_DIE / BYTES_PER_DATA_REGION_OF_PAGE + 1) |
#define | DATA_SIZE_OF_BAD_BLOCK_TABLE_PER_DIE (TOTAL_BLOCKS_PER_DIE) |
#define | START_PAGE_NO_OF_BAD_BLOCK_TABLE_BLOCK (1) |
The start physical page number that stored the bbt of this die. More... | |
#define | BBT_INFO_GROWN_BAD_UPDATE_NONE 0 |
#define | BBT_INFO_GROWN_BAD_UPDATE_BOOKED 1 |
#define | Vsa2VdieTranslation(virtualSliceAddr) ((virtualSliceAddr) % (USER_DIES)) |
#define | Vsa2VblockTranslation(virtualSliceAddr) (((virtualSliceAddr) / (USER_DIES)) / (SLICES_PER_BLOCK)) |
#define | Vsa2VpageTranslation(virtualSliceAddr) (((virtualSliceAddr) / (USER_DIES)) % (SLICES_PER_BLOCK)) |
#define | Vorg2VsaTranslation(dieNo, blockNo, pageNo) ((dieNo) + (USER_DIES) * ((blockNo) * (SLICES_PER_BLOCK) + (pageNo))) |
Translate virtual NAND organization (location vector) into VSA. More... | |
#define | Vdie2PchTranslation(dieNo) ((dieNo) % (USER_CHANNELS)) |
#define | Vdie2PwayTranslation(dieNo) ((dieNo) / (USER_CHANNELS)) |
#define | Vblock2PblockOfTbsTranslation(blockNo) (((blockNo) / (USER_BLOCKS_PER_LUN)) * (TOTAL_BLOCKS_PER_LUN) + ((blockNo) % (USER_BLOCKS_PER_LUN))) |
Get the PBA (in total block space) of the given VBN. More... | |
#define | Vblock2PblockOfMbsTranslation(blockNo) (((blockNo) / (USER_BLOCKS_PER_LUN)) * (MAIN_BLOCKS_PER_LUN) + ((blockNo) % (USER_BLOCKS_PER_LUN))) |
The V2P block mapping rule (main block space). More... | |
#define | Vpage2PlsbPageTranslation(pageNo) ((pageNo) > (0) ? (2 * (pageNo)-1) : (0)) |
Map the virtual page to the physical LSB page in SLC mode. More... | |
#define | Pcw2VdieTranslation(chNo, wayNo) ((chNo) + (wayNo) * (USER_CHANNELS)) |
Get die number from physical channel number and way number. More... | |
#define | PlsbPage2VpageTranslation(pageNo) ((pageNo) > (0) ? (((pageNo) + 1) / 2) : (0)) |
Get the corresponding virtual page number of the given LSB page number. More... | |
#define | VDIE_ENTRY(iDie) (&virtualDieMapPtr->die[(iDie)]) |
#define | VDIE_PREV_IDX(iDie) (VDIE_ENTRY((iDie))->prevDie) |
#define | VDIE_NEXT_IDX(iDie) (VDIE_ENTRY((iDie))->nextDie) |
#define | VDIE_PREV_ENTRY(iDie) (VDIE_ENTRY(VDIE_PREV_IDX((iDie)))) |
#define | VDIE_NEXT_ENTRY(iDie) (VDIE_ENTRY(VDIE_NEXT_IDX((iDie)))) |
#define | VBLK_ENTRY(iDie, iBlk) (&virtualBlockMapPtr->block[(iDie)][(iBlk)]) |
#define | VBLK_PREV_IDX(iDie, iBlk) (VBLK_ENTRY((iDie), (iBlk))->prevBlock) |
#define | VBLK_NEXT_IDX(iDie, iBlk) (VBLK_ENTRY((iDie), (iBlk))->nextBlock) |
#define | VBLK_PREV_ENTRY(iDie, iBlk) (VBLK_ENTRY((iDie), VBLK_PREV_IDX((iDie), (iBlk)))) |
#define | VBLK_NEXT_ENTRY(iDie, iBlk) (VBLK_ENTRY((iDie), VBLK_NEXT_IDX((iDie), (iBlk)))) |
#define | PBLK_ENTRY(iDie, iBlk) (&phyBlockMapPtr->phyBlock[(iDie)][(iBlk)]) |
#define | LSA_ENTRY(lsa) (&logicalSliceMapPtr->logicalSlice[(lsa)]) |
#define | VSA_ENTRY(vsa) (&virtualSliceMapPtr->virtualSlice[(vsa)]) |
#define | LSA2VSA(lsa) (LSA_ENTRY((lsa))->virtualSliceAddr) |
#define | VSA2LSA(vsa) (VSA_ENTRY((vsa))->logicalSliceAddr) |
#define | VDIE2PCH(iDie) (Vdie2PchTranslation((iDie))) |
#define | VDIE2PWAY(iDie) (Vdie2PwayTranslation((iDie))) |
#define | VSA2VDIE(vsa) (Vsa2VdieTranslation((vsa))) |
#define | VSA2VBLK(vsa) (Vsa2VblockTranslation((vsa))) |
#define | VSA2VPAGE(vsa) (Vsa2VpageTranslation((vsa))) |
#define | VBA2PBA_MBS(vba) (Vblock2PblockOfMbsTranslation((vba))) |
#define | VBA2PBA_TBS(vba) (Vblock2PblockOfTbsTranslation((vba))) |
#define | VORG2VSA(iDie, iBlk, iPage) (Vorg2VsaTranslation((iDie), (iBlk), (iPage))) |
#define | PCH2VDIE(iCh, iWay) (Pcw2VdieTranslation((iCh), (iWay))) |
Functions | |
void | InitAddressMap () |
Initialize the translation related maps. More... | |
void | InitSliceMap () |
Initialize Logical and Virtual Slick Map. More... | |
void | InitBlockDieMap () |
Build the bad block table and V2P block mapping of each user die. More... | |
unsigned int | AddrTransRead (unsigned int logicalSliceAddr) |
Get the virtual slice address of the given logical slice. More... | |
unsigned int | AddrTransWrite (unsigned int logicalSliceAddr) |
Assign a new virtual (physical) page to the specified logical page. More... | |
unsigned int | FindFreeVirtualSlice () |
Select a free physical page (virtual slice). More... | |
unsigned int | FindFreeVirtualSliceForGc (unsigned int copyTargetDieNo, unsigned int victimBlockNo) |
unsigned int | FindDieForFreeSliceAllocation () |
Update and get the die number to serve the next write request. More... | |
void | InvalidateOldVsa (unsigned int logicalSliceAddr) |
Invalidate the specified virtual page. More... | |
void | EraseBlock (unsigned int dieNo, unsigned int blockNo) |
Erase the specified block of the specified die and discard its LSAs. More... | |
void | PutToFbList (unsigned int dieNo, unsigned int blockNo) |
Append the given virtual block to the free block list of its die. More... | |
unsigned int | GetFromFbList (unsigned int dieNo, unsigned int getFreeBlockOption) |
Pop the first block in the free block list of the specified die. More... | |
void | UpdatePhyBlockMapForGrownBadBlock (unsigned int dieNo, unsigned int phyBlockNo) |
Mark the given physical block bad block and update the bbt later. More... | |
void | UpdateBadBlockTableForGrownBadBlock (unsigned int tempBufAddr) |
Update the bad block table and persist to the specified block. More... | |
#define BAD_BLOCK_TABLE_MAKER_IDLE 0 |
Definition at line 81 of file address_translation.h.
#define BAD_BLOCK_TABLE_MAKER_TRIGGER 1 |
Definition at line 82 of file address_translation.h.
#define BBT_INFO_GROWN_BAD_UPDATE_BOOKED 1 |
Definition at line 101 of file address_translation.h.
#define BBT_INFO_GROWN_BAD_UPDATE_NONE 0 |
Definition at line 100 of file address_translation.h.
#define BLOCK_FAIL 0xffff |
Definition at line 63 of file address_translation.h.
#define BLOCK_NONE 0xffff |
Definition at line 62 of file address_translation.h.
#define BLOCK_STATE_BAD 1 |
Definition at line 74 of file address_translation.h.
#define BLOCK_STATE_NORMAL 0 |
Definition at line 73 of file address_translation.h.
#define CLEAN_DATA_IN_BYTE 0xff |
Definition at line 84 of file address_translation.h.
#define DATA_SIZE_OF_BAD_BLOCK_TABLE_PER_DIE (TOTAL_BLOCKS_PER_DIE) |
Definition at line 88 of file address_translation.h.
#define DIE_FAIL 0xff |
Definition at line 66 of file address_translation.h.
#define DIE_NONE 0xff |
Definition at line 65 of file address_translation.h.
#define DIE_STATE_BAD_BLOCK_TABLE_EXIST 1 |
Definition at line 77 of file address_translation.h.
#define DIE_STATE_BAD_BLOCK_TABLE_HOLD 2 |
Definition at line 78 of file address_translation.h.
#define DIE_STATE_BAD_BLOCK_TABLE_NOT_EXIST 0 |
Definition at line 76 of file address_translation.h.
#define DIE_STATE_BAD_BLOCK_TABLE_UPDATE 3 |
Definition at line 79 of file address_translation.h.
#define GET_FREE_BLOCK_GC 0x1 |
Definition at line 71 of file address_translation.h.
#define GET_FREE_BLOCK_NORMAL 0x0 |
Definition at line 70 of file address_translation.h.
#define LSA2VSA | ( | lsa | ) | (LSA_ENTRY((lsa))->virtualSliceAddr) |
Definition at line 374 of file address_translation.h.
#define LSA_ENTRY | ( | lsa | ) | (&logicalSliceMapPtr->logicalSlice[(lsa)]) |
Definition at line 372 of file address_translation.h.
#define LSA_FAIL 0xffffffff |
Definition at line 55 of file address_translation.h.
#define LSA_NONE 0xffffffff |
Definition at line 54 of file address_translation.h.
#define PAGE_NONE 0xffff |
Definition at line 60 of file address_translation.h.
#define PBLK_ENTRY | ( | iDie, | |
iBlk | |||
) | (&phyBlockMapPtr->phyBlock[(iDie)][(iBlk)]) |
Definition at line 370 of file address_translation.h.
#define PCH2VDIE | ( | iCh, | |
iWay | |||
) | (Pcw2VdieTranslation((iCh), (iWay))) |
Definition at line 386 of file address_translation.h.
#define Pcw2VdieTranslation | ( | chNo, | |
wayNo | |||
) | ((chNo) + (wayNo) * (USER_CHANNELS)) |
Get die number from physical channel number and way number.
Definition at line 179 of file address_translation.h.
#define PlsbPage2VpageTranslation | ( | pageNo | ) | ((pageNo) > (0) ? (((pageNo) + 1) / 2) : (0)) |
Get the corresponding virtual page number of the given LSB page number.
pageNo
> 0 or not. Definition at line 186 of file address_translation.h.
#define RESERVED_FREE_BLOCK_COUNT 0x1 |
Definition at line 68 of file address_translation.h.
#define START_PAGE_NO_OF_BAD_BLOCK_TABLE_BLOCK (1) |
The start physical page number that stored the bbt of this die.
The first page will be used for checking the bad block mark, so start putting the bbt from second page.
Definition at line 98 of file address_translation.h.
#define USED_PAGES_FOR_BAD_BLOCK_TABLE_PER_DIE (TOTAL_BLOCKS_PER_DIE / BYTES_PER_DATA_REGION_OF_PAGE + 1) |
Definition at line 87 of file address_translation.h.
#define VBA2PBA_MBS | ( | vba | ) | (Vblock2PblockOfMbsTranslation((vba))) |
Definition at line 382 of file address_translation.h.
#define VBA2PBA_TBS | ( | vba | ) | (Vblock2PblockOfTbsTranslation((vba))) |
Definition at line 383 of file address_translation.h.
#define VBLK_ENTRY | ( | iDie, | |
iBlk | |||
) | (&virtualBlockMapPtr->block[(iDie)][(iBlk)]) |
Definition at line 365 of file address_translation.h.
#define VBLK_NEXT_ENTRY | ( | iDie, | |
iBlk | |||
) | (VBLK_ENTRY((iDie), VBLK_NEXT_IDX((iDie), (iBlk)))) |
Definition at line 369 of file address_translation.h.
#define VBLK_NEXT_IDX | ( | iDie, | |
iBlk | |||
) | (VBLK_ENTRY((iDie), (iBlk))->nextBlock) |
Definition at line 367 of file address_translation.h.
#define VBLK_PREV_ENTRY | ( | iDie, | |
iBlk | |||
) | (VBLK_ENTRY((iDie), VBLK_PREV_IDX((iDie), (iBlk)))) |
Definition at line 368 of file address_translation.h.
#define VBLK_PREV_IDX | ( | iDie, | |
iBlk | |||
) | (VBLK_ENTRY((iDie), (iBlk))->prevBlock) |
Definition at line 366 of file address_translation.h.
#define Vblock2PblockOfMbsTranslation | ( | blockNo | ) | (((blockNo) / (USER_BLOCKS_PER_LUN)) * (MAIN_BLOCKS_PER_LUN) + ((blockNo) % (USER_BLOCKS_PER_LUN))) |
The V2P block mapping rule (main block space).
Definition at line 159 of file address_translation.h.
#define Vblock2PblockOfTbsTranslation | ( | blockNo | ) | (((blockNo) / (USER_BLOCKS_PER_LUN)) * (TOTAL_BLOCKS_PER_LUN) + ((blockNo) % (USER_BLOCKS_PER_LUN))) |
Get the PBA (in total block space) of the given VBN.
The mapping rule is basically use static mapping, but since the number of user blocks on a die may be less than the number of total blocks (MAIN + EXTENDED) on that die, we must use USER_BLOCKS_PER_LUN
to calculate the offset of the given VBN.
Definition at line 150 of file address_translation.h.
#define VDIE2PCH | ( | iDie | ) | (Vdie2PchTranslation((iDie))) |
Definition at line 377 of file address_translation.h.
#define Vdie2PchTranslation | ( | dieNo | ) | ((dieNo) % (USER_CHANNELS)) |
Definition at line 138 of file address_translation.h.
#define VDIE2PWAY | ( | iDie | ) | (Vdie2PwayTranslation((iDie))) |
Definition at line 378 of file address_translation.h.
#define Vdie2PwayTranslation | ( | dieNo | ) | ((dieNo) / (USER_CHANNELS)) |
Definition at line 139 of file address_translation.h.
#define VDIE_ENTRY | ( | iDie | ) | (&virtualDieMapPtr->die[(iDie)]) |
Definition at line 359 of file address_translation.h.
#define VDIE_NEXT_ENTRY | ( | iDie | ) | (VDIE_ENTRY(VDIE_NEXT_IDX((iDie)))) |
Definition at line 363 of file address_translation.h.
#define VDIE_NEXT_IDX | ( | iDie | ) | (VDIE_ENTRY((iDie))->nextDie) |
Definition at line 361 of file address_translation.h.
#define VDIE_PREV_ENTRY | ( | iDie | ) | (VDIE_ENTRY(VDIE_PREV_IDX((iDie)))) |
Definition at line 362 of file address_translation.h.
#define VDIE_PREV_IDX | ( | iDie | ) | (VDIE_ENTRY((iDie))->prevDie) |
Definition at line 360 of file address_translation.h.
#define VORG2VSA | ( | iDie, | |
iBlk, | |||
iPage | |||
) | (Vorg2VsaTranslation((iDie), (iBlk), (iPage))) |
Definition at line 384 of file address_translation.h.
#define Vorg2VsaTranslation | ( | dieNo, | |
blockNo, | |||
pageNo | |||
) | ((dieNo) + (USER_DIES) * ((blockNo) * (SLICES_PER_BLOCK) + (pageNo))) |
Translate virtual NAND organization (location vector) into VSA.
The virtual slices with same page offset but on different die are grouped together, that is the virtual slice address 0 ~ (USER_DIES
- 1) will be mapped to the page 0 of each user die, the virtual slice address USER_DIES
~ (2 x USER_DIES
- 1) will be mapped to the page 1 of each user die, and so on.
Therefore, in order to translate the virtual organization into VSA, we should:
dieNo
to get the VSA for this die in the target groupdieNo | the die number for this slice request. |
blockNo | the block number for this slice request. |
pageNo | the page offset in this block for this slice request. |
Definition at line 131 of file address_translation.h.
#define Vpage2PlsbPageTranslation | ( | pageNo | ) | ((pageNo) > (0) ? (2 * (pageNo)-1) : (0)) |
Map the virtual page to the physical LSB page in SLC mode.
Definition at line 168 of file address_translation.h.
#define VSA2LSA | ( | vsa | ) | (VSA_ENTRY((vsa))->logicalSliceAddr) |
Definition at line 375 of file address_translation.h.
#define VSA2VBLK | ( | vsa | ) | (Vsa2VblockTranslation((vsa))) |
Definition at line 380 of file address_translation.h.
#define Vsa2VblockTranslation | ( | virtualSliceAddr | ) | (((virtualSliceAddr) / (USER_DIES)) / (SLICES_PER_BLOCK)) |
Definition at line 108 of file address_translation.h.
#define VSA2VDIE | ( | vsa | ) | (Vsa2VdieTranslation((vsa))) |
Definition at line 379 of file address_translation.h.
#define Vsa2VdieTranslation | ( | virtualSliceAddr | ) | ((virtualSliceAddr) % (USER_DIES)) |
Definition at line 107 of file address_translation.h.
#define VSA2VPAGE | ( | vsa | ) | (Vsa2VpageTranslation((vsa))) |
Definition at line 381 of file address_translation.h.
#define Vsa2VpageTranslation | ( | virtualSliceAddr | ) | (((virtualSliceAddr) / (USER_DIES)) % (SLICES_PER_BLOCK)) |
Definition at line 109 of file address_translation.h.
#define VSA_ENTRY | ( | vsa | ) | (&virtualSliceMapPtr->virtualSlice[(vsa)]) |
Definition at line 373 of file address_translation.h.
#define VSA_FAIL 0xffffffff |
Definition at line 58 of file address_translation.h.
#define VSA_NONE 0xffffffff |
Definition at line 57 of file address_translation.h.
typedef struct _BAD_BLOCK_TABLE_INFO_ENTRY BAD_BLOCK_TABLE_INFO_ENTRY |
The bad block table for this die.
typedef struct _BAD_BLOCK_TABLE_INFO_MAP BAD_BLOCK_TABLE_INFO_MAP |
The bad block tables.
typedef struct _FRRE_BLOCK_ALLOCATION_LIST FRRE_BLOCK_ALLOCATION_LIST |
typedef struct _LOGICAL_SLICE_ENTRY LOGICAL_SLICE_ENTRY |
Exactly the Virtual Slice Address.
typedef struct _LOGICAL_SLICE_MAP LOGICAL_SLICE_MAP |
The Logical -> Virtual Slice Address mapping table.
typedef struct _BAD_BLOCK_TABLE_INFO_ENTRY * P_BAD_BLOCK_TABLE_ENTRY |
typedef struct _BAD_BLOCK_TABLE_INFO_MAP * P_BAD_BLOCK_TABLE_INFO_MAP |
typedef struct _FRRE_BLOCK_ALLOCATION_LIST * P_FRRE_BLOCK_ALLOCATION_LIST |
typedef struct _LOGICAL_SLICE_ENTRY * P_LOGICAL_SLICE_ENTRY |
typedef struct _LOGICAL_SLICE_MAP * P_LOGICAL_SLICE_MAP |
typedef struct _PHY_BLOCK_ENTRY * P_PHY_BLOCK_ENTRY |
typedef struct _PHY_BLOCK_MAP * P_PHY_BLOCK_MAP |
typedef struct _VIRTUAL_BLOCK_ENTRY * P_VIRTUAL_BLOCK_ENTRY |
typedef struct _VIRTUAL_BLOCK_MAP * P_VIRTUAL_BLOCK_MAP |
typedef struct _VIRTUAL_DIE_ENTRY * P_VIRTUAL_DIE_ENTRY |
typedef struct _VIRTUAL_DIE_MAP * P_VIRTUAL_DIE_MAP |
typedef struct _VIRTUAL_SLICE_ENTRY * P_VIRTUAL_SLICE_ENTRY |
typedef struct _VIRTUAL_SLICE_MAP * P_VIRTUAL_SLICE_MAP |
typedef struct _PHY_BLOCK_ENTRY PHY_BLOCK_ENTRY |
The metadata of the physical block.
typedef struct _PHY_BLOCK_MAP PHY_BLOCK_MAP |
The metadata table for all the physical blocks.
typedef struct _VIRTUAL_BLOCK_ENTRY VIRTUAL_BLOCK_ENTRY |
The metadata for this block.
typedef struct _VIRTUAL_BLOCK_MAP VIRTUAL_BLOCK_MAP |
The block metadata table for all the blocks.
typedef struct _VIRTUAL_DIE_ENTRY VIRTUAL_DIE_ENTRY |
The metadata for this die.
typedef struct _VIRTUAL_DIE_MAP VIRTUAL_DIE_MAP |
The metadata table for all user dies.
typedef struct _VIRTUAL_SLICE_ENTRY VIRTUAL_SLICE_ENTRY |
Exactly the Logical Slice Address.
typedef struct _VIRTUAL_SLICE_MAP VIRTUAL_SLICE_MAP |
The Virtual -> Logical Slice mapping table.
unsigned int AddrTransRead | ( | unsigned int | logicalSliceAddr | ) |
Get the virtual slice address of the given logical slice.
logicalSliceAddr | the logical address of the target slice. |
Definition at line 871 of file address_translation.c.
unsigned int AddrTransWrite | ( | unsigned int | logicalSliceAddr | ) |
Assign a new virtual (physical) page to the specified logical page.
Before issuing the write request, we should allocate a physical page for the specified logical page and invalidate the old physical page if it exists.
ReqTransSliceToLowLevel()
.logicalSliceAddr | the logical address of the target slice. |
Definition at line 903 of file address_translation.c.
void EraseBlock | ( | unsigned int | dieNo, |
unsigned int | blockNo | ||
) |
Erase the specified block of the specified die and discard its LSAs.
This function will:
Discard all the logical slice addresses of the origin block
dieNo | the die number of the specified block. |
blockNo | the block number on the specified die. |
Definition at line 1122 of file address_translation.c.
unsigned int FindDieForFreeSliceAllocation | ( | ) |
Update and get the die number to serve the next write request.
To exploit the parallelism, the write request should first be interleaved on different channels to take advantage of the channel parallelism. If all the channels' same way are used, select the next way of each channel to use the die parallelism.
Definition at line 1051 of file address_translation.c.
unsigned int FindFreeVirtualSlice | ( | ) |
Select a free physical page (virtual slice).
In current implementation, the target page to serve the write request is determined by checking the following three variables:
sliceAllocationTargetDie
:
The die where the next request should be issued to.
To exploit the parallelism of each die, especially under write-intensive workload, the write requests will be interleaved to each die.
Check FindDieForFreeSliceAllocation()
for details.
VIRTUAL_DIE_ENTRY::currentBlock
:
The current working block of the target die.
Each die maintains a current working block and will select a page from the current working block of target die to serve the write request. Once all the pages of the current working block are used, the fw will select a new free block from the free block list as the new current working block of that die.
If there the free block list of that die is empty, the fw will try to release invalid blocks by doing GC.
Check GetFromFbList()
and GarbageCollection()
for the details.
VIRTUAL_BLOCK_ENTRY::currentPage
:
The current working page of the current working block on the die.
Current implementation just selects the free page sequentially from the current working block.
currentPage
might be full after GC? Definition at line 965 of file address_translation.c.
unsigned int FindFreeVirtualSliceForGc | ( | unsigned int | copyTargetDieNo, |
unsigned int | victimBlockNo | ||
) |
Definition at line 1008 of file address_translation.c.
unsigned int GetFromFbList | ( | unsigned int | dieNo, |
unsigned int | getFreeBlockOption | ||
) |
Pop the first block in the free block list of the specified die.
VIRTUAL_DIE_ENTRY::freeBlockCnt
), so if the number of free blocks is less then the number of preserved blocks, BLOCK_FAIL
will be returned.GET_FREE_BLOCK_NORMAL
and GET_FREE_BLOCK_GC
.dieNo | The target die number. |
getFreeBlockOption | //TODO |
Definition at line 1194 of file address_translation.c.
void InitAddressMap | ( | ) |
Initialize the translation related maps.
The following tasks will be finished in the function:
This function, only initialize the base addresses of these maps, the physical block map and some bad blocks info. The other maps will be initialized in InitBlockDieMap()
and InitSliceMap()
, check the two functions for further initialization.
Definition at line 82 of file address_translation.c.
void InitBlockDieMap | ( | ) |
Build the bad block table and V2P block mapping of each user die.
To create the V2P mapping, we have to:
Definition at line 815 of file address_translation.c.
void InitSliceMap | ( | ) |
Initialize Logical and Virtual Slick Map.
This function simply initialize all the slice addresses in the both map to NONE.
Definition at line 116 of file address_translation.c.
void InvalidateOldVsa | ( | unsigned int | logicalSliceAddr | ) |
Invalidate the specified virtual page.
Overwriting cannot perform on physical flash cell, so the fw must handle out-of-place update.
This function is used for invalidate the corresponding physical page of the specified logical page, but in case there was no physical page allocated on the logical page before, we should check if the corresponding physical page exists before doing GC on the invalidated physical page.
logicalSliceAddr | LSA that specifies the virtual slice to be invalidated. |
Definition at line 1083 of file address_translation.c.
void PutToFbList | ( | unsigned int | dieNo, |
unsigned int | blockNo | ||
) |
Append the given virtual block to the free block list of its die.
dieNo | the die number of the given block. |
blockNo | VBN of the specified block. |
Definition at line 1161 of file address_translation.c.
void UpdateBadBlockTableForGrownBadBlock | ( | unsigned int | tempBufAddr | ) |
Update the bad block table and persist to the specified block.
A little bit similar to FindBadBlock()
, but this function use the bad block flag to mark bad blocks, instead of reading the bad block marks.
tempBufAddr | the base address of the bad block tables. |
Definition at line 1254 of file address_translation.c.
void UpdatePhyBlockMapForGrownBadBlock | ( | unsigned int | dieNo, |
unsigned int | phyBlockNo | ||
) |
Mark the given physical block bad block and update the bbt later.
dieNo | the die number of the given block. |
phyBlockNo | the physical address of the block to be marked as bad block. |
Definition at line 1240 of file address_translation.c.
|
extern |
Definition at line 59 of file address_translation.c.
|
extern |
Definition at line 54 of file address_translation.c.
|
extern |
Definition at line 62 of file address_translation.c.
|
extern |
Definition at line 58 of file address_translation.c.
|
extern |
Definition at line 61 of file address_translation.c.
|
extern |
Definition at line 56 of file address_translation.c.
|
extern |
Definition at line 57 of file address_translation.c.
|
extern |
Definition at line 55 of file address_translation.c.