Functions | |
| static hpm_stat_t | emmc_set_rca (emmc_card_t *card, uint16_t relative_addr) |
| Set Relative Address. More... | |
| static hpm_stat_t | emmc_send_csd (emmc_card_t *card) |
| Send CSD register. More... | |
| static hpm_stat_t | emmc_send_ext_csd (emmc_card_t *card) |
| Send Extend CSD register. More... | |
| static hpm_stat_t | emmc_decode_ext_csd (emmc_card_t *card, emmc_ext_csd_t *ext_csd) |
| static hpm_stat_t | emmc_polling_card_status_busy (emmc_card_t *card, uint32_t timeout_ms) |
| static hpm_stat_t | emmc_send_op_cond (emmc_card_t *card, emmc_ocr_t ocr) |
| static void | emmc_decode_csd (emmc_card_t *card, uint32_t *raw_csd) |
| static hpm_stat_t | emmc_set_bus_width (emmc_card_t *card, emmc_bus_mode_t bus_mode) |
| static hpm_stat_t | emmc_set_hs_timing (emmc_card_t *card, emmc_hs_timing_t timing) |
| static hpm_stat_t | emmc_check_card_parameters (emmc_card_t *card) |
| static hpm_stat_t | emmc_error_recovery (emmc_card_t *card) |
| static hpm_stat_t | emmc_send_cmd (emmc_card_t *card, sdmmchost_cmd_t *cmd) |
| static hpm_stat_t | emmc_transfer (emmc_card_t *card, sdmmchost_xfer_t *content) |
| static hpm_stat_t | emmc_send_card_status (emmc_card_t *card) |
| static uint32_t | emmc_get_24bit_num_from_ext_csd (const uint8_t *array) |
| static hpm_stat_t | emmc_all_send_cid (emmc_card_t *card) |
| hpm_stat_t | emmc_send_cid (emmc_card_t *card) |
| Request eMMC device to send CID to Host. More... | |
| void | emmc_card_deinit (emmc_card_t *card) |
| hpm_stat_t | emmc_host_init (emmc_card_t *card) |
| hpm_stat_t | emmc_init (emmc_card_t *card) |
| Intialize eMMC device, include both host and the device. More... | |
| void | emmc_deinit (emmc_card_t *card) |
| hpm_stat_t | emmc_probe_device (emmc_card_t *card) |
| Probe eMMC device. More... | |
| hpm_stat_t | emmc_card_init (emmc_card_t *card) |
| Initialize eMMC device. More... | |
| bool | emmc_is_card_present (emmc_card_t *card) |
| hpm_stat_t | emmc_select_card (emmc_card_t *card, bool is_selected) |
| Select eMMC device. More... | |
| hpm_stat_t | emmc_read_blocks (emmc_card_t *card, uint8_t *buffer, uint32_t start_block, uint32_t block_count) |
| Read eMMC blocks. More... | |
| hpm_stat_t | emmc_write_blocks (emmc_card_t *card, const uint8_t *buffer, uint32_t start_block, uint32_t block_count) |
| Write eMMC blocks. More... | |
| static uint32_t | emmc_calculate_erase_timeout (emmc_card_t *card, uint32_t start_block, uint32_t block_count) |
| Calculate SD erase timeout value Refer to SD_Specification_Part1_Physical_Layer_Specification_Version4.20.pdf, section 4.14 for more details. More... | |
| hpm_stat_t | emmc_erase_blocks (emmc_card_t *card, uint32_t start_block, uint32_t block_count, emmc_erase_option_t erase_option) |
| Erase eMMC Blocks. More... | |
| hpm_stat_t | emmc_switch_function (emmc_card_t *card, emmc_switch_cmd_arg_t arg, uint32_t timeout_us) |
| Switch eMMC function. More... | |
| hpm_stat_t | emmc_configure_partition (emmc_card_t *card, emmc_config_partition_option_t option) |
| Configure eMMC Partition. More... | |
| hpm_stat_t | emmc_enter_sleep_mode (emmc_card_t *card) |
| Switch eMMC device into sleep mode. More... | |
| hpm_stat_t | emmc_exit_sleep_mode (emmc_card_t *card) |
| Switch eMMC device into standby mode. More... | |
| #define EMMC_CMD_SET_REV_MAX (0U) |
| #define EMMC_CSD_VERSION_MAX (2U) |
| #define EMMC_EXT_CSD_REV_MAX (8U) |
| #define EMMC_RCA_DEFAULT (1U) |
| #define EMMC_SECTOR_SIZE_DEFAULT (512U) |
| #define EXT_CSD_BOOT_INFO_ALT_BOOT_MODE_MASK (1U) |
| #define EXT_CSD_BOOT_INFO_DDR_BOOT_MODE_MASK (2U) |
| #define EXT_CSD_BOOT_INFO_HS_BOOT_MODE_MASK (4U) |
| #define EXT_CSD_ERASE_GROUP_DEF_ENABLE_MASK (1UL << 0) |
| #define EXT_CSD_HS_TIMING_COMPATIBLE (0U) |
| #define EXT_CSD_HS_TIMING_HIGH_SPEED (1U) |
| #define EXT_CSD_HS_TIMING_HS200 (2U) |
| #define EXT_CSD_HS_TIMING_HS400 (3U) |
| #define EXT_CSD_SEC_FEATURE_SUPPORT_SEC_BD_BLK_EN_MASK (1UL << 2) |
| #define EXT_CSD_SEC_FEATURE_SUPPORT_SEC_GB_CL_EN_MASK (1UL << 4) |
| #define EXT_CSD_SEC_FEATURE_SUPPORT_SEC_SANITIZE_MASK (1UL << 6) |
| #define EXT_CSD_SEC_FEATURE_SUPPORT_SECURE_ER_EN_MASK (1UL << 0) |
| #define EXT_CSD_SECURE_WP_INFO_SECURE_WP_EN_STATUS (2U) |
| #define EXT_CSD_SECURE_WP_INFO_SECURE_WP_SUPPORT_MASK (1U) |
| #define MAX_BLOCK_COUNT ((1UL << 26) / 512 - 1U) |
| #define READ_BLOCK_TIMEOUT_IN_MS (100U) |
| #define SIZE_128KB (128UL * SIZE_1KB) |
| #define SIZE_512KB (512UL * SIZE_1KB) |
| #define SPEED_1Kbps (1000U) |
| #define SPEED_1Mbps (1000UL * 1000UL) |
| #define WRITE_BLOCK_TIMEOUT_IN_MS (1000U) |
|
static |
|
static |
Calculate SD erase timeout value Refer to SD_Specification_Part1_Physical_Layer_Specification_Version4.20.pdf, section 4.14 for more details.
| void emmc_card_deinit | ( | emmc_card_t * | card | ) |
| hpm_stat_t emmc_card_init | ( | emmc_card_t * | card | ) |
Initialize eMMC device.
| card |
|
static |
| hpm_stat_t emmc_configure_partition | ( | emmc_card_t * | card, |
| emmc_config_partition_option_t | option | ||
| ) |
Configure eMMC Partition.
| card | |
| option |
|
static |
|
static |
| void emmc_deinit | ( | emmc_card_t * | card | ) |
| hpm_stat_t emmc_enter_sleep_mode | ( | emmc_card_t * | card | ) |
Switch eMMC device into sleep mode.
| [in] | card |
| hpm_stat_t emmc_erase_blocks | ( | emmc_card_t * | card, |
| uint32_t | start_block, | ||
| uint32_t | block_count, | ||
| emmc_erase_option_t | option | ||
| ) |
Erase eMMC Blocks.
| [in] | card | |
| [in] | start_block | |
| [in] | block_count | |
| [in] | erase_option |
|
static |
| hpm_stat_t emmc_exit_sleep_mode | ( | emmc_card_t * | card | ) |
Switch eMMC device into standby mode.
| [in] | card |
|
static |
| hpm_stat_t emmc_host_init | ( | emmc_card_t * | card | ) |
| hpm_stat_t emmc_init | ( | emmc_card_t * | card | ) |
Intialize eMMC device, include both host and the device.
| card |
| bool emmc_is_card_present | ( | emmc_card_t * | card | ) |
|
static |
| hpm_stat_t emmc_probe_device | ( | emmc_card_t * | card | ) |
Probe eMMC device.
| card |
| hpm_stat_t emmc_read_blocks | ( | emmc_card_t * | card, |
| uint8_t * | buffer, | ||
| uint32_t | start_block, | ||
| uint32_t | block_count | ||
| ) |
Read eMMC blocks.
| card | |
| buffer | |
| start_block | |
| block_count |
| hpm_stat_t emmc_select_card | ( | emmc_card_t * | card, |
| bool | is_selected | ||
| ) |
Select eMMC device.
| card | |
| is_selected |
|
static |
| hpm_stat_t emmc_send_cid | ( | emmc_card_t * | card | ) |
Request eMMC device to send CID to Host.
| card |
|
static |
|
static |
Send CSD register.
|
static |
Send Extend CSD register.
|
static |
|
static |
|
static |
|
static |
Set Relative Address.
| hpm_stat_t emmc_switch_function | ( | emmc_card_t * | card, |
| emmc_switch_cmd_arg_t | arg, | ||
| uint32_t | timeout_us | ||
| ) |
Switch eMMC function.
| card | |
| arg | |
| timeout_us |
|
static |
| hpm_stat_t emmc_write_blocks | ( | emmc_card_t * | card, |
| const uint8_t * | buffer, | ||
| uint32_t | start_block, | ||
| uint32_t | block_count | ||
| ) |
Write eMMC blocks.
| card | |
| buffer | |
| start_block | |
| block_count |