soc/mediatek/mt8189: Add SD card support
Add GPIO configuration of SD card. BUG=b:379008996 BRANCH=none TEST=build pass Signed-off-by: Mengqi Zhang <mengqi.zhang@mediatek.corp-partner.google.com> Change-Id: If34841dddeb93a8622dda8e011cd1f29ec9c541d Reviewed-on: https://review.coreboot.org/c/coreboot/+/87863 Reviewed-by: Yidi Lin <yidilin@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com>
This commit is contained in:
parent
ae435c014c
commit
f325409784
1 changed files with 28 additions and 0 deletions
|
|
@ -9,6 +9,7 @@
|
|||
#include <gpio.h>
|
||||
#include <soc/addressmap.h>
|
||||
#include <soc/msdc.h>
|
||||
#include <soc/mt6359p.h>
|
||||
#include <soc/regulator.h>
|
||||
|
||||
static const struct pad_func emmc_pins[] = {
|
||||
|
|
@ -25,6 +26,15 @@ static const struct pad_func emmc_pins[] = {
|
|||
PAD_FUNC_UP(EMMC_DAT7, MSDC0_DAT7),
|
||||
};
|
||||
|
||||
static const struct pad_func sdcard_pins[] = {
|
||||
PAD_FUNC_DOWN(MSDC1_CLK, MSDC1_CLK),
|
||||
PAD_FUNC_UP(MSDC1_CMD, MSDC1_CMD),
|
||||
PAD_FUNC_UP(MSDC1_DAT0, MSDC1_DAT0),
|
||||
PAD_FUNC_UP(MSDC1_DAT1, MSDC1_DAT1),
|
||||
PAD_FUNC_UP(MSDC1_DAT2, MSDC1_DAT2),
|
||||
PAD_FUNC_UP(MSDC1_DAT3, MSDC1_DAT3),
|
||||
};
|
||||
|
||||
void mtk_msdc_configure_emmc(bool is_early_init)
|
||||
{
|
||||
size_t i;
|
||||
|
|
@ -38,3 +48,21 @@ void mtk_msdc_configure_emmc(bool is_early_init)
|
|||
if (is_early_init)
|
||||
mtk_emmc_early_init((void *)MSDC0_BASE, (void *)MSDC0_TOP_BASE);
|
||||
}
|
||||
|
||||
void mtk_msdc_configure_sdcard(void)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(sdcard_pins); i++) {
|
||||
gpio_set_mode(sdcard_pins[i].gpio, sdcard_pins[i].func);
|
||||
gpio_set_pull(sdcard_pins[i].gpio, GPIO_PULL_ENABLE, sdcard_pins[i].select);
|
||||
gpio_set_driving(sdcard_pins[i].gpio, GPIO_DRV_8_MA);
|
||||
}
|
||||
|
||||
mt6359p_init_pmif_arb();
|
||||
/* enable SD card power */
|
||||
mainboard_set_regulator_voltage(MTK_REGULATOR_VMCH, 3000000);
|
||||
mainboard_set_regulator_voltage(MTK_REGULATOR_VMC, 3000000);
|
||||
mainboard_enable_regulator(MTK_REGULATOR_VMCH, true);
|
||||
mainboard_enable_regulator(MTK_REGULATOR_VMC, true);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue