Go to the source code of this file.
Functions | |
| MNAND_STATUS | mnand_ufs_send_combo_query_command (int fd, mnand_ufs_query_req *query_buf, uint8_t num_cmds, uint8_t need_cq_empty, uint8_t ret_on_err) |
| Send UFS combo query request. More... | |
| MNAND_STATUS | mnand_ufs_query_desc_read (int fd, uint8_t idn, uint8_t index, uint8_t sel, uint8_t *buffer, uint32_t *buf_size) |
| Send UFS Query - Descriptor Read Request. More... | |
| MNAND_STATUS | mnand_ufs_query_desc_write (int fd, uint8_t idn, uint8_t index, uint8_t sel, uint8_t *buffer, uint32_t *buf_size) |
| Send UFS Query - Descriptor Write Request. More... | |
| MNAND_STATUS | mnand_ufs_query_device_desc_read (int fd, uint8_t *buffer, uint32_t *buf_size) |
| Send UFS Query - Device Descriptor Read. More... | |
| MNAND_STATUS | mnand_ufs_query_config_desc_read (int fd, uint8_t index, uint8_t *buffer, uint32_t *buf_size) |
| Send UFS Query - Config Descriptor Read. More... | |
| MNAND_STATUS | mnand_ufs_query_config_desc_write (int fd, uint8_t index, uint8_t *buffer, uint32_t *buf_size) |
| Send UFS Query - Config Descriptor Write. More... | |
| MNAND_STATUS | mnand_ufs_query_geo_desc_read (int fd, uint8_t *buffer, uint32_t *buf_size) |
| Send UFS Query - Geometry Descriptor Read. More... | |
| MNAND_STATUS | mnand_ufs_query_unit_desc_read (int fd, uint8_t index, uint8_t *buffer, uint32_t *buf_size) |
| Send UFS Query - Unit Descriptor Read. More... | |
| MNAND_STATUS | mnand_ufs_query_health_desc_read (int fd, uint8_t index, uint8_t *buffer, uint32_t *buf_size) |
| Send UFS Query - Health Descriptor Read. More... | |
| MNAND_STATUS | mnand_ufs_query_attr_read (int fd, uint8_t idn, uint8_t index, uint8_t sel, uint32_t *attr) |
| Send UFS Query - Attribute Read Request. More... | |
| MNAND_STATUS | mnand_ufs_query_attr_write (int fd, uint8_t idn, uint8_t index, uint8_t sel, uint32_t *attr) |
| Send UFS Query - Attribute Write Request. More... | |
| MNAND_STATUS | mnand_ufs_query_flag_read (int fd, uint8_t idn, uint8_t index, uint8_t sel, uint8_t *flag) |
| Send UFS Query - Attribute Read Request. More... | |
| MNAND_STATUS | mnand_ufs_query_flag_set (int fd, uint8_t idn, uint8_t index, uint8_t sel) |
| Send UFS Query - Set Flag Request. More... | |
| MNAND_STATUS | mnand_ufs_query_flag_clear (int fd, uint8_t idn, uint8_t index, uint8_t sel) |
| Send UFS Query - Clear Flag Request. More... | |
| MNAND_STATUS | mnand_ufs_query_flag_toggle (int fd, uint8_t idn, uint8_t index, uint8_t sel) |
| Send UFS Query - Toggle Flag Request. More... | |
| MNAND_STATUS | mnand_ufs_scsi_inquiry (int fd, int8_t evpd, uint8_t page_code, uint8_t *buffer, uint32_t *buf_size) |
| Send SCSI Inquiry Request. More... | |
| MNAND_STATUS | mnand_ufs_scsi_mode_sense (int fd, uint8_t page_code, uint8_t sub_page_code, uint8_t *buffer, uint32_t *buf_size) |
| Send SCSI Mode Sense Request. More... | |
| MNAND_STATUS | mnand_ufs_scsi_mode_select (int fd, int8_t save_pages, uint8_t *buffer, uint32_t *buf_size) |
| Send SCSI Mode Select Request. More... | |
| MNAND_STATUS | mnand_ufs_scsi_sync_cache (int fd) |
| Send SCSI Sync Cache Request. More... | |
| MNAND_STATUS | mnand_ufs_unmap (int fd, uint8_t *buffer, uint32_t *buf_size) |
| Send SCSI Mode Select Request. More... | |
| MNAND_STATUS | mnand_ufs_read_capacity (int fd, uint8_t *buffer, uint32_t *buf_size) |
| Send SCSI Read Capacity Request. More... | |
| MNAND_STATUS | mnand_ufs_set_power_mode (int fd, uint32_t power_mode) |
| Set UFS power mode. More... | |
| MNAND_STATUS | mnand_ufs_scsi_read_buffer (int fd, uint8_t *cmd_blk, uint32_t cmd_blk_len, uint8_t *buffer, uint32_t *buf_size) |
| Send SCSI Read Buffer. More... | |
| MNAND_STATUS | mnand_ufs_scsi_write_buffer (int fd, uint8_t *cmd_blk, uint32_t cmd_blk_len, uint8_t *buffer, uint32_t *buf_size) |
| Send SCSI Write Buffer. More... | |
| MNAND_STATUS | mnand_ufs_scsi_cmd (int fd, uint8_t *cmd_blk, uint32_t cmd_len, int dxfer_dir, uint8_t *data_buffer, uint32_t *data_buf_size) |
| Send SCSI Command. More... | |
| #define MAX_CMD_PER_QUERY_COMBO 10 |
Definition at line 81 of file nvmnand_ufs_util.h.
| #define MNAND_UFS_CFG_DESC_SIZE 0x90 |
Definition at line 51 of file nvmnand_ufs_util.h.
| #define MNAND_UFS_DEV_DESC_SIZE 0x40 |
Definition at line 52 of file nvmnand_ufs_util.h.
| #define MNAND_UFS_FFU_SUPPORT_DEVICE_OFFSET (0x1FU) |
Offset to the FFU support as returned by UFS.
Definition at line 100 of file nvmnand_ufs_util.h.
| #define MNAND_UFS_FW_DEVICE_OFFSET (32U) |
Offset to the FW as returned by UFS.
Definition at line 94 of file nvmnand_ufs_util.h.
| #define MNAND_UFS_GEO_DESC_SIZE 0x48 |
Definition at line 50 of file nvmnand_ufs_util.h.
| #define MNAND_UFS_HEALTH_DESC_SIZE 0x30 |
Definition at line 54 of file nvmnand_ufs_util.h.
| #define MNAND_UFS_PRN_DEVICE_OFFSET (16U) |
Offset to the PRN as returned by UFS.
Definition at line 97 of file nvmnand_ufs_util.h.
| #define MNAND_UFS_UNIT_DESC_SIZE 0x23 |
Definition at line 53 of file nvmnand_ufs_util.h.
| #define PURGE_STATUS_COMPLETED 3 |
Definition at line 88 of file nvmnand_ufs_util.h.
| #define PURGE_STATUS_INPROGRESS 1 |
Definition at line 87 of file nvmnand_ufs_util.h.
| #define QUERY_ATTR_IDN_BKOPS_STATUS 0x5 |
Definition at line 45 of file nvmnand_ufs_util.h.
| #define QUERY_ATTR_IDN_FFU_STATUS 0x14 |
Definition at line 47 of file nvmnand_ufs_util.h.
| #define QUERY_ATTR_IDN_PURGE_STATUS 0x6 |
Definition at line 46 of file nvmnand_ufs_util.h.
| #define QUERY_DESC_IDN_CONFIGURAION 0x1 |
Definition at line 34 of file nvmnand_ufs_util.h.
| #define QUERY_DESC_IDN_DEVICE 0x0 |
Definition at line 33 of file nvmnand_ufs_util.h.
| #define QUERY_DESC_IDN_DEVICE_HEALTH 0x9 |
Definition at line 37 of file nvmnand_ufs_util.h.
| #define QUERY_DESC_IDN_GEOMETRY 0x7 |
Definition at line 36 of file nvmnand_ufs_util.h.
| #define QUERY_DESC_IDN_UNIT 0x2 |
Definition at line 35 of file nvmnand_ufs_util.h.
| #define QUERY_FLAG_IDN_BKOPS_EN 0x4 |
Definition at line 40 of file nvmnand_ufs_util.h.
| #define QUERY_FLAG_IDN_PURGE_EN 0x6 |
Definition at line 41 of file nvmnand_ufs_util.h.
| #define QUERY_FLAG_IDN_RFSH_EN 0x7 |
Definition at line 42 of file nvmnand_ufs_util.h.
| #define SCSI_INQUIRY_CMD_BLK_LEN 6 |
Definition at line 66 of file nvmnand_ufs_util.h.
| #define SCSI_INQUIRY_CMD_CODE 0x12 |
Definition at line 57 of file nvmnand_ufs_util.h.
| #define SCSI_MODE_FFU_VAL 0xE |
Definition at line 91 of file nvmnand_ufs_util.h.
| #define SCSI_MODE_SELECT_CMD_BLK_LEN 10 |
Definition at line 68 of file nvmnand_ufs_util.h.
| #define SCSI_MODE_SELECT_CMD_CODE 0x55 |
Definition at line 59 of file nvmnand_ufs_util.h.
| #define SCSI_MODE_SENSE_CMD_BLK_LEN 10 |
Definition at line 67 of file nvmnand_ufs_util.h.
| #define SCSI_MODE_SENSE_CMD_CODE 0x5A |
Definition at line 58 of file nvmnand_ufs_util.h.
| #define SCSI_READ_CAPACITY_CMD_BLK_LEN 16 |
Definition at line 71 of file nvmnand_ufs_util.h.
| #define SCSI_READ_CAPACITY_CMD_CODE 0x25 |
Definition at line 62 of file nvmnand_ufs_util.h.
| #define SCSI_STD_INQUIRY_REPLY_LEN 36 |
Definition at line 75 of file nvmnand_ufs_util.h.
| #define SCSI_SYNC_CACHE10_CMD_BLK_LEN 10 |
Definition at line 69 of file nvmnand_ufs_util.h.
| #define SCSI_SYNC_CACHE10_CMD_CODE 0x35 |
Definition at line 60 of file nvmnand_ufs_util.h.
| #define SCSI_UNMAP_CMD_BLK_LEN 10 |
Definition at line 70 of file nvmnand_ufs_util.h.
| #define SCSI_UNMAP_CMD_CODE 0x42 |
Definition at line 61 of file nvmnand_ufs_util.h.
| #define SCSI_WRITE_BUFFER_CMD_CODE 0x3B |
Definition at line 63 of file nvmnand_ufs_util.h.
| #define SCSI_WRITE_BUFFER_CMD_LEN 10 |
Definition at line 72 of file nvmnand_ufs_util.h.
| #define UFS_POWER_MODE_POWER_DOWN 3 |
Definition at line 78 of file nvmnand_ufs_util.h.
| #define UNMAP_BLOCK_COUNT_MAX 0xFFFFFFFF |
Definition at line 84 of file nvmnand_ufs_util.h.
| #define UPIU_QUERY_OPCODE_CLEAR_FLAG 0x07 |
Definition at line 29 of file nvmnand_ufs_util.h.
| #define UPIU_QUERY_OPCODE_READ_ATTR 0x03 |
Definition at line 25 of file nvmnand_ufs_util.h.
| #define UPIU_QUERY_OPCODE_READ_DESC 0x01 |
Common functions/definitions used on UFS.
Chip independent
Definition at line 23 of file nvmnand_ufs_util.h.
| #define UPIU_QUERY_OPCODE_READ_FLAG 0x05 |
Definition at line 27 of file nvmnand_ufs_util.h.
| #define UPIU_QUERY_OPCODE_SET_FLAG 0x06 |
Definition at line 28 of file nvmnand_ufs_util.h.
| #define UPIU_QUERY_OPCODE_TOGGLE_FLAG 0x08 |
Definition at line 30 of file nvmnand_ufs_util.h.
| #define UPIU_QUERY_OPCODE_WRITE_ATTR 0x04 |
Definition at line 26 of file nvmnand_ufs_util.h.
| #define UPIU_QUERY_OPCODE_WRITE_DESC 0x02 |
Definition at line 24 of file nvmnand_ufs_util.h.
| MNAND_STATUS mnand_ufs_query_attr_read | ( | int | fd, |
| uint8_t | idn, | ||
| uint8_t | index, | ||
| uint8_t | sel, | ||
| uint32_t * | attr | ||
| ) |
Send UFS Query - Attribute Read Request.
| fd | - file descriptor to opened mNAND device |
| idn | - Attribute identifier |
| index | - index |
| sel | - selector |
| attr | - buffer to store the attribute read |
| MNAND_OK,success | |
| else | problem with operation |
| MNAND_STATUS mnand_ufs_query_attr_write | ( | int | fd, |
| uint8_t | idn, | ||
| uint8_t | index, | ||
| uint8_t | sel, | ||
| uint32_t * | attr | ||
| ) |
Send UFS Query - Attribute Write Request.
| fd | - file descriptor to opened mNAND device |
| idn | - Attribute identifier |
| index | - index |
| sel | - selector |
| attr | - buffer to store the attribute to be written |
| MNAND_OK,success | |
| else | problem with operation |
| MNAND_STATUS mnand_ufs_query_config_desc_read | ( | int | fd, |
| uint8_t | index, | ||
| uint8_t * | buffer, | ||
| uint32_t * | buf_size | ||
| ) |
Send UFS Query - Config Descriptor Read.
| fd | - file descriptor to opened mNAND device |
| index | - index |
| buffer | - buffer to store the descriptor read |
| buf_size | - size of the buffer passed/size of the descriptor read |
| MNAND_OK,success | |
| else | problem with operation |
| MNAND_STATUS mnand_ufs_query_config_desc_write | ( | int | fd, |
| uint8_t | index, | ||
| uint8_t * | buffer, | ||
| uint32_t * | buf_size | ||
| ) |
Send UFS Query - Config Descriptor Write.
| fd | - file descriptor to opened mNAND device |
| index | - index |
| buffer | - buffer to store the descriptor data to be updated in device |
| buf_size | - size of the buffer passed/size of the descriptor written |
| MNAND_OK,success | |
| else | problem with operation |
| MNAND_STATUS mnand_ufs_query_desc_read | ( | int | fd, |
| uint8_t | idn, | ||
| uint8_t | index, | ||
| uint8_t | sel, | ||
| uint8_t * | buffer, | ||
| uint32_t * | buf_size | ||
| ) |
Send UFS Query - Descriptor Read Request.
| fd | - file descriptor to opened mNAND device |
| idn | - Descriptor identifier |
| index | - index |
| sel | - selector |
| buffer | - buffer to store the descriptor read |
| buf_size | - size of the buffer passed/size of the descriptor read |
| MNAND_OK,success | |
| else | problem with operation |
| MNAND_STATUS mnand_ufs_query_desc_write | ( | int | fd, |
| uint8_t | idn, | ||
| uint8_t | index, | ||
| uint8_t | sel, | ||
| uint8_t * | buffer, | ||
| uint32_t * | buf_size | ||
| ) |
Send UFS Query - Descriptor Write Request.
| fd | - file descriptor to opened mNAND device |
| idn | - Descriptor identifier |
| index | - index |
| sel | - selector |
| buffer | - buffer to store the descriptor to be written |
| buf_size | - size of the buffer passed/size of the descriptor written |
| MNAND_OK,success | |
| else | problem with operation |
| MNAND_STATUS mnand_ufs_query_device_desc_read | ( | int | fd, |
| uint8_t * | buffer, | ||
| uint32_t * | buf_size | ||
| ) |
Send UFS Query - Device Descriptor Read.
| fd | - file descriptor to opened mNAND device |
| buffer | - buffer to store the descriptor read |
| buf_size | - size of the buffer passed/size of the descriptor read |
| MNAND_OK,success | |
| else | problem with operation |
| MNAND_STATUS mnand_ufs_query_flag_clear | ( | int | fd, |
| uint8_t | idn, | ||
| uint8_t | index, | ||
| uint8_t | sel | ||
| ) |
Send UFS Query - Clear Flag Request.
| fd | - file descriptor to opened mNAND device |
| idn | - Flag identifier |
| index | - index |
| sel | - selector |
| MNAND_OK,success | |
| else | problem with operation |
| MNAND_STATUS mnand_ufs_query_flag_read | ( | int | fd, |
| uint8_t | idn, | ||
| uint8_t | index, | ||
| uint8_t | sel, | ||
| uint8_t * | flag | ||
| ) |
Send UFS Query - Attribute Read Request.
| fd | - file descriptor to opened mNAND device |
| idn | - flag identifier |
| index | - index |
| sel | - selector |
| attr | - buffer to store the flag read |
| MNAND_OK,success | |
| else | problem with operation |
| MNAND_STATUS mnand_ufs_query_flag_set | ( | int | fd, |
| uint8_t | idn, | ||
| uint8_t | index, | ||
| uint8_t | sel | ||
| ) |
Send UFS Query - Set Flag Request.
| fd | - file descriptor to opened mNAND device |
| idn | - Flag identifier |
| index | - index |
| sel | - selector |
| MNAND_OK,success | |
| else | problem with operation |
| MNAND_STATUS mnand_ufs_query_flag_toggle | ( | int | fd, |
| uint8_t | idn, | ||
| uint8_t | index, | ||
| uint8_t | sel | ||
| ) |
Send UFS Query - Toggle Flag Request.
| fd | - file descriptor to opened mNAND device |
| idn | - Flag identifier |
| index | - index |
| sel | - selector |
| MNAND_OK,success | |
| else | problem with operation |
| MNAND_STATUS mnand_ufs_query_geo_desc_read | ( | int | fd, |
| uint8_t * | buffer, | ||
| uint32_t * | buf_size | ||
| ) |
Send UFS Query - Geometry Descriptor Read.
| fd | - file descriptor to opened mNAND device |
| buffer | - buffer to store the descriptor read |
| buf_size | - size of the buffer passed/size of the descriptor read |
| MNAND_OK,success | |
| else | problem with operation |
| MNAND_STATUS mnand_ufs_query_health_desc_read | ( | int | fd, |
| uint8_t | index, | ||
| uint8_t * | buffer, | ||
| uint32_t * | buf_size | ||
| ) |
Send UFS Query - Health Descriptor Read.
| fd | - file descriptor to opened mNAND device |
| index | - index |
| buffer | - buffer to store the descriptor read |
| buf_size | - size of the buffer passed/size of the descriptor read |
| MNAND_OK,success | |
| else | problem with operation |
| MNAND_STATUS mnand_ufs_query_unit_desc_read | ( | int | fd, |
| uint8_t | index, | ||
| uint8_t * | buffer, | ||
| uint32_t * | buf_size | ||
| ) |
Send UFS Query - Unit Descriptor Read.
| fd | - file descriptor to opened mNAND device |
| index | - index |
| buffer | - buffer to store the descriptor read |
| buf_size | - size of the buffer passed/size of the descriptor read |
| MNAND_OK,success | |
| else | problem with operation |
| MNAND_STATUS mnand_ufs_read_capacity | ( | int | fd, |
| uint8_t * | buffer, | ||
| uint32_t * | buf_size | ||
| ) |
Send SCSI Read Capacity Request.
| fd | - file descriptor to opened mNAND device |
| buffer | - pointer to the buffer to store the read capacity response data |
| buf_size | - size of the buffer/size of read capacity data received |
| MNAND_OK,success | |
| else | problem with operation |
| MNAND_STATUS mnand_ufs_scsi_cmd | ( | int | fd, |
| uint8_t * | cmd_blk, | ||
| uint32_t | cmd_len, | ||
| int | dxfer_dir, | ||
| uint8_t * | data_buffer, | ||
| uint32_t * | data_buf_size | ||
| ) |
Send SCSI Command.
| fd | - file descriptor to opened mNAND device |
| cmd_blk | - pointer to the buffer for command block |
| cmd_len | - command block buffer length |
| data_buffer | - pointer to the buffer which has the data to be read/written |
| data_buf_size | - size of the read/write buffer |
| MNAND_OK,success | |
| else | problem with operation |
| MNAND_STATUS mnand_ufs_scsi_inquiry | ( | int | fd, |
| int8_t | evpd, | ||
| uint8_t | page_code, | ||
| uint8_t * | buffer, | ||
| uint32_t * | buf_size | ||
| ) |
Send SCSI Inquiry Request.
| fd | - file descriptor to opened mNAND device |
| evpd | - evpd flag for inquiry request |
| page_code | -page code for inquiry request |
| buffer | - pointer to the buffer to store the inquiry data response |
| buf_size | - size of the buffer/size of inquiry data read |
| MNAND_OK,success | |
| else | problem with operation |
| MNAND_STATUS mnand_ufs_scsi_mode_select | ( | int | fd, |
| int8_t | save_pages, | ||
| uint8_t * | buffer, | ||
| uint32_t * | buf_size | ||
| ) |
Send SCSI Mode Select Request.
| fd | - file descriptor to opened mNAND device |
| page_code | - save pages option for mode select request |
| buffer | - pointer to the buffer to store the mode select data |
| buf_size | - size of the buffer/size of mode sense data written |
| MNAND_OK,success | |
| else | problem with operation |
| MNAND_STATUS mnand_ufs_scsi_mode_sense | ( | int | fd, |
| uint8_t | page_code, | ||
| uint8_t | sub_page_code, | ||
| uint8_t * | buffer, | ||
| uint32_t * | buf_size | ||
| ) |
Send SCSI Mode Sense Request.
| fd | - file descriptor to opened mNAND device |
| page_code | - page code for mode sense request |
| sub_page_code | - sub page code for mode sense request |
| buffer | - pointer to the buffer to store the mode sense data response |
| buf_size | - size of the buffer/size of mode sense data read |
| MNAND_OK,success | |
| else | problem with operation |
| MNAND_STATUS mnand_ufs_scsi_read_buffer | ( | int | fd, |
| uint8_t * | cmd_blk, | ||
| uint32_t | cmd_blk_len, | ||
| uint8_t * | buffer, | ||
| uint32_t * | buf_size | ||
| ) |
Send SCSI Read Buffer.
| fd | - file descriptor to opened mNAND device |
| cmd_blk | - pointer to the buffer for command block |
| cmd_blk_len | - command block buffer length |
| buffer | - pointer to the buffer that stores the data read |
| buf_size | - size of the read buffer |
| MNAND_OK,success | |
| else | problem with operation |
| MNAND_STATUS mnand_ufs_scsi_sync_cache | ( | int | fd | ) |
Send SCSI Sync Cache Request.
| fd | - file descriptor to opened mNAND device |
| MNAND_OK,success | |
| else | problem with operation |
| MNAND_STATUS mnand_ufs_scsi_write_buffer | ( | int | fd, |
| uint8_t * | cmd_blk, | ||
| uint32_t | cmd_blk_len, | ||
| uint8_t * | buffer, | ||
| uint32_t * | buf_size | ||
| ) |
Send SCSI Write Buffer.
| fd | - file descriptor to opened mNAND device |
| cmd_blk | - pointer to the buffer for command block |
| cmd_blk_len | - command block buffer length |
| buffer | - pointer to the buffer which has the data to be written |
| buf_size | - size of the write buffer |
| MNAND_OK,success | |
| else | problem with operation |
| MNAND_STATUS mnand_ufs_send_combo_query_command | ( | int | fd, |
| mnand_ufs_query_req * | query_buf, | ||
| uint8_t | num_cmds, | ||
| uint8_t | need_cq_empty, | ||
| uint8_t | ret_on_err | ||
| ) |
Send UFS combo query request.
| fd | - file descriptor to opened mNAND device |
| query_buf | - pointer to query request buffer |
| num_cmds | - number of query requests in this combo request |
| need_cq_empty | - Flag to specify if this request needs cq to be empty |
| ret_on_err | - Flag to specify to return on error or continue furthur |
| MNAND_OK,success | |
| else | problem with operation |
| MNAND_STATUS mnand_ufs_set_power_mode | ( | int | fd, |
| uint32_t | power_mode | ||
| ) |
Set UFS power mode.
| fd | - file descriptor to opened mNAND device |
| power_mode | - power mode to be set |
| MNAND_OK,success | |
| else | problem with operation |
| MNAND_STATUS mnand_ufs_unmap | ( | int | fd, |
| uint8_t * | buffer, | ||
| uint32_t * | buf_size | ||
| ) |
Send SCSI Mode Select Request.
| fd | - file descriptor to opened mNAND device |
| buffer | - pointer to the buffer to store the unmap data |
| buf_size | - size of the buffer/size of unmap data written |
| MNAND_OK,success | |
| else | problem with operation |