From 419cf93502320584c834e8980f2477b1514cbeaa Mon Sep 17 00:00:00 2001 From: Shelley Chen Date: Wed, 11 Jan 2023 15:52:20 -0800 Subject: 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/71827 Tested-by: build bot (Jenkins) Reviewed-by: Eric Lai --- src/soc/intel/common/block/scs/early_mmc.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'src/soc/intel/common') diff --git a/src/soc/intel/common/block/scs/early_mmc.c b/src/soc/intel/common/block/scs/early_mmc.c index 4e765339ce..c0ca1374c3 100644 --- a/src/soc/intel/common/block/scs/early_mmc.c +++ b/src/soc/intel/common/block/scs/early_mmc.c @@ -1,7 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include -#include #include #include #include @@ -41,22 +40,6 @@ static void disable_mmc_controller_bar(void) ~(PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY)); } -static void set_early_mmc_wake_status(int32_t status) -{ - int32_t *ms_cbmem; - - ms_cbmem = cbmem_add(CBMEM_ID_MMC_STATUS, sizeof(int)); - - if (ms_cbmem == NULL) { - printk(BIOS_ERR, - "%s: Failed to add early mmc wake status to cbmem!\n", - __func__); - return; - } - - *ms_cbmem = status; -} - int early_mmc_wake_hw(void) { struct storage_media media; @@ -108,7 +91,7 @@ int early_mmc_wake_hw(void) disable_mmc_controller_bar(); - set_early_mmc_wake_status(1); + mmc_set_early_wake_status(1); return 0; out_err: -- cgit v1.2.3