3 #ifndef __COMMONLIB_STORAGE_SD_MMC_H__
4 #define __COMMONLIB_STORAGE_SD_MMC_H__
11 #define SD_MMC_IO_RETRIES 1000
13 #define IS_SD(x) (x->version & SD_VERSION_SD)
15 #define SET_BUS_WIDTH(ctrlr, width) \
17 ctrlr->bus_width = width; \
18 ctrlr->set_ios(ctrlr); \
21 #define SET_CLOCK(ctrlr, clock_hz) \
23 ctrlr->request_hz = clock_hz; \
24 ctrlr->set_ios(ctrlr); \
27 #define SET_TIMING(ctrlr, timing_value) \
29 ctrlr->timing = timing_value; \
30 ctrlr->set_ios(ctrlr); \
45 unsigned int partition_number);
50 unsigned int partition_number);
56 unsigned int partition_number);
61 unsigned int partition_number);
64 #define sdhc_debug(format...) \
66 if (CONFIG(SDHC_DEBUG)) \
67 printk(BIOS_DEBUG, format); \
69 #define sdhc_trace(format...) \
71 if (CONFIG(SDHC_TRACE)) \
72 printk(BIOS_DEBUG, format); \
74 #define sdhc_error(format...) printk(BIOS_ERR, format)
77 #define sd_mmc_debug(format...) \
79 if (CONFIG(SD_MMC_DEBUG)) \
80 printk(BIOS_DEBUG, format); \
82 #define sd_mmc_trace(format...) \
84 if (CONFIG(SD_MMC_TRACE)) \
85 printk(BIOS_DEBUG, format); \
87 #define sd_mmc_error(format...) printk(BIOS_ERR, format)
uint64_t sd_mmc_extract_uint32_bits(const uint32_t *array, int start, int count)
int sd_set_bus_width(struct storage_media *media)
int sd_mmc_go_idle(struct storage_media *media)
int mmc_set_partition(struct storage_media *media, unsigned int partition_number)
int sd_mmc_send_status(struct storage_media *media, ssize_t tries)
int mmc_update_capacity(struct storage_media *media)
int mmc_change_freq(struct storage_media *media)
int mmc_set_bus_width(struct storage_media *media)
const char * mmc_partition_name(struct storage_media *media, unsigned int partition_number)
const char * sd_partition_name(struct storage_media *media, unsigned int partition_number)
int sd_mmc_enter_standby(struct storage_media *media)
int sd_mmc_set_blocklen(struct sd_mmc_ctrlr *ctrlr, int len)
int sd_change_freq(struct storage_media *media)
int mmc_complete_op_cond(struct storage_media *media)
int sd_send_if_cond(struct storage_media *media)
int sd_set_partition(struct storage_media *media, unsigned int partition_number)
int sd_send_op_cond(struct storage_media *media)
int mmc_send_ext_csd(struct sd_mmc_ctrlr *ctrlr, unsigned char *ext_csd)
int mmc_send_op_cond(struct storage_media *media)
unsigned long long uint64_t