![]() |
coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <commonlib/storage.h>
#include <delay.h>
#include "mmc.h"
#include "sd_mmc.h"
#include "storage.h"
#include <string.h>
#include <timer.h>
Go to the source code of this file.
|
static |
Definition at line 203 of file mmc.c.
References ALLOC_CACHE_ALIGN_BUFFER, buffer, storage_media::ctrlr, sd_mmc_ctrlr::is_tuning_complete, media, mmc_send_tuning_seq(), sd_mmc_error, and sd_mmc_ctrlr::tuning_start.
Referenced by mmc_select_hs200().
int mmc_change_freq | ( | struct storage_media * | media | ) |
Definition at line 309 of file mmc.c.
References ALLOC_CACHE_ALIGN_BUFFER, sd_mmc_ctrlr::caps, storage_media::caps, storage_media::ctrlr, DRVR_CAP_ENHANCED_STROBE, DRVR_CAP_HS200, DRVR_CAP_HS400, EXT_CSD_CARD_TYPE, EXT_CSD_STROBE_SUPPORT, media, MMC_HS400, MMC_HS_200MHZ, mmc_select_hs(), mmc_select_hs200(), mmc_select_hs400(), mmc_send_ext_csd(), MMC_VERSION_4, and storage_media::version.
Referenced by storage_startup().
int mmc_complete_op_cond | ( | struct storage_media * | media | ) |
Definition at line 65 of file mmc.c.
References CARD_UNUSABLE_ERR, storage_media::high_capacity, media, MMC_INIT_TIMEOUT_US_MS, mmc_send_op_cond_iter(), MMC_VERSION_UNKNOWN, storage_media::ocr, OCR_BUSY, OCR_HCS, storage_media::op_cond_response, storage_media::rca, mmc_command::response, stopwatch_expired(), stopwatch_init_msecs_expire(), udelay(), and storage_media::version.
Referenced by sd_mmc_enter_standby().
const char* mmc_partition_name | ( | struct storage_media * | media, |
unsigned int | partition_number | ||
) |
Definition at line 514 of file mmc.c.
References ARRAY_SIZE.
Referenced by storage_partition_name().
|
static |
Definition at line 149 of file mmc.c.
References storage_media::caps, CLOCK_200MHZ, CLOCK_26MHZ, CLOCK_52MHZ, storage_media::ctrlr, DRVR_CAP_HS, DRVR_CAP_HS200, DRVR_CAP_HS400, DRVR_CAP_HS52, media, and SET_CLOCK.
Referenced by mmc_select_hs(), mmc_select_hs200(), and mmc_select_hs400().
|
static |
Definition at line 164 of file mmc.c.
References BUS_TIMING_MMC_HS, storage_media::caps, storage_media::ctrlr, DRVR_CAP_HS, DRVR_CAP_HS200, DRVR_CAP_HS400, DRVR_CAP_HS52, EXT_CSD_HS_TIMING, EXT_CSD_TIMING_HS, media, mmc_recalculate_clock(), mmc_switch(), sd_mmc_error, SD_MMC_IO_RETRIES, sd_mmc_send_status(), sdhc_debug, and SET_TIMING.
Referenced by mmc_change_freq(), and mmc_select_hs400().
|
static |
Definition at line 273 of file mmc.c.
References BUS_TIMING_MMC_HS200, sd_mmc_ctrlr::caps, storage_media::caps, storage_media::ctrlr, DRVR_CAP_HS, DRVR_CAP_HS200, DRVR_CAP_HS200_TUNING, DRVR_CAP_HS52, EXT_CSD_BUS_WIDTH, EXT_CSD_BUS_WIDTH_8, EXT_CSD_HS_TIMING, EXT_CSD_TIMING_HS200, media, mmc_bus_tuning(), mmc_recalculate_clock(), mmc_switch(), sd_mmc_error, sdhc_debug, SET_BUS_WIDTH, and SET_TIMING.
Referenced by mmc_change_freq().
|
static |
Definition at line 224 of file mmc.c.
References BUS_TIMING_MMC_HS400, BUS_TIMING_MMC_HS400ES, sd_mmc_ctrlr::bus_width, sd_mmc_ctrlr::caps, storage_media::caps, storage_media::ctrlr, DRVR_CAP_ENHANCED_STROBE, DRVR_CAP_HS, DRVR_CAP_HS400, DRVR_CAP_HS52, EXT_CSD_BUS_WIDTH, EXT_CSD_BUS_WIDTH_8, EXT_CSD_BUS_WIDTH_STROBE, EXT_CSD_DDR_BUS_WIDTH_8, EXT_CSD_HS_TIMING, EXT_CSD_TIMING_HS400, media, mmc_recalculate_clock(), mmc_select_hs(), mmc_switch(), sd_mmc_error, SD_MMC_IO_RETRIES, sd_mmc_send_status(), sdhc_debug, SET_BUS_WIDTH, SET_TIMING, and sd_mmc_ctrlr::timing.
Referenced by mmc_change_freq().
int mmc_send_ext_csd | ( | struct sd_mmc_ctrlr * | ctrlr, |
unsigned char * | ext_csd | ||
) |
Definition at line 96 of file mmc.c.
References mmc_data::blocks, mmc_data::blocksize, CARD_RSP_R1, mmc_command::cmdarg, mmc_command::cmdidx, CONFIG, DATA_FLAG_READ, mmc_data::dest, mmc_command::flags, mmc_data::flags, MMC_CMD_SEND_EXT_CSD, mmc_command::resp_type, sd_mmc_trace, and sd_mmc_ctrlr::send_cmd.
Referenced by mmc_change_freq(), mmc_set_bus_width(), and mmc_update_capacity().
int mmc_send_op_cond | ( | struct storage_media * | media | ) |
Definition at line 45 of file mmc.c.
References CARD_IN_PROGRESS, mmc_command::cmdarg, media, mmc_send_op_cond_iter(), OCR_BUSY, and storage_media::op_cond_response.
Referenced by early_mmc_wake_hw(), mtk_emmc_early_init(), and sd_mmc_enter_standby().
|
static |
Definition at line 16 of file mmc.c.
References sd_mmc_ctrlr::caps, CARD_RSP_R3, mmc_command::cmdarg, mmc_command::cmdidx, storage_media::ctrlr, DRVR_CAP_HC, mmc_command::flags, mask, media, MMC_CMD_SEND_OP_COND, NULL, OCR_ACCESS_MODE, OCR_HCS, OCR_VOLTAGE_MASK, storage_media::op_cond_response, mmc_command::resp_type, mmc_command::response, sd_mmc_ctrlr::send_cmd, and sd_mmc_ctrlr::voltages.
Referenced by mmc_complete_op_cond(), and mmc_send_op_cond().
|
static |
Definition at line 185 of file mmc.c.
References mmc_data::blocks, mmc_data::blocksize, buffer, sd_mmc_ctrlr::bus_width, CARD_RSP_R1, CMD_FLAG_IGNORE_INHIBIT, mmc_command::cmdarg, mmc_command::cmdidx, DATA_FLAG_READ, mmc_data::dest, mmc_command::flags, mmc_data::flags, MMC_CMD_AUTO_TUNING_SEQUENCE, mmc_command::resp_type, and sd_mmc_ctrlr::send_cmd.
Referenced by mmc_bus_tuning().
int mmc_set_bus_width | ( | struct storage_media * | media | ) |
Definition at line 341 of file mmc.c.
References ALLOC_CACHE_ALIGN_BUFFER, storage_media::caps, storage_media::ctrlr, DRVR_CAP_HS200, DRVR_CAP_HS400, EXT_CSD_BUS_WIDTH, EXT_CSD_BUS_WIDTH_8, EXT_CSD_ERASE_GROUP_DEF, EXT_CSD_HC_ERASE_GRP_SIZE, EXT_CSD_PARTITIONING_SUPPORT, EXT_CSD_REV, EXT_CSD_SEC_CNT, EXT_CSD_SIZE, media, memcmp(), mmc_send_ext_csd(), mmc_switch(), SET_BUS_WIDTH, and width.
Referenced by storage_startup().
int mmc_set_partition | ( | struct storage_media * | media, |
unsigned int | partition_number | ||
) |
Definition at line 491 of file mmc.c.
References storage_media::capacity, EXT_CSD_PART_ACCESS_MASK, EXT_CSD_PART_CONF, media, MMC_PARTITION_GP4, mmc_switch(), and storage_media::partition_config.
Referenced by storage_set_partition().
|
static |
Definition at line 130 of file mmc.c.
References CARD_RSP_R1b, mmc_command::cmdarg, mmc_command::cmdidx, storage_media::ctrlr, mmc_command::flags, media, MMC_CMD_SWITCH, MMC_SWITCH_MODE_WRITE_BYTE, NULL, mmc_command::resp_type, SD_MMC_IO_RETRIES, sd_mmc_send_status(), sd_mmc_ctrlr::send_cmd, and value.
Referenced by mmc_select_hs(), mmc_select_hs200(), mmc_select_hs400(), mmc_set_bus_width(), mmc_set_partition(), and mmc_update_capacity().
int mmc_update_capacity | ( | struct storage_media * | media | ) |
Definition at line 388 of file mmc.c.
References ALLOC_CACHE_ALIGN_BUFFER, storage_media::capacity, storage_media::csd, storage_media::ctrlr, storage_media::erase_blocks, EXT_CSD_BOOT_SIZE_MULT, EXT_CSD_ERASE_GROUP_DEF, EXT_CSD_GP_SIZE_MULT_GP0, EXT_CSD_GP_SIZE_MULT_GP1, EXT_CSD_GP_SIZE_MULT_GP2, EXT_CSD_GP_SIZE_MULT_GP3, EXT_CSD_HC_WP_GRP_SIZE, EXT_CSD_PART_ACCESS_MASK, EXT_CSD_PART_CONF, EXT_CSD_PARTITION_ENABLE, EXT_CSD_REV, EXT_CSD_RPMB_SIZE_MULT, EXT_CSD_SEC_CNT, EXT_CSD_SIZE, EXT_CSD_TRIM_MULT, KiB, media, MMC_PARTITION_BOOT_1, MMC_PARTITION_BOOT_2, MMC_PARTITION_GP1, MMC_PARTITION_GP2, MMC_PARTITION_GP3, MMC_PARTITION_GP4, MMC_PARTITION_RPMB, MMC_PARTITION_USER, mmc_send_ext_csd(), mmc_switch(), MMC_VERSION_4, storage_media::partition_config, sd_mmc_extract_uint32_bits(), sdhc_error, storage_media::trim_mult, storage_media::version, and storage_media::write_bl_len.
Referenced by storage_startup().