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 | InitFTL () |
The entry function for FTL initialization. More... | |
void | InitChCtlReg () |
Initialize the base addresses of all channel controllers. More... | |
void | InitNandArray () |
Send RESET and SET_FEATURE to all the flash dies. More... | |
void | CheckConfigRestriction () |
Check the configurations are legal before the initializations start. More... | |
Variables | |
unsigned int | storageCapacity_L |
T4REGS | chCtlReg [USER_CHANNELS] |
#define BAD_BLOCK_MARK_BYTE0 0 |
Definition at line 167 of file ftl_config.h.
#define BAD_BLOCK_MARK_BYTE1 (BYTES_PER_DATA_REGION_OF_NAND_ROW) |
Definition at line 168 of file ftl_config.h.
#define BAD_BLOCK_MARK_PAGE0 0 |
Definition at line 165 of file ftl_config.h.
#define BAD_BLOCK_MARK_PAGE1 (ROWS_PER_MLC_BLOCK - 1) |
Definition at line 166 of file ftl_config.h.
#define BIT_ERROR_THRESHOLD_PER_CHUNK 24 |
Definition at line 187 of file ftl_config.h.
#define BITS_PER_FLASH_CELL SLC_MODE |
Definition at line 205 of file ftl_config.h.
#define BYTES_PER_DATA_REGION_OF_NAND_ROW 16384 /* the size of data region of a page */ |
Definition at line 140 of file ftl_config.h.
#define BYTES_PER_DATA_REGION_OF_PAGE 16384 |
Definition at line 179 of file ftl_config.h.
#define BYTES_PER_DATA_REGION_OF_SLICE 16384 |
Definition at line 212 of file ftl_config.h.
#define BYTES_PER_NAND_ROW (BYTES_PER_DATA_REGION_OF_NAND_ROW + BYTES_PER_SPARE_REGION_OF_NAND_ROW) |
Definition at line 144 of file ftl_config.h.
#define BYTES_PER_NVME_BLOCK 4096 |
Definition at line 194 of file ftl_config.h.
#define BYTES_PER_SPARE_REGION_OF_NAND_ROW 1664 /* the size of spare region of a page */ |
Definition at line 141 of file ftl_config.h.
#define BYTES_PER_SPARE_REGION_OF_PAGE 256 |
Definition at line 180 of file ftl_config.h.
#define BYTES_PER_SPARE_REGION_OF_SLICE 256 |
Definition at line 213 of file ftl_config.h.
#define ECC_CHUNKS_PER_PAGE 32 |
Definition at line 186 of file ftl_config.h.
#define ERROR_INFO_WORD_COUNT 11 |
Definition at line 188 of file ftl_config.h.
#define EXTENDED_BLOCKS_PER_LUN 224 /* number of blocks in the extended space of a die */ |
Definition at line 154 of file ftl_config.h.
#define LUNS_PER_DIE 1 /* number of planes in a die (way) */ |
Definition at line 160 of file ftl_config.h.
#define MAIN_BLOCKS_PER_DIE (MAIN_BLOCKS_PER_LUN * LUNS_PER_DIE) |
Definition at line 162 of file ftl_config.h.
#define MAIN_BLOCKS_PER_LUN 2732 /* number of blocks in the main space of a die */ |
Definition at line 153 of file ftl_config.h.
#define MAIN_ROWS_PER_MLC_LUN (ROWS_PER_MLC_BLOCK * MAIN_BLOCKS_PER_LUN) |
Definition at line 158 of file ftl_config.h.
#define MAIN_ROWS_PER_SLC_LUN (ROWS_PER_SLC_BLOCK * MAIN_BLOCKS_PER_LUN) |
Definition at line 157 of file ftl_config.h.
#define MB_PER_BLOCK ((BYTES_PER_DATA_REGION_OF_SLICE * SLICES_PER_BLOCK) / (1024 * 1024)) |
Definition at line 237 of file ftl_config.h.
#define MB_PER_METADATA_BLOCK_SPACE (USER_DIES * MB_PER_BLOCK) |
Definition at line 240 of file ftl_config.h.
#define MB_PER_MIN_FREE_BLOCK_SPACE (USER_DIES * MB_PER_BLOCK) |
Definition at line 239 of file ftl_config.h.
#define MB_PER_OVER_PROVISION_BLOCK_SPACE ((USER_BLOCKS_PER_SSD / 10) * MB_PER_BLOCK) |
Definition at line 241 of file ftl_config.h.
#define MB_PER_SSD (USER_BLOCKS_PER_SSD * MB_PER_BLOCK) |
Definition at line 238 of file ftl_config.h.
#define MLC_MODE 2 |
Definition at line 202 of file ftl_config.h.
#define NSC_0_BASEADDR 0 |
Definition at line 128 of file ftl_config.h.
#define NSC_0_CONNECTED 0 |
Definition at line 126 of file ftl_config.h.
#define NSC_0_UCODEADDR 0 |
Definition at line 127 of file ftl_config.h.
#define NSC_1_BASEADDR 0 |
Definition at line 119 of file ftl_config.h.
#define NSC_1_CONNECTED 0 |
Definition at line 117 of file ftl_config.h.
#define NSC_1_UCODEADDR 0 |
Definition at line 118 of file ftl_config.h.
#define NSC_2_BASEADDR 0 |
Definition at line 110 of file ftl_config.h.
#define NSC_2_CONNECTED 0 |
Definition at line 108 of file ftl_config.h.
#define NSC_2_UCODEADDR 0 |
Definition at line 109 of file ftl_config.h.
#define NSC_3_BASEADDR 0 |
Definition at line 101 of file ftl_config.h.
#define NSC_3_CONNECTED 0 |
Definition at line 99 of file ftl_config.h.
#define NSC_3_UCODEADDR 0 |
Definition at line 100 of file ftl_config.h.
#define NSC_4_BASEADDR 0 |
Definition at line 92 of file ftl_config.h.
#define NSC_4_CONNECTED 0 |
Definition at line 90 of file ftl_config.h.
#define NSC_4_UCODEADDR 0 |
Definition at line 91 of file ftl_config.h.
#define NSC_5_BASEADDR 0 |
Definition at line 83 of file ftl_config.h.
#define NSC_5_CONNECTED 0 |
Definition at line 81 of file ftl_config.h.
#define NSC_5_UCODEADDR 0 |
Definition at line 82 of file ftl_config.h.
#define NSC_6_BASEADDR 0 |
Definition at line 74 of file ftl_config.h.
#define NSC_6_CONNECTED 0 |
Definition at line 72 of file ftl_config.h.
#define NSC_6_UCODEADDR 0 |
Definition at line 73 of file ftl_config.h.
#define NSC_7_BASEADDR 0 |
Definition at line 65 of file ftl_config.h.
#define NSC_7_CONNECTED 0 |
Definition at line 63 of file ftl_config.h.
#define NSC_7_UCODEADDR 0 |
Definition at line 64 of file ftl_config.h.
#define NSC_MAX_CHANNELS (NUMBER_OF_CONNECTED_CHANNEL) |
Definition at line 175 of file ftl_config.h.
#define NSC_MAX_WAYS 8 |
Definition at line 176 of file ftl_config.h.
#define NUMBER_OF_CONNECTED_CHANNEL |
Definition at line 132 of file ftl_config.h.
#define NVME_BLOCKS_PER_PAGE (BYTES_PER_DATA_REGION_OF_PAGE / BYTES_PER_NVME_BLOCK) |
Definition at line 195 of file ftl_config.h.
#define NVME_BLOCKS_PER_SLICE (BYTES_PER_DATA_REGION_OF_SLICE / BYTES_PER_NVME_BLOCK) |
Definition at line 217 of file ftl_config.h.
#define PAGES_PER_MLC_BLOCK (ROWS_PER_MLC_BLOCK) |
Definition at line 183 of file ftl_config.h.
#define PAGES_PER_SLC_BLOCK (ROWS_PER_SLC_BLOCK) |
Definition at line 182 of file ftl_config.h.
#define ROWS_PER_MLC_BLOCK 256 /* number of page in this block (MLC mode) */ |
Definition at line 151 of file ftl_config.h.
#define ROWS_PER_SLC_BLOCK 256 /* number of page in this block (SLC mode) */ |
Definition at line 150 of file ftl_config.h.
#define SLC_MODE 1 |
Definition at line 201 of file ftl_config.h.
#define SLICES_PER_BLOCK (USER_PAGES_PER_BLOCK * SLICES_PER_PAGE) |
Definition at line 227 of file ftl_config.h.
#define SLICES_PER_CHANNEL (USER_PAGES_PER_CHANNEL * SLICES_PER_PAGE) |
Definition at line 230 of file ftl_config.h.
#define SLICES_PER_DIE (USER_PAGES_PER_DIE * SLICES_PER_PAGE) |
Definition at line 229 of file ftl_config.h.
#define SLICES_PER_LUN (USER_PAGES_PER_LUN * SLICES_PER_PAGE) |
Definition at line 228 of file ftl_config.h.
#define SLICES_PER_PAGE (BYTES_PER_DATA_REGION_OF_PAGE / BYTES_PER_DATA_REGION_OF_SLICE) |
Definition at line 215 of file ftl_config.h.
#define SLICES_PER_SSD (USER_PAGES_PER_SSD * SLICES_PER_PAGE) |
Definition at line 231 of file ftl_config.h.
#define TOTAL_BLOCKS_PER_DIE (TOTAL_BLOCKS_PER_LUN * LUNS_PER_DIE) |
Definition at line 163 of file ftl_config.h.
#define TOTAL_BLOCKS_PER_LUN (MAIN_BLOCKS_PER_LUN + EXTENDED_BLOCKS_PER_LUN) |
Definition at line 155 of file ftl_config.h.
#define USER_BLOCKS_PER_CHANNEL (USER_BLOCKS_PER_DIE * USER_WAYS) |
Definition at line 234 of file ftl_config.h.
#define USER_BLOCKS_PER_DIE (USER_BLOCKS_PER_LUN * LUNS_PER_DIE) |
Definition at line 233 of file ftl_config.h.
#define USER_BLOCKS_PER_LUN 2048 |
Definition at line 206 of file ftl_config.h.
#define USER_BLOCKS_PER_SSD (USER_BLOCKS_PER_CHANNEL * USER_CHANNELS) |
Definition at line 235 of file ftl_config.h.
#define USER_CHANNELS 8 |
Definition at line 207 of file ftl_config.h.
#define USER_DIES (USER_CHANNELS * USER_WAYS) |
Definition at line 219 of file ftl_config.h.
#define USER_PAGES_PER_BLOCK (PAGES_PER_SLC_BLOCK * BITS_PER_FLASH_CELL) |
Definition at line 221 of file ftl_config.h.
#define USER_PAGES_PER_CHANNEL (USER_PAGES_PER_DIE * USER_WAYS) |
Definition at line 224 of file ftl_config.h.
#define USER_PAGES_PER_DIE (USER_PAGES_PER_LUN * LUNS_PER_DIE) |
Definition at line 223 of file ftl_config.h.
#define USER_PAGES_PER_LUN (USER_PAGES_PER_BLOCK * USER_BLOCKS_PER_LUN) |
Definition at line 222 of file ftl_config.h.
#define USER_PAGES_PER_SSD (USER_PAGES_PER_CHANNEL * USER_CHANNELS) |
Definition at line 225 of file ftl_config.h.
#define USER_WAYS 8 |
Definition at line 208 of file ftl_config.h.
void CheckConfigRestriction | ( | ) |
Check the configurations are legal before the initializations start.
This function will check two things:
Definition at line 242 of file ftl_config.c.
void InitChCtlReg | ( | ) |
Initialize the base addresses of all channel controllers.
Definition at line 119 of file ftl_config.c.
void InitFTL | ( | ) |
The entry function for FTL initialization.
Definition at line 62 of file ftl_config.c.
void InitNandArray | ( | ) |
Send RESET and SET_FEATURE to all the flash dies.
This function send two requests to each die:
REQ_CODE_RESET
:
REQ_CODE_SET_FEATURE
:
This request is used to make the flash enter the toggle mode, check the function IssueNandReq()
for details.
The two types of request have some characteristics:
no need to do address translation -> use physical address directly:
set nandAddr
to REQ_OPT_NAND_ADDR_PHY_ORG
set physicalCh
to the channel number of target die set physicalWay
to the way number of target die set physicalBlock
to any value (no effect) set physicalPage
to any value (no effect)
no dependency problem:
set rowAddrDependencyCheck
to REQ_OPT_ROW_ADDR_DEPENDENCY_NONE
set prevBlockingReq
to REQ_SLOT_TAG_NONE
no need data buffer needed:
set dataBufFormat
to REQ_OPT_DATA_BUF_NONE
apply to all the blocks (main space + extended space)
set blockSpace
to REQ_OPT_BLOCK_SPACE_TOTAL
These requests must be done in the initialization stage, make sure they are all done before going to next initialization step.
Definition at line 175 of file ftl_config.c.
|
extern |
Definition at line 57 of file ftl_config.c.
|
extern |
Definition at line 56 of file ftl_config.c.