|
NVIDIA DriveOS Linux NSR SDK API Reference
|
7.0.3.0 Release
|
Go to the documentation of this file.
42 #ifndef __NV_MNAND_H__
43 #define __NV_MNAND_H__
58 #if defined(__cplusplus)
66 #define MAX_ERASE_CNT 0xFFFF
78 #define MNAND_READ_CACHE_ENABLE (1 << 0)
79 #define MNAND_WRITE_CACHE_ENABLE (1 << 1)
82 #define MAX_FW_STR_LEN (32U)
84 #define MAX_PRN_STR_LEN (64U)
97 #define MNAND_UNKNOWN_BLOCK (1 << 0)
98 #define MNAND_MLC_BLOCK (1 << 1)
99 #define MNAND_SLC_BLOCK (1 << 2)
100 #define MNAND_UNKNOWN_BAD_BLOCK (1 << 8)
101 #define MNAND_MANF_BAD_BLOCK (1 << 9)
102 #define MNAND_RUNTIME_BAD_BLOCK (1 << 10)
103 #define MNAND_SYSTEM_BLOCK (1 << 11)
121 #define MNAND_LIFETIME_INVALID (1 << 0)
122 #define MNAND_LIFETIME_IN_BLOCK (1 << 1)
123 #define MNAND_LIFETIME_IN_PERCENT (1 << 2)
140 #define MNAND_RFSH_PROG_INVALID (1 << 0)
141 #define MNAND_RFSH_PROG_IN_BLOCK (1 << 1)
142 #define MNAND_RFSH_PROG_IN_PERCENT (1 << 2)
503 return (blk->
valid != 0);
552 assert((blk != NULL) && (blk_type != 0));
599 assert(chip != NULL);
614 assert(chip != NULL);
629 assert(chip != NULL);
644 assert(chip != NULL);
658 assert(chip != NULL);
892 int num_blocks, uint32_t rfsh_unit_time_us,
909 uint64_t *total_age,
int *blk_count,
double *avg_age);
921 double *rfsh_progress);
971 unsigned int sector_cnt,
void *virtaddr);
986 unsigned int sector_cnt, off_t physaddr);
1022 uint8_t value,
char *errmsg_prepend);
1073 uint8_t ret_on_error);
1291 #if defined(__cplusplus)
MNAND_STATUS mnand_extract_life_time_info(mnand_chip *chip, mnand_life_time_info *life_time_info)
Extract spare count info from the mNAND chip.
static int mnand_is_slc_block(mnand_block_info *blk)
Determine if given block is in SLC region.
mnand_life_time_element life_time
uint32_t def_rfsh_interval
#define MNAND_MANF_BAD_BLOCK
MNAND_STORAGE_TYPE storage_type
MNAND_STATUS mnand_update_card_status(mnand_chip *chip)
Updating the card status field inside mNAND chip handle.
uint16_t enhanced4_cap_adj_fac
uint64_t partition_size_alignment
uint64_t max_enh_size_mult
information on refresh progress
enum __mnand_ffu_status MNAND_FFU_STATUS
mNAND UFS FFU status
mnand_mmc_geo_info mmc_geo_info
MNAND_STATUS mnand_get_fw_version(mnand_chip *chip, char *fw_version)
Returns the current version(in hex string format) of the firmware that is running on the device.
mnand_refresh_element progress
@ MNAND_FFU_STATUS_NO_INFORMATION
Indicates there is no informatuon available about the FFU operation.
int mnand_read_sectors_virt(mnand_chip *chip, unsigned int start_sector, unsigned int sector_cnt, void *virtaddr)
Reading data sectors into given buffer (pointed by virtual address).
struct __mnand_device_desc_info mnand_device_desc_info
DEVICE DESC - UFS Only.
int32_t spare_bcnt
Specifies the number of remaining spare blocks, where -1 indicates an invalid count.
UFS GEOMETRY INFO - UFS only.
MNAND_DEVICE_TYPE dev_type
mnand_summary_info * summary
mnand_ufs_write_erase_amplification eaf
Specifies the Erase Amplification of the device.
MNAND_STATUS mnand_update_xcsd(mnand_chip *chip)
Updating the EXT CSD field inside mNAND chip handle.
mnand_config_desc_info cfg_desc
struct __mnand_cid_info mnand_cid_info
CID - eMMC only.
mnand_life_time_info life
int mnand_read_sectors_phys(mnand_chip *chip, unsigned int start_sector, unsigned int sector_cnt, off_t physaddr)
Reading data sectors into given buffer (pointed by physical address).
static int mnand_is_bad_block(mnand_block_info *blk)
Determine if given block is a bad block.
uint64_t hc_erase_grp_size
uint8_t valid
Specifies whether the values indicated are vaild or not.
MNAND_STATUS mnand_update_csd(mnand_chip *chip)
Updating the CSD field inside mNAND chip handle.
struct __mnand_ext_csd_info mnand_ext_csd_info
EXT CSD - eMMC only.
mNAND part/vendor specific operation block
information on refresh properties
uint16_t supported_memory_types
static int mnand_is_valid_block(mnand_block_info *blk)
Return the validity of the block, given the pointer of block info.
MNAND_STATUS mnand_switch_cmd(mnand_chip *chip, uint8_t index, uint8_t value, char *errmsg_prepend)
Send mnand switch cmd to mmc to set EXT CSD register.
uint32_t shutdown_rfsh_interval
struct __mnand_block_info mnand_block_info
information per block
@ MNAND_FFU_STATUS_ERROR_DOWNLOADING_FIRMWARE
Indicates downloading the firmware onto the device failed.
static int mnand_is_refresh_available(mnand_chip *chip)
Return if force refresh is available.
MNAND_STATUS mnand_is_ffu_ready(mnand_chip *chip, bool *res)
Returns wheher the device is ready to read the current firmware verion that is on the device and to p...
#define MNAND_SYSTEM_BLOCK
uint32_t fram
Specifies the host cumulative written data (units of 100MB) from RAM.
struct __mnand_summary_info mnand_summary_info
aggregation of summaries
__mnand_storage_type
mNAND storage type enumeration
uint32_t sys_code_max_alloc
@ MNAND_FFU_STATUS_RESERVED_ERROR
Indicates there was a reserved error during the FFU process.
union __mnand_life_time_element mnand_life_time_element
information on life time element
int smart_summary_available
MNAND_STATUS mnand_close(mnand_chip *chip)
"Closing" (aka releasing) the mNAND chip.
struct __mnand_life_time_info mnand_life_time_info
information on life time
Holds the information that indicates the host cumulative written data (units of 100MB).
MNAND_STATUS mnand_enable_power_off_notification(mnand_chip *chip)
Enable power-off notification.
MNAND_STATUS mnand_send_combo_query_req(mnand_chip *chip, mnand_ufs_query_req *query_req, uint8_t num_cmds, uint8_t need_cq_empty, uint8_t ret_on_error)
Send mnand combo query request (UFS only)
double slc_weaf
Specifies the SLC write/erase amplification.
mnand_block_info * block_info
struct __mnand_wr_info mnand_wr_info
Holds the information that indicates the host cumulative written data (units of 100MB).
MNAND_STATUS mnand_extract_age_info(mnand_chip *chip, int block_type, uint64_t *total_age, int *blk_count, double *avg_age)
Extract age info from the mNAND chip.
@ MNAND_FFU_STATUS_SUCCESS
Indicates FFU operation was successful.
uint32_t rfsh_calibrate_cnt
MNAND_STATUS mnand_update_summary_info(mnand_chip *chip)
Updating the summary info inside mNAND chip handle.
@ MNAND_FFU_STATUS_FW_VERSION_MISMATCH
Indicates the frimware version does not match
@ MNAND_PASSED_FW_VERSION_SAME
uint16_t non_persist_cap_adj_fac
@ MNAND_PASSED_FW_VERSION_GREATER
uint16_t sys_code_cap_adj_fac
struct __mnand_mmc_geo_info mnand_mmc_geo_info
MMC GEOMETRY INFO - eMMC only.
static int mnand_is_mlc_block(mnand_block_info *blk)
Determine if given block is in MLC region.
MNAND_STATUS mnand_set_bkops_start(mnand_chip *chip)
Mark the start of BKOPS.
__mnand_fw_comparison_result
mNAND firmware comparison enumeration
struct __mnand_ufs_geo_info mnand_ufs_geo_info
UFS GEOMETRY INFO - UFS only.
mnand_summary_element slc
MNAND_STATUS mnand_get_geo_info(mnand_chip *chip, mnand_geo_info *geo_info)
Extract mnand geometry info.
uint64_t total_raw_capacity
#define MAX_ERASE_CNT
max.
struct __mnand_refresh_properties mnand_refresh_properties
information on refresh properties
uint32_t enhanced4_max_alloc
mnand_unit_desc_info unit_desc
MNAND_STATUS mnand_get_ffu_status(mnand_chip *chip, MNAND_FFU_STATUS *ffu_status)
Returns the status of the FFU operation that was done in the previous boot cycle.
mnand_summary_element total
MNAND_STATUS mnand_test_multi_cmd(mnand_chip *chip)
Test IOCTL MULTI CMD Currently under this test: Reads the XCSD status, toggles the cache status,...
GEOMETRY DESC - UFS Only.
struct __mnand_summary_element mnand_summary_element
summary of given block type (or region)
MNAND_STATUS mnand_get_bkops_en(mnand_chip *chip, uint8_t *enabled)
Return the status of BKOPS_EN bit.
static int mnand_is_usable_block(mnand_block_info *blk)
Determine if given block is a usable block.
char fw_version[MAX_FW_STR_LEN]
union __mnand_refresh_element mnand_refresh_element
information on refresh element
MNAND_STATUS mnand_update_block_info(mnand_chip *chip)
Updating the list of block info inside mNAND chip handle.
uint16_t enhanced1_cap_adj_fac
MNAND_STATUS mnand_get_cache_en(mnand_chip *chip, uint8_t *enabled)
Determine if eMMC cache is enabled.
uint32_t enhanced1_max_alloc
enum __mnand_eol_status MNAND_EOL_STATUS
mNAND EOL status enumeration
MNAND_STATUS mnand_unbind(mnand_chip *chip)
"Unbinding" (aka releasing) the mNAND chip.
union __mnand_geo_info mnand_geo_info
GEOMETRY INFO.
uint32_t enhanced2_max_alloc
Gives the erase/write amplification value for the device.
MNAND_STATUS mnand_update_cid(mnand_chip *chip)
Updating the CID field inside mNAND chip handle.
mnand_wr_info wcount
Specifies the host cumulative written data,(units of 100MB).
MNAND_STATUS mnand_get_bkops_status(mnand_chip *chip, uint8_t *stat)
Return the status of BKOPS.
static int mnand_is_usable_block_with_type(mnand_block_info *blk, uint16_t blk_type)
Determine if given block is a usable block, and matches given block type.
MNAND_STATUS mnand_update_smart_summary_info(mnand_chip *chip)
Updating the smart summary info inside mNAND chip handle.
mnand_refresh_properties rfsh_properties
struct __mnand_refresh_progress mnand_refresh_progress
information on refresh progress
#define MNAND_RUNTIME_BAD_BLOCK
uint32_t min_rfsh_interval
MNAND_STATUS mnand_check_eol_status(mnand_chip *chip, MNAND_EOL_STATUS *eol_status)
Checking EOL status.
struct __mnand_ufs_query_req * query
MNAND_STATUS mnand_get_lu_info(mnand_chip *chip, uint32_t lun, mnand_lu_info *lu_info)
get mnand lu info (UFS only)
MNAND_STATUS mnand_flush_cache(mnand_chip *chip)
Flush cache on mnand.
@ MNAND_FFU_STATUS_INTERNAL_ERROR
Indicates there was device internal error during FFU operation.
uint32_t enhanced3_max_alloc
struct __mnand_geo_desc_info mnand_geo_desc_info
GEOMETRY DESC - UFS Only.
mnand_geo_desc_info geo_desc
static int mnand_is_block_info_available(mnand_chip *chip)
Return if the block info is available.
enum __mnand_fw_comparison_result MNAND_FW_COMPARE
mNAND firmware comparison enumeration
static int mnand_is_summary_available(mnand_chip *chip)
Return if the summary is available.
#define MAX_FW_STR_LEN
Maximum length of the firmware string.
MNAND_STATUS mnand_set_bkops_en(mnand_chip *chip, uint8_t enable)
set the BKOPS_EN bit in ext_csd Note: BNKOPS_EN is a OTP, once programmed can't change the value.
uint32_t fnand
Specifies the host cumulative written data (units of 100MB) from NAND.
@ MNAND_FFU_STATUS_GENERIC_ERROR
Indicates there was a generic error during the FFU process.
MNAND_STATUS mnand_bind(int fd, mnand_chip *chip)
"Binding" the mNAND chip.
uint8_t valid
Specifies whether the values indicated are vaild or not.
UFS Query Request Info (UFS Only)
MNAND_STATUS mnand_get_refresh_progress(mnand_chip *chip, double *rfsh_progress)
Extract refresh progress from the mNAND chip.
static MNAND_STORAGE_TYPE mnand_get_storage_type(mnand_chip *chip)
Return mnand storage type.
MNAND_STATUS mnand_get_current_lun(mnand_chip *chip, uint32_t *lun)
get mnand current lun (UFS only)
mnand_summary_element mlc
MNAND_STATUS mnand_trim_all(mnand_chip *chip)
Trimming the whole device.
MNAND_STATUS mnand_ffu(mnand_chip *chip, char *fw_file)
Performs Field Firmware Update for eMMC device using the firmware image that is passed as argument.
mnand_device_desc_info device_desc
LOGICAL UNIT INFO - UFS Only.
MNAND_STATUS mnand_send_refresh(mnand_chip *chip, uint8_t block_type, int num_blocks, uint32_t rfsh_unit_time_us, mnand_refresh_progress *progress)
Send "refresh" command to the mNAND chip.
enum __mnand_storage_type MNAND_STORAGE_TYPE
mNAND storage type enumeration
information on life time element
double mlc_weaf
Specifies the MLC write/erase amplification.
#define MNAND_UNKNOWN_BAD_BLOCK
__mnand_status
mNAND operation status used in the API
enum __mnand_device_type MNAND_DEVICE_TYPE
mNAND device enumeration
summary of given block type (or region)
enum __mnand_status MNAND_STATUS
mNAND operation status used in the API
@ MNAND_PASSED_FW_VERSION_LESSER
__mnand_device_type
mNAND device enumeration
information on refresh element
struct __mnand_config_desc_info mnand_config_desc_info
CONFIG DESC - UFS Only.
struct __mnand_unit_desc_info mnand_unit_desc_info
UNIT DESC - UFS Only.
uint32_t rfsh_unit_time_us
struct __mnand_csd_info mnand_csd_info
CSD - eMMC only.
mnand_ufs_geo_info ufs_geo_info
struct __mnand_lu_info mnand_lu_info
LOGICAL UNIT INFO - UFS Only.
MMC GEOMETRY INFO - eMMC only.
MNAND_STATUS mnand_set_cache_en(mnand_chip *chip, uint8_t enable)
Enable/Disable cache on mnand.
struct mnand_ufs_write_erase_amplification mnand_ufs_write_erase_amplification
Gives the erase/write amplification value for the device.
uint16_t enhanced2_cap_adj_fac
#define MAX_PRN_STR_LEN
Maximum length of the product name string.
char prn[MAX_PRN_STR_LEN]
UFS Combo Query Request Info (UFS Only)
__mnand_ffu_status
mNAND UFS FFU status
uint32_t non_persist_max_alloc
MNAND_STATUS mnand_send_power_off_notification(mnand_chip *chip)
Send power-off notification.
MNAND_STATUS mnand_open(const char *devname, mnand_chip *chip)
"Opening" the mNAND chip.
@ MNAND_FFU_STATUS_INSTALL_FAILED
Indicates installing the firmware failed.
static int mnand_is_smart_summary_available(mnand_chip *chip)
Return if the smart summary is available.
struct __mnand_ages_element mnand_ages_info
summary of ages
@ MNAND_FFU_STATUS_FW_CORRUPTION_ERROR
Indicates the firmware that was passed for the FFU operation was corrupted.
MNAND_STATUS mnand_compare_fw_version(mnand_chip *chip, char *fw_file, MNAND_FW_COMPARE *res)
Compares the version of the passed firmware with the version of the frimware that is currently runnin...
uint16_t enhanced3_cap_adj_fac
__mnand_eol_status
mNAND EOL status enumeration