summaryrefslogtreecommitdiff
path: root/src/mainboard
diff options
context:
space:
mode:
authorWenbin Mei <wenbin.mei@mediatek.com>2021-08-04 10:53:27 +0800
committerHung-Te Lin <hungte@chromium.org>2021-08-09 01:52:53 +0000
commitca33b74acf17574011b42edab8dc7c441f9cddf2 (patch)
tree60b543b06328cf21f892b8dba74770ff2c3d4dfe /src/mainboard
parentda0acc61951d4cee7806cd22885698576d31d415 (diff)
mb/google/cherry: early-init eMMC
Some eMMCs need 80+ms for CMD1 to complete. And the payload may need to access eMMC in the very early stage (for example, Depthcharge needs it 20ms after started) so we have to start initialization in coreboot. BUG=b:195274787 TEST=emerge-cherry coreboot BRANCH=cherry Signed-off-by: Wenbin Mei <wenbin.mei@mediatek.com> Change-Id: Idc86f9121fa4a34f09a683f7a81087c13ea3dd42 Reviewed-on: https://review.coreboot.org/c/coreboot/+/56842 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Rex-BC Chen <rex-bc.chen@mediatek.corp-partner.google.com> Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Diffstat (limited to 'src/mainboard')
-rw-r--r--src/mainboard/google/cherry/mainboard.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mainboard/google/cherry/mainboard.c b/src/mainboard/google/cherry/mainboard.c
index 6b29f4417b..bb6dbac8ab 100644
--- a/src/mainboard/google/cherry/mainboard.c
+++ b/src/mainboard/google/cherry/mainboard.c
@@ -14,6 +14,7 @@
#include <soc/dptx.h>
#include <soc/gpio.h>
#include <soc/i2c.h>
+#include <soc/msdc.h>
#include <soc/mt6360.h>
#include <soc/mtcmos.h>
#include <soc/regulator.h>
@@ -39,6 +40,9 @@ DEFINE_BITFIELD(MSDC1_GPIO_MODE1_1, 6, 4)
DEFINE_BITFIELD(MSDC1_GPIO_MODE1_2, 10, 8)
DEFINE_BITFIELD(MSDC1_GPIO_MODE1_3, 14, 12)
+#define MSDC0_BASE 0x11230000
+#define MSDC0_TOP_BASE 0x11f50000
+
#define MSDC0_DRV_VALUE 0x1b6db6db
#define MSDC1_DRV_VALUE 0x1b6db
#define MSDC1_GPIO_MODE0_VALUE 0x1
@@ -85,6 +89,8 @@ static void configure_emmc(void)
/* set eMMC cmd/dat/clk/ds/rstb pins driving to 8mA */
SET32_BITFIELDS(gpio_base, MSDC0_DRV, MSDC0_DRV_VALUE);
+
+ mtk_emmc_early_init((void *)MSDC0_BASE, (void *)MSDC0_TOP_BASE);
}
static void configure_sdcard(void)