coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
mmc.c File Reference
#include <commonlib/storage.h>
#include <delay.h>
#include "mmc.h"
#include "sd_mmc.h"
#include "storage.h"
#include <string.h>
#include <timer.h>
Include dependency graph for mmc.c:

Go to the source code of this file.

Functions

static int mmc_send_op_cond_iter (struct storage_media *media, struct mmc_command *cmd, int use_arg)
 
int mmc_send_op_cond (struct storage_media *media)
 
int mmc_complete_op_cond (struct storage_media *media)
 
int mmc_send_ext_csd (struct sd_mmc_ctrlr *ctrlr, unsigned char *ext_csd)
 
static int mmc_switch (struct storage_media *media, uint8_t index, uint8_t value)
 
static void mmc_recalculate_clock (struct storage_media *media)
 
static int mmc_select_hs (struct storage_media *media)
 
static int mmc_send_tuning_seq (struct sd_mmc_ctrlr *ctrlr, char *buffer)
 
static int mmc_bus_tuning (struct storage_media *media)
 
static int mmc_select_hs400 (struct storage_media *media)
 
static int mmc_select_hs200 (struct storage_media *media)
 
int mmc_change_freq (struct storage_media *media)
 
int mmc_set_bus_width (struct storage_media *media)
 
int mmc_update_capacity (struct storage_media *media)
 
int mmc_set_partition (struct storage_media *media, unsigned int partition_number)
 
const char * mmc_partition_name (struct storage_media *media, unsigned int partition_number)
 

Function Documentation

◆ mmc_bus_tuning()

static int mmc_bus_tuning ( struct storage_media media)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mmc_change_freq()

◆ mmc_complete_op_cond()

int mmc_complete_op_cond ( struct storage_media media)

◆ mmc_partition_name()

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().

Here is the caller graph for this function:

◆ mmc_recalculate_clock()

static void mmc_recalculate_clock ( struct storage_media media)
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().

Here is the caller graph for this function:

◆ mmc_select_hs()

static int mmc_select_hs ( struct storage_media media)
static

◆ mmc_select_hs200()

static int mmc_select_hs200 ( struct storage_media media)
static

◆ mmc_select_hs400()

◆ mmc_send_ext_csd()

◆ mmc_send_op_cond()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mmc_send_op_cond_iter()

◆ mmc_send_tuning_seq()

static int mmc_send_tuning_seq ( struct sd_mmc_ctrlr ctrlr,
char *  buffer 
)
static

◆ mmc_set_bus_width()

int mmc_set_bus_width ( struct storage_media media)

◆ mmc_set_partition()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mmc_switch()

static int mmc_switch ( struct storage_media media,
uint8_t  index,
uint8_t  value 
)
static

◆ mmc_update_capacity()