OpenSSD Cosmos+ Platform Firmware
0.0.2
The firmware of Cosmos+ OpenSSD Platform for TOSHIBA nand flash module.
|
#include "nvme/nvme.h"
Go to the source code of this file.
Data Structures | |
struct | _DATA_BUF_INFO |
The real address or entry index of the request. More... | |
struct | _NVME_DMA_INFO |
The structure that manages the LBA and LSA info needed by NVMe DMA requests. More... | |
struct | _NAND_INFO |
struct | _REQ_OPTION |
struct | _SSD_REQ_FORMAT |
The structure of a slice command. More... | |
Typedefs | |
typedef struct _DATA_BUF_INFO | DATA_BUF_INFO |
The real address or entry index of the request. More... | |
typedef struct _DATA_BUF_INFO * | P_DATA_BUF_INFO |
typedef struct _NVME_DMA_INFO | NVME_DMA_INFO |
The structure that manages the LBA and LSA info needed by NVMe DMA requests. More... | |
typedef struct _NVME_DMA_INFO * | P_NVME_DMA_INFO |
typedef struct _NAND_INFO | NAND_INFO |
typedef struct _NAND_INFO * | P_NAND_INFO |
typedef struct _REQ_OPTION | REQ_OPTION |
typedef struct _REQ_OPTION * | P_REQ_OPTION |
typedef struct _SSD_REQ_FORMAT | SSD_REQ_FORMAT |
The structure of a slice command. More... | |
typedef struct _SSD_REQ_FORMAT * | P_SSD_REQ_FORMAT |
#define LOGICAL_SLICE_ADDR_NONE 0xffffffff |
Definition at line 145 of file request_format.h.
#define REQ_CODE_ERASE 0x0C |
Definition at line 75 of file request_format.h.
#define REQ_CODE_FLUSH 0x0F |
Definition at line 78 of file request_format.h.
#define REQ_CODE_OCSSD_PHY_ERASE 0xAC |
Definition at line 85 of file request_format.h.
#define REQ_CODE_OCSSD_PHY_READ 0xA8 |
Definition at line 84 of file request_format.h.
#define REQ_CODE_OCSSD_PHY_TYPE_BASE 0xA0 |
Definition at line 82 of file request_format.h.
#define REQ_CODE_OCSSD_PHY_WRITE 0xA0 |
Definition at line 83 of file request_format.h.
#define REQ_CODE_READ 0x08 |
Definition at line 73 of file request_format.h.
#define REQ_CODE_READ_TRANSFER 0x09 |
Definition at line 74 of file request_format.h.
#define REQ_CODE_RESET 0x0D |
Definition at line 76 of file request_format.h.
#define REQ_CODE_RxDMA 0x10 |
Definition at line 79 of file request_format.h.
#define REQ_CODE_SET_FEATURE 0x0E |
Definition at line 77 of file request_format.h.
#define REQ_CODE_TxDMA 0x20 |
Definition at line 80 of file request_format.h.
#define REQ_CODE_WRITE 0x00 |
The command codes of a request pool entry.
Definition at line 72 of file request_format.h.
#define REQ_OPT_BLOCK_SPACE_MAIN 0 |
for the 1 bit flag REQ_OPTION::blockSpace
.
These two block spaces will be used to generate the row address of a corresponding request (check the function GenerateNandRowAddr()
).
The blocks in a plane, or LUN in this project, are separated into 2 spaces:
For request that should be apply to all the blocks, like SET_FEATURE, RESET and READ (for finding bad blocks), we will set the block space to REQ_OPT_BLOCK_SPACE_TOTAL
.
Check ftl_config.h
and request_translation.c
for details.
Definition at line 142 of file request_format.h.
#define REQ_OPT_BLOCK_SPACE_TOTAL 1 |
Definition at line 143 of file request_format.h.
#define REQ_OPT_DATA_BUF_ADDR 2 |
Definition at line 103 of file request_format.h.
#define REQ_OPT_DATA_BUF_ENTRY 0 |
These values are for the 2 bits flag SSD_REQ_FORMAT::REQ_OPTION::dataBufFormat
. The flag will be used for checking the meaning of SSD_REQ_FORMAT::dataBufInfo
.
If the flag is set to REQ_OPT_DATA_BUF_ENTRY
or REQ_OPT_DATA_BUF_TEMP_ENTRY
, this means that the data stored in the dataBufInfo
is a index of the specified buffer.
If the flag is set to REQ_OPT_DATA_BUF_ADDR
, then dataBufInfo
is the address of its data buffer.
If the flag is set to REQ_OPT_DATA_BUF_NONE
, it means that we don't need to allocate a data buffer entry for this request (e.g., ERASE, RESET, SET_FEATURE).
Definition at line 101 of file request_format.h.
#define REQ_OPT_DATA_BUF_NONE 3 |
Definition at line 104 of file request_format.h.
#define REQ_OPT_DATA_BUF_TEMP_ENTRY 1 |
Definition at line 102 of file request_format.h.
#define REQ_OPT_NAND_ADDR_PHY_ORG 1 |
Definition at line 107 of file request_format.h.
#define REQ_OPT_NAND_ADDR_VSA 0 |
Definition at line 106 of file request_format.h.
#define REQ_OPT_NAND_ECC_OFF 0 |
Definition at line 109 of file request_format.h.
#define REQ_OPT_NAND_ECC_ON 1 |
Definition at line 110 of file request_format.h.
#define REQ_OPT_NAND_ECC_WARNING_OFF 0 |
Definition at line 112 of file request_format.h.
#define REQ_OPT_NAND_ECC_WARNING_ON 1 |
Definition at line 113 of file request_format.h.
#define REQ_OPT_ROW_ADDR_DEPENDENCY_CHECK 1 |
Definition at line 121 of file request_format.h.
#define REQ_OPT_ROW_ADDR_DEPENDENCY_NONE 0 |
Definition at line 119 of file request_format.h.
#define REQ_OPT_WRAPPING_NONE 0 |
Definition at line 115 of file request_format.h.
#define REQ_OPT_WRAPPING_REQ 1 |
Definition at line 116 of file request_format.h.
#define REQ_QUEUE_TYPE_BLOCKED_BY_BUF_DEP 0x3 |
Definition at line 63 of file request_format.h.
#define REQ_QUEUE_TYPE_BLOCKED_BY_ROW_ADDR_DEP 0x4 |
Definition at line 64 of file request_format.h.
#define REQ_QUEUE_TYPE_FREE 0x1 |
Definition at line 61 of file request_format.h.
#define REQ_QUEUE_TYPE_NAND 0x6 |
Definition at line 66 of file request_format.h.
#define REQ_QUEUE_TYPE_NONE 0x0 |
The queue type of a request pool entry. Each of these macros, except for NONE, has a corresponding queue defined in request_queue.h
.
Definition at line 60 of file request_format.h.
#define REQ_QUEUE_TYPE_NVME_DMA 0x5 |
Definition at line 65 of file request_format.h.
#define REQ_QUEUE_TYPE_SLICE 0x2 |
Definition at line 62 of file request_format.h.
#define REQ_TYPE_NAND 0x1 |
Definition at line 52 of file request_format.h.
#define REQ_TYPE_NVME_DMA 0x2 |
Definition at line 53 of file request_format.h.
#define REQ_TYPE_SLICE 0x0 |
Definition at line 51 of file request_format.h.
typedef struct _DATA_BUF_INFO DATA_BUF_INFO |
The real address or entry index of the request.
This structure used to point the data buffer entry of this request. It may be a real data buffer address if the REQ_OPTION::dataBufFormat
is REQ_OPT_DATA_BUF_ADDR
, or a request entry index if the REQ_OPTION::dataBufFormat
is REQ_OPT_DATA_BUF_ENTRY
or REQ_OPT_DATA_BUF_TEMP_ENTRY
.
typedef struct _NAND_INFO NAND_INFO |
typedef struct _NVME_DMA_INFO NVME_DMA_INFO |
The structure that manages the LBA and LSA info needed by NVMe DMA requests.
The NVMe block size (4K) is different from slice request size (16K), the firmware thus may map several NVMe LBAs into same LSA (check ReqTransNvmeToSlice()
for details) to align the DMA request size to 16K (LSA size).
However, this cause the number of NVMe blocks needed by the NVMe DMA requests differ from 1 to 4. So, to prevent NVMe DMA requests from retrieving wrong data, we should explicitly specify the starting NVMe block address (startIndex
), the number of blocks (numOfNvmeBlock
), and which LSA offset (nvmeBlockOffset
) should the first NVMe LBA align to, in each NVMe DMA request.
ReqTransNvmeToSlice()
typedef struct _DATA_BUF_INFO * P_DATA_BUF_INFO |
typedef struct _NAND_INFO * P_NAND_INFO |
typedef struct _NVME_DMA_INFO * P_NVME_DMA_INFO |
typedef struct _REQ_OPTION * P_REQ_OPTION |
typedef struct _SSD_REQ_FORMAT * P_SSD_REQ_FORMAT |
typedef struct _REQ_OPTION REQ_OPTION |
typedef struct _SSD_REQ_FORMAT SSD_REQ_FORMAT |
The structure of a slice command.
This structure can split into 4 parts:
request type:
As described in the structure of request pool REQ_POOL
, this structure is used for distinguishing the type of requests.