diff options
author | Rex-BC Chen <rex-bc.chen@mediatek.corp-partner.google.com> | 2021-11-12 18:28:18 +0800 |
---|---|---|
committer | Hung-Te Lin <hungte@chromium.org> | 2021-11-17 10:30:27 +0000 |
commit | 15486f44a226b4b75a535b6a0cf5b798e39a4f07 (patch) | |
tree | 89fb9d6f2c76f9993a28a820bce2100480255d1d /src/mainboard/google/asurada | |
parent | e3964c75d76a225dbf6deb1f3a8ed13e0b17d8a5 (diff) |
soc/mediatek: move MSDC drivers to soc folder
Setting of MSDC is defined by soc, so we move them to soc folder.
TEST=emerge-cherry coreboot; emerge-asurada coreboot
Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: I84ad8a4cde120c97024870ebf750d44b36c2284d
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59339
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Diffstat (limited to 'src/mainboard/google/asurada')
-rw-r--r-- | src/mainboard/google/asurada/mainboard.c | 70 |
1 files changed, 2 insertions, 68 deletions
diff --git a/src/mainboard/google/asurada/mainboard.c b/src/mainboard/google/asurada/mainboard.c index 7704899f16..bbca4b83ba 100644 --- a/src/mainboard/google/asurada/mainboard.c +++ b/src/mainboard/google/asurada/mainboard.c @@ -142,72 +142,6 @@ static bool configure_display(void) return true; } -static void configure_emmc(void) -{ - void *gpio_base = (void *)IOCFG_TL_BASE; - int i; - - const gpio_t emmc_pu_pin[] = { - GPIO(MSDC0_DAT0), GPIO(MSDC0_DAT1), - GPIO(MSDC0_DAT2), GPIO(MSDC0_DAT3), - GPIO(MSDC0_DAT4), GPIO(MSDC0_DAT5), - GPIO(MSDC0_DAT6), GPIO(MSDC0_DAT7), - GPIO(MSDC0_CMD), GPIO(MSDC0_RSTB), - }; - - const gpio_t emmc_pd_pin[] = { - GPIO(MSDC0_DSL), GPIO(MSDC0_CLK), - }; - - for (i = 0; i < ARRAY_SIZE(emmc_pu_pin); i++) - gpio_set_pull(emmc_pu_pin[i], GPIO_PULL_ENABLE, GPIO_PULL_UP); - - for (i = 0; i < ARRAY_SIZE(emmc_pd_pin); i++) - gpio_set_pull(emmc_pd_pin[i], GPIO_PULL_ENABLE, GPIO_PULL_DOWN); - - /* set eMMC cmd/dat/clk/ds/rstb pins driving to 10mA */ - clrsetbits32(gpio_base, MSDC0_DRV_MASK, MSDC0_DRV_VALUE); - - mtk_emmc_early_init((void *)MSDC0_BASE, (void *)MSDC0_TOP_BASE); -} - -static void configure_sdcard(void) -{ - void *gpio_base = (void *)IOCFG_RM_BASE; - void *gpio_mode0_base = (void *)MSDC1_GPIO_MODE0_BASE; - void *gpio_mode1_base = (void *)MSDC1_GPIO_MODE1_BASE; - uint8_t enable = 1; - int i; - - const gpio_t sdcard_pu_pin[] = { - GPIO(MSDC1_DAT0), GPIO(MSDC1_DAT1), - GPIO(MSDC1_DAT2), GPIO(MSDC1_DAT3), - GPIO(MSDC1_CMD), - }; - - const gpio_t sdcard_pd_pin[] = { - GPIO(MSDC1_CLK), - }; - - for (i = 0; i < ARRAY_SIZE(sdcard_pu_pin); i++) - gpio_set_pull(sdcard_pu_pin[i], GPIO_PULL_ENABLE, GPIO_PULL_UP); - - for (i = 0; i < ARRAY_SIZE(sdcard_pd_pin); i++) - gpio_set_pull(sdcard_pd_pin[i], GPIO_PULL_ENABLE, GPIO_PULL_DOWN); - - /* set sdcard cmd/dat/clk pins driving to 8mA */ - clrsetbits32(gpio_base, MSDC1_DRV_MASK, MSDC1_DRV_VALUE); - - /* set sdcard dat2/dat0/dat3/cmd/clk pins to msdc1 mode */ - clrsetbits32(gpio_mode0_base, MSDC1_GPIO_MODE0_MASK, MSDC1_GPIO_MODE0_VALUE); - - /* set sdcard dat1 pin to msdc1 mode */ - clrsetbits32(gpio_mode1_base, MSDC1_GPIO_MODE1_MASK, MSDC1_GPIO_MODE1_VALUE); - - mainboard_enable_regulator(MTK_REGULATOR_VCC, enable); - mainboard_enable_regulator(MTK_REGULATOR_VCCQ, enable); -} - static void configure_audio(void) { /* Audio PWR */ @@ -222,8 +156,8 @@ static void configure_audio(void) static void mainboard_init(struct device *dev) { - configure_emmc(); - configure_sdcard(); + mtk_msdc_configure_emmc(true); + mtk_msdc_configure_sdcard(); configure_audio(); setup_usb_host(); |