coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <assert.h>
#include <cbmem.h>
#include <commonlib/bsd/helpers.h>
#include <commonlib/storage/sd_mmc.h>
#include <console/console.h>
#include <delay.h>
#include <device/mmio.h>
#include <lib.h>
#include <soc/msdc.h>
#include <string.h>
#include <timer.h>
Go to the source code of this file.
|
static |
Definition at line 410 of file msdc.c.
References sd_mmc_ctrlr::caps, sd_mmc_ctrlr::f_max, sd_mmc_ctrlr::f_min, msdc_init_hw(), msdc_trace, msdc_update_pointers(), msdc_ctrlr::sd_mmc_ctrlr, and sd_mmc_ctrlr::voltages.
Referenced by msdc_controller_init().
|
static |
Definition at line 242 of file msdc.c.
References msdc_ctrlr::base, CARD_RSP_136, CARD_RSP_PRESENT, mmc_command::cmdidx, EIO, ETIMEDOUT, MMC_CMD_AUTO_TUNING_SEQUENCE, MSDC_INT_CMDRDY, MSDC_INT_CMDTMO, msdc_reset_hw(), read32(), mmc_command::resp_type, mmc_command::response, SDC_RESP0, SDC_RESP1, SDC_RESP2, and SDC_RESP3.
Referenced by msdc_start_command().
|
static |
Definition at line 156 of file msdc.c.
References CARD_RSP_NONE, CARD_RSP_R1, CARD_RSP_R1b, CARD_RSP_R2, CARD_RSP_R3, and mmc_command::resp_type.
Referenced by msdc_cmd_prepare_raw_cmd().
|
static |
Definition at line 173 of file msdc.c.
References msdc_ctrlr::base, msdc_error, msdc_poll_timeout(), msdc_reset_hw(), MSDC_SUCCESS, read32(), SDC_STS, SDC_STS_CMDBUSY, and SDC_STS_SDCBUSY.
Referenced by msdc_start_command().
|
static |
Definition at line 196 of file msdc.c.
References mmc_data::blocks, mmc_data::blocksize, mmc_command::cmdidx, DATA_FLAG_READ, mmc_data::flags, MMC_CMD_AUTO_TUNING_SEQUENCE, MMC_CMD_READ_MULTIPLE_BLOCK, MMC_CMD_READ_SINGLE_BLOCK, MMC_CMD_SEND_STATUS, MMC_CMD_STOP_TRANSMISSION, MMC_CMD_WRITE_MULTIPLE_BLOCK, MMC_CMD_WRITE_SINGLE_BLOCK, msdc_cmd_find_resp(), SDC_CMD_BLK_LEN_M, SDC_CMD_BLK_LEN_S, SDC_CMD_CMD_M, SDC_CMD_CMD_S, SDC_CMD_DTYPE_M, SDC_CMD_DTYPE_S, SDC_CMD_RSPTYP_M, SDC_CMD_RSPTYP_S, SDC_CMD_STOP, and SDC_CMD_WR.
Referenced by msdc_start_command().
|
static |
Definition at line 430 of file msdc.c.
References add_msdc(), base, msdc_ctrlr::base, memset(), msdc_ctrlr::src_hz, and msdc_ctrlr::top_base.
Referenced by mtk_emmc_early_init().
|
static |
Definition at line 148 of file msdc.c.
References msdc_ctrlr::base, msdc_error, MSDC_FIFOCS, MSDC_FIFOCS_CLR, msdc_poll_timeout(), MSDC_SUCCESS, and setbits32.
Referenced by msdc_start_command().
|
static |
Definition at line 88 of file msdc.c.
References msdc_ctrlr::base, clrbits32, DATA_K_VALUE_SEL, EMMC50_CFG0, EMMC50_CFG_CFCSTS_SEL, EMMC_TOP_CMD, EMMC_TOP_CONTROL, MSDC_CFG, MSDC_CFG_MODE, MSDC_CFG_PIO, MSDC_CKGEN_MSDC_DLY_SEL, msdc_debug, MSDC_IOCON, MSDC_IOCON_DDLSEL, MSDC_PAD_TUNE, MSDC_PAD_TUNE_CMD_SEL, MSDC_PAD_TUNE_RD_SEL, MSDC_PATCH_BIT, MSDC_PATCH_BIT1, MSDC_PATCH_BIT1_STOP_DLY, MSDC_PATCH_BIT2, MSDC_PATCH_BIT2_CFGCRCSTS, MSDC_PATCH_BIT2_CFGRESP, MSDC_PB2_RESPWAIT, msdc_reset_hw(), msdc_set_field(), PAD_CMD_RD_RXDLY_SEL, PAD_DAT_RD_RXDLY_SEL, SDC_ADV_CFG0, SDC_CFG, SDC_CFG_DTOC, SDC_CFG_SDIO, SDC_CFG_SDIOIDE, SDC_DAT1_IRQ_TRIGGER, SDC_FIFO_CFG, SDC_FIFO_CFG_RDVALIDSEL, SDC_FIFO_CFG_WRVALIDSEL, SDC_RX_ENH_EN, SDC_RX_ENHANCE_EN, setbits32, msdc_ctrlr::top_base, and write32().
Referenced by add_msdc().
Definition at line 30 of file msdc.c.
References addr, mask, MSDC_NOT_READY, MSDC_SUCCESS, MSDC_TIMEOUT_US, read32(), stopwatch_expired(), stopwatch_init_usecs_expire(), and udelay().
Referenced by msdc_cmd_is_ready(), msdc_fifo_clr(), and msdc_reset_hw().
|
static |
Definition at line 72 of file msdc.c.
References msdc_ctrlr::base, MSDC_CFG, MSDC_CFG_RST, msdc_error, MSDC_FIFOCS, MSDC_FIFOCS_CLR, MSDC_INT, msdc_poll_timeout(), MSDC_SUCCESS, read32(), setbits32, val, and write32().
Referenced by msdc_cmd_done(), msdc_cmd_is_ready(), msdc_init_hw(), and msdc_start_command().
|
static |
Definition at line 311 of file msdc.c.
References container_of, and msdc_start_command().
Referenced by msdc_update_pointers().
|
static |
Definition at line 358 of file msdc.c.
References msdc_ctrlr::base, MSDC_BUS_1BITS, MSDC_BUS_4BITS, MSDC_BUS_8BITS, msdc_trace, read32(), SDC_CFG, SDC_CFG_BUSWIDTH, val, width, and write32().
Referenced by msdc_set_ios().
|
static |
Definition at line 321 of file msdc.c.
References assert, msdc_ctrlr::base, sd_mmc_ctrlr::bus_hz, clrsetbits_le32, DIV_ROUND_UP, MSDC_CFG, MSDC_CFG_CKSTB, msdc_debug, msdc_error, MSDC_SUCCESS, msdc_wait_done(), NULL, msdc_ctrlr::sd_mmc_ctrlr, and msdc_ctrlr::src_hz.
Referenced by msdc_set_ios().
Definition at line 17 of file msdc.c.
References __ffs(), clrsetbits32, and val.
Referenced by msdc_init_hw().
|
static |
Definition at line 381 of file msdc.c.
References sd_mmc_ctrlr::bus_hz, sd_mmc_ctrlr::bus_width, container_of, msdc_set_buswidth(), msdc_set_clock(), and sd_mmc_ctrlr::request_hz.
Referenced by msdc_update_pointers().
|
static |
Definition at line 276 of file msdc.c.
References msdc_ctrlr::base, mmc_data::blocks, CMD_INTS_MASK, mmc_command::cmdarg, EIO, msdc_cmd_done(), msdc_cmd_is_ready(), msdc_cmd_prepare_raw_cmd(), msdc_error, msdc_fifo_clr(), MSDC_FIFOCS, MSDC_FIFOCS_RXCNT, MSDC_FIFOCS_TXCNT, MSDC_INT, MSDC_INT_CMDTMO, msdc_reset_hw(), MSDC_SUCCESS, msdc_wait_done(), read32(), SDC_ARG, SDC_BLK_NUM, SDC_CMD, and write32().
Referenced by msdc_send_command().
|
static |
Definition at line 395 of file msdc.c.
References sd_mmc_ctrlr::bus_width, sd_mmc_ctrlr::caps, DRVR_CAP_HC, DRVR_CAP_HS, sd_mmc_ctrlr::f_max, sd_mmc_ctrlr::f_min, msdc_send_command(), msdc_set_ios(), msdc_ctrlr::sd_mmc_ctrlr, sd_mmc_ctrlr::send_cmd, sd_mmc_ctrlr::set_ios, and sd_mmc_ctrlr::voltages.
Referenced by add_msdc().
Definition at line 50 of file msdc.c.
References addr, CMD_TIMEOUT_MS, mask, MSDC_NOT_READY, MSDC_SUCCESS, read32(), stopwatch_expired(), stopwatch_init_usecs_expire(), and udelay().
Referenced by msdc_set_clock(), and msdc_start_command().
Definition at line 457 of file msdc.c.
References base, CARD_IN_PROGRESS, storage_media::ctrlr, media, mmc_send_op_cond(), MMC_STATUS_CMD1_IN_PROGRESS, MMC_STATUS_CMD1_READY, MMC_STATUS_NEED_RESET, msdc_controller_init(), msdc_ctrlr::sd_mmc_ctrlr, sd_mmc_go_idle(), SET_BUS_WIDTH, SET_CLOCK, and set_early_mmc_wake_status().
Referenced by mtk_msdc_configure_emmc().
Definition at line 440 of file msdc.c.
References BIOS_DEBUG, BIOS_ERR, cbmem_add(), CBMEM_ID_MMC_STATUS, NULL, and printk.
Referenced by mtk_emmc_early_init().