Attention is currently required from: Hung-Te Lin, Jarried Lin.
Yidi Lin has posted comments on this change by Jarried Lin. ( https://review.coreboot.org/c/coreboot/+/85564?usp=email )
The change is no longer submittable: All-Comments-Resolved is unsatisfied now.
Change subject: soc/mediatek/mt8196: Add SD card configurations ......................................................................
Patch Set 2:
(1 comment)
File src/soc/mediatek/mt8196/msdc.c:
https://review.coreboot.org/c/coreboot/+/85564/comment/f4ae3fec_0ea20bf9?usp... : PS2, Line 35: void *gpio_base = (void *)IOCFG_BM3_BASE; : void *gpio_mode0_base = (void *)MSDC1_GPIO_MODE0_BASE; : void *gpio_mode1_base = (void *)MSDC1_GPIO_MODE1_BASE; : unsigned 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 SD card cmd/dat/clk pins driving to 6mA */ : SET32_BITFIELDS(gpio_base + MSDC1_DRV_OFFSET_0, MSDC1_DRV, MSDC1_DRV_VALUE_0); : : /* set SD card dat0/cmd/clk pins to msdc1 mode */ : SET32_BITFIELDS(gpio_mode0_base, : MSDC1_GPIO_MODE0_0, MSDC1_GPIO_MODE0_VALUE, : MSDC1_GPIO_MODE0_1, MSDC1_GPIO_MODE0_VALUE, : MSDC1_GPIO_MODE0_2, MSDC1_GPIO_MODE0_VALUE); : : /* set SD card dat3/dat2/dat1 pin to msdc1 mode */ : SET32_BITFIELDS(gpio_mode1_base, : MSDC1_GPIO_MODE1_0, MSDC1_GPIO_MODE1_VALUE, : MSDC1_GPIO_MODE1_1, MSDC1_GPIO_MODE1_VALUE, : MSDC1_GPIO_MODE1_2, MSDC1_GPIO_MODE1_VALUE); I think those register configurations are identical to following GPIO operations.
``` const struct pad_func sdcard_pin [] = { PAD_FUNC_DOWN(MSDC1_CLK, MSDC1_CLK), PAD_FUNC_UP(MSDC1_CMD, MSDC1_CMD), ... };
for (i = 0; i < ARRAY_SIZE(sdcard_pin); i++) { gpio_set_mode(sdcard_pin[i].gpio, sdcard_pin[i].func); gpio_set_pull(sdcard_pin[i].gpio, GPIO_PULL_ENABLE, sdcard_pin[i].select); gpio_set_driving(sdcard_pin[i].gpio, GPIO_DRV_6_MA); } ```