commonlib/storage: Add common eMMC functions

Now that multiple platforms are trying to initialize eMMC in coreboot
instead of depthcharge, lets move common functionality into commonlib
instead of copying the same functionality between multiple platforms.
Note for consistency, changed name of set_early_mmc_wake_status() to
mmc_set_early_wake_status().  Also adding an mmc_send_cmd1() function
for retrieving the Operating Conditions Register (OCR) contents.

BUG=b:218406702
BRANCH=None
TEST=emerge-herobrine coreboot chromeos-bootimage
     flash onto villager device and make sure still boots ChromeOS

Change-Id: Id00535b05bbd379081712601ef10e762c1831747
Signed-off-by: Shelley Chen <shchen@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/71827
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
This commit is contained in:
Shelley Chen
2023-01-11 15:52:20 -08:00
committed by Eric Lai
parent 8ef2f7c77c
commit 419cf93502
4 changed files with 49 additions and 58 deletions

View File

@ -49,6 +49,8 @@ int mmc_set_bus_width(struct storage_media *media);
int mmc_set_partition(struct storage_media *media,
unsigned int partition_number);
int mmc_update_capacity(struct storage_media *media);
void mmc_set_early_wake_status(int32_t status);
int mmc_send_cmd1(struct storage_media *media);
/* SD card support routines */
int sd_change_freq(struct storage_media *media);