Go to the source code of this file.
Data Structures | |
struct | __mmc_combo_cmd_t |
combo command More... | |
Typedefs | |
typedef struct __mmc_combo_cmd_t | mmc_combo_cmd_t |
combo command More... | |
Functions | |
MNAND_STATUS | mnand_mmc_common_update_card_status (int fd, uint32_t *card_status) |
Updating the card status. More... | |
MNAND_STATUS | mnand_mmc_common_update_cid (int fd, mnand_cid_info *cid) |
Updating the CID. More... | |
MNAND_STATUS | mnand_mmc_common_update_csd (int fd, mnand_csd_info *csd) |
Updating the CSD. More... | |
MNAND_STATUS | mnand_mmc_common_update_xcsd (int fd, mnand_ext_csd_info *xcsd) |
Updating the EXT CSD. More... | |
MNAND_STATUS | mnand_mmc_common_set_xcsd (int fd, uint8_t index, uint8_t value) |
Setting the EXT CSD register. More... | |
MNAND_STATUS | mnand_mmc_common_trim_all (mnand_chip *chip) |
Trimming the whole device. More... | |
int | mnand_send_combo_cmd (int fd, mmc_combo_cmd_t *ccs, int num_cmd) |
send a list of eMMC command to mnand device More... | |
int | mnand_send_cmd_one (int fd, mmc_combo_cmd_t *ccs) |
send a list of eMMC command to mnand device More... | |
uint32_t | mnand_mmc_common_get_aligned_sector_count (mnand_chip *chip) |
Get the power-of-2 aligned user sector count. More... | |
MNAND_STATUS | mnand_mmc_common_set_update_xcsd (int fd, uint8_t index, uint8_t enabled, mnand_ext_csd_info *xcsd) |
Setting the EXT CSD register and update the xcsd. More... | |
#define ARRAY_SIZE | ( | array | ) | (sizeof((array))/sizeof((array)[0])) |
Definition at line 79 of file nvmnand_mmc_util.h.
#define ARRAY_SIZE | ( | array | ) | (sizeof((array))/sizeof((array)[0])) |
Definition at line 79 of file nvmnand_mmc_util.h.
#define CID_MID 15 |
Definition at line 70 of file nvmnand_mmc_util.h.
#define CID_PNM 7 |
Definition at line 72 of file nvmnand_mmc_util.h.
#define CID_PRV 6 |
Definition at line 71 of file nvmnand_mmc_util.h.
#define EMMC_VERSION_WITH_FFU_SUPPORT 7U |
Version of EMMC that supports FFU.
Definition at line 157 of file nvmnand_mmc_util.h.
#define EXT_CSD_BKOPS_EN 163 |
Definition at line 120 of file nvmnand_mmc_util.h.
#define EXT_CSD_BKOPS_ENABLED 1 |
Definition at line 121 of file nvmnand_mmc_util.h.
#define EXT_CSD_BKOPS_INITIATE 1 |
Definition at line 123 of file nvmnand_mmc_util.h.
#define EXT_CSD_BKOPS_START 164 |
Definition at line 122 of file nvmnand_mmc_util.h.
#define EXT_CSD_BKOPS_STATUS 246 |
Definition at line 134 of file nvmnand_mmc_util.h.
#define EXT_CSD_BKOPS_SUPPORT 502 |
Definition at line 129 of file nvmnand_mmc_util.h.
#define EXT_CSD_CACHE_CTRL 33 |
Definition at line 104 of file nvmnand_mmc_util.h.
#define EXT_CSD_ENH_SIZE_MULT0 140 |
Definition at line 114 of file nvmnand_mmc_util.h.
#define EXT_CSD_ENH_SIZE_MULT1 141 |
Definition at line 115 of file nvmnand_mmc_util.h.
#define EXT_CSD_ENH_SIZE_MULT2 142 |
Definition at line 116 of file nvmnand_mmc_util.h.
#define EXT_CSD_ENH_START_ADDR0 136 |
Definition at line 110 of file nvmnand_mmc_util.h.
#define EXT_CSD_ENH_START_ADDR1 137 |
Definition at line 111 of file nvmnand_mmc_util.h.
#define EXT_CSD_ENH_START_ADDR2 138 |
Definition at line 112 of file nvmnand_mmc_util.h.
#define EXT_CSD_ENH_START_ADDR3 139 |
Definition at line 113 of file nvmnand_mmc_util.h.
#define EXT_CSD_FFU_ARG0 487 |
Definition at line 87 of file nvmnand_mmc_util.h.
#define EXT_CSD_FFU_ARG1 488 |
Definition at line 86 of file nvmnand_mmc_util.h.
#define EXT_CSD_FFU_ARG2 489 |
Definition at line 85 of file nvmnand_mmc_util.h.
#define EXT_CSD_FFU_ARG3 490 |
Definition at line 84 of file nvmnand_mmc_util.h.
#define EXT_CSD_FFU_FEATURES 492 |
Definition at line 83 of file nvmnand_mmc_util.h.
#define EXT_CSD_FIRMWARE_VER0 254 |
Definition at line 137 of file nvmnand_mmc_util.h.
#define EXT_CSD_FIRMWARE_VER1 255 |
Definition at line 138 of file nvmnand_mmc_util.h.
#define EXT_CSD_FIRMWARE_VER2 256 |
Definition at line 139 of file nvmnand_mmc_util.h.
#define EXT_CSD_FIRMWARE_VER3 257 |
Definition at line 140 of file nvmnand_mmc_util.h.
#define EXT_CSD_FIRMWARE_VER4 258 |
Definition at line 141 of file nvmnand_mmc_util.h.
#define EXT_CSD_FIRMWARE_VER5 259 |
Definition at line 142 of file nvmnand_mmc_util.h.
#define EXT_CSD_FIRMWARE_VER6 260 |
Definition at line 143 of file nvmnand_mmc_util.h.
#define EXT_CSD_FIRMWARE_VER7 261 |
Definition at line 144 of file nvmnand_mmc_util.h.
#define EXT_CSD_FLUSH_CACHE 32 |
Definition at line 103 of file nvmnand_mmc_util.h.
#define EXT_CSD_FW_CONFIG 169 |
Definition at line 88 of file nvmnand_mmc_util.h.
#define EXT_CSD_GENERIC_CMD6_TIME 248 |
Definition at line 136 of file nvmnand_mmc_util.h.
#define EXT_CSD_MAX_ENH_SIZE_MULT0 157 |
Definition at line 117 of file nvmnand_mmc_util.h.
#define EXT_CSD_MAX_ENH_SIZE_MULT1 158 |
Definition at line 118 of file nvmnand_mmc_util.h.
#define EXT_CSD_MAX_ENH_SIZE_MULT2 159 |
Definition at line 119 of file nvmnand_mmc_util.h.
#define EXT_CSD_MODE_CONFIG 30 |
Definition at line 89 of file nvmnand_mmc_util.h.
#define EXT_CSD_MODE_CONFIG_FFU 1 |
Definition at line 91 of file nvmnand_mmc_util.h.
#define EXT_CSD_MODE_CONFIG_NORMAL 0 |
Definition at line 90 of file nvmnand_mmc_util.h.
#define EXT_CSD_MODE_CONFIG_VENDOR 0x10U |
Definition at line 92 of file nvmnand_mmc_util.h.
#define EXT_CSD_MODE_FFU_STATUS 26 |
Definition at line 96 of file nvmnand_mmc_util.h.
#define EXT_CSD_MODE_FFU_STATUS_DOWNLOAD_ERR 0x12 |
Definition at line 100 of file nvmnand_mmc_util.h.
#define EXT_CSD_MODE_FFU_STATUS_FW_INSTALL_ERR 0x11 |
Definition at line 99 of file nvmnand_mmc_util.h.
#define EXT_CSD_MODE_FFU_STATUS_GENERAL_ERR 0x10 |
Definition at line 98 of file nvmnand_mmc_util.h.
#define EXT_CSD_MODE_FFU_STATUS_SUCCESS 0 |
Definition at line 97 of file nvmnand_mmc_util.h.
#define EXT_CSD_MODE_OPERATION_CODES 29 |
Definition at line 93 of file nvmnand_mmc_util.h.
#define EXT_CSD_MODE_OPERATION_CODES_FFU_ABORT 2 |
Definition at line 95 of file nvmnand_mmc_util.h.
#define EXT_CSD_MODE_OPERATION_CODES_FFU_INSTALL 1 |
Definition at line 94 of file nvmnand_mmc_util.h.
#define EXT_CSD_PWR_OFF_LONG_TIME 247 |
Definition at line 135 of file nvmnand_mmc_util.h.
#define EXT_CSD_PWR_OFF_NOTIFICATION 34 |
Definition at line 105 of file nvmnand_mmc_util.h.
#define EXT_CSD_PWR_OFF_NOTIFICATION_NO_PWR_NOTIFY 0 |
Definition at line 106 of file nvmnand_mmc_util.h.
#define EXT_CSD_PWR_OFF_NOTIFICATION_PWR_OFF_LONG 3 |
Definition at line 109 of file nvmnand_mmc_util.h.
#define EXT_CSD_PWR_OFF_NOTIFICATION_PWR_OFF_SHORT 2 |
Definition at line 108 of file nvmnand_mmc_util.h.
#define EXT_CSD_PWR_OFF_NOTIFICATION_PWR_ON 1 |
Definition at line 107 of file nvmnand_mmc_util.h.
#define EXT_CSD_REV 192 |
Definition at line 124 of file nvmnand_mmc_util.h.
#define EXT_CSD_REV_4_4 5 |
Definition at line 125 of file nvmnand_mmc_util.h.
#define EXT_CSD_REV_4_5 6 |
Definition at line 126 of file nvmnand_mmc_util.h.
#define EXT_CSD_REV_5_0 7 |
Definition at line 127 of file nvmnand_mmc_util.h.
#define EXT_CSD_REV_5_1 8 |
Definition at line 128 of file nvmnand_mmc_util.h.
#define EXT_CSD_SEC_COUNT0 212 |
Definition at line 130 of file nvmnand_mmc_util.h.
#define EXT_CSD_SEC_COUNT1 213 |
Definition at line 131 of file nvmnand_mmc_util.h.
#define EXT_CSD_SEC_COUNT2 214 |
Definition at line 132 of file nvmnand_mmc_util.h.
#define EXT_CSD_SEC_COUNT3 215 |
Definition at line 133 of file nvmnand_mmc_util.h.
#define EXT_CSD_SUPPORTED_MODES 493 |
Definition at line 82 of file nvmnand_mmc_util.h.
#define HOURS_PER_DAY 24 |
Definition at line 146 of file nvmnand_mmc_util.h.
#define max | ( | a, | |
b | |||
) | NV_MAX(a, b) |
Definition at line 26 of file nvmnand_mmc_util.h.
#define MAX_FW_DEVICE_LEN (8U) |
FW length in bytes as returned by eMMC.
Definition at line 151 of file nvmnand_mmc_util.h.
#define MAX_PRN_DEVICE_LEN (6U) |
PRN length in bytes as returned by eMMC.
Definition at line 154 of file nvmnand_mmc_util.h.
#define min | ( | a, | |
b | |||
) | NV_MIN(a, b) |
Definition at line 27 of file nvmnand_mmc_util.h.
#define MMC_ERASE 38 /* S */ |
Definition at line 52 of file nvmnand_mmc_util.h.
#define MMC_ERASE_GARBAGE_COLLECT 0x80008001 |
Definition at line 56 of file nvmnand_mmc_util.h.
#define MMC_ERASE_GROUP_END 36 /* S */ |
Definition at line 51 of file nvmnand_mmc_util.h.
#define MMC_ERASE_GROUP_START 35 /* S */ |
Definition at line 50 of file nvmnand_mmc_util.h.
#define MMC_ERASE_NORM 0x00000000 |
Definition at line 54 of file nvmnand_mmc_util.h.
#define MMC_ERASE_SECURE 0x80000000 |
Definition at line 58 of file nvmnand_mmc_util.h.
#define MMC_ERASE_SECURE_TRIM 0x80000001 |
Definition at line 57 of file nvmnand_mmc_util.h.
#define MMC_ERASE_TRIM 0x00000001 |
Definition at line 55 of file nvmnand_mmc_util.h.
#define MMC_GEN_CMD 56 /* Hynix F26/Toshiba specific */ |
Definition at line 45 of file nvmnand_mmc_util.h.
#define MMC_IF_COND 8 |
Definition at line 38 of file nvmnand_mmc_util.h.
#define MMC_MANF0_CMD 60 /* Hynix F20 specific */ |
Definition at line 46 of file nvmnand_mmc_util.h.
#define MMC_READ_MULTIPLE_BLOCK 18 /* read multiple blocks */ |
Definition at line 42 of file nvmnand_mmc_util.h.
#define MMC_READ_SINGLE_BLOCK 17 /* read single block */ |
Definition at line 41 of file nvmnand_mmc_util.h.
#define MMC_SECTOR_END 33 /* S */ |
Definition at line 49 of file nvmnand_mmc_util.h.
#define MMC_SECTOR_START 32 /* S */ |
Definition at line 48 of file nvmnand_mmc_util.h.
#define MMC_SEND_CID 2 |
Common functions/definitions used on mNAND.
Chip independent
Definition at line 35 of file nvmnand_mmc_util.h.
#define MMC_SEND_CSD 9 |
Definition at line 39 of file nvmnand_mmc_util.h.
#define MMC_SEND_EXT_CSD 8 |
Definition at line 37 of file nvmnand_mmc_util.h.
#define MMC_SEND_STATUS 13 |
Definition at line 40 of file nvmnand_mmc_util.h.
#define MMC_STOP_TRANSMISSION 12 |
Definition at line 47 of file nvmnand_mmc_util.h.
#define MMC_SWITCH 6 |
Definition at line 36 of file nvmnand_mmc_util.h.
#define MMC_SWITCH_CMDSET_DFLT 0x01 |
Definition at line 66 of file nvmnand_mmc_util.h.
#define MMC_SWITCH_MODE_WRITE 0x3 |
Definition at line 67 of file nvmnand_mmc_util.h.
#define MMC_WRITE_BLOCK 24 /* write single block */ |
Definition at line 43 of file nvmnand_mmc_util.h.
#define MMC_WRITE_MULTIPLE_BLOCK 25 /* write multiple blocks */ |
Definition at line 44 of file nvmnand_mmc_util.h.
#define SECS_PER_DAY ((HOURS_PER_DAY) * (SECS_PER_HOUR)) |
Definition at line 148 of file nvmnand_mmc_util.h.
#define SECS_PER_HOUR 3600 |
Definition at line 147 of file nvmnand_mmc_util.h.
typedef struct __mmc_combo_cmd_t mmc_combo_cmd_t |
combo command
uint32_t mnand_mmc_common_get_aligned_sector_count | ( | mnand_chip * | chip | ) |
Get the power-of-2 aligned user sector count.
chip | - the mNAND chip handle to be used |
aligned | sector count |
MNAND_STATUS mnand_mmc_common_set_update_xcsd | ( | int | fd, |
uint8_t | index, | ||
uint8_t | enabled, | ||
mnand_ext_csd_info * | xcsd | ||
) |
Setting the EXT CSD register and update the xcsd.
fd | - file descriptor to opened mNAND device |
index | - which EXT CSD register to be set |
value | - the value of EXT CSD register to be set |
xcsd | - update the value of EXT CSD register |
MNAND_OK,success | |
else | problem with operation |
MNAND_STATUS mnand_mmc_common_set_xcsd | ( | int | fd, |
uint8_t | index, | ||
uint8_t | value | ||
) |
Setting the EXT CSD register.
fd | - file descriptor to opened mNAND device |
index | - which EXT CSD register to be set |
value | - the value of EXT CSD register to be set |
MNAND_OK,success | |
else | problem with operation |
MNAND_STATUS mnand_mmc_common_trim_all | ( | mnand_chip * | chip | ) |
Trimming the whole device.
fd | - file descriptor point to mNAND device |
0 | success |
-1 | problem with operation |
MNAND_STATUS mnand_mmc_common_update_card_status | ( | int | fd, |
uint32_t * | card_status | ||
) |
Updating the card status.
fd | - file descriptor to opened mNAND device |
card_status | - pointer to card status to be updated |
MNAND_OK,success | |
else | problem with operation |
MNAND_STATUS mnand_mmc_common_update_cid | ( | int | fd, |
mnand_cid_info * | cid | ||
) |
Updating the CID.
fd | - file descriptor to opened mNAND device |
cid | - pointer to CID to be updated |
MNAND_OK,success | |
else | problem with operation |
MNAND_STATUS mnand_mmc_common_update_csd | ( | int | fd, |
mnand_csd_info * | csd | ||
) |
Updating the CSD.
fd | - file descriptor to opened mNAND device |
csd | - pointer to CSD to be updated |
MNAND_OK,success | |
else | problem with operation |
MNAND_STATUS mnand_mmc_common_update_xcsd | ( | int | fd, |
mnand_ext_csd_info * | xcsd | ||
) |
Updating the EXT CSD.
fd | - file descriptor to opened mNAND device |
xcsd | - pointer to EXT CSD to be updated |
MNAND_OK,success | |
else | problem with operation |
int mnand_send_cmd_one | ( | int | fd, |
mmc_combo_cmd_t * | ccs | ||
) |
send a list of eMMC command to mnand device
fd | - file descriptor point to mNAND device |
ccs | - the buffer address for one commands |
MNAND_OK | for success |
-1 | problem with operation |
int mnand_send_combo_cmd | ( | int | fd, |
mmc_combo_cmd_t * | ccs, | ||
int | num_cmd | ||
) |
send a list of eMMC command to mnand device
fd | - file descriptor point to mNAND device |
ccs | - the buffer address as array of commands |
num_cmd | - the number of commands encapsulate in ccs |
MNAND_OK | for success |
-1 | problem with operation |