Yidi Lin has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/46685 )
Change subject: asurada: mainboard: Set pinctrl for msdc0/1 ......................................................................
asurada: mainboard: Set pinctrl for msdc0/1
Set pinctrl for msdc0/1
Signed-off-by: Wenbin Mei wenbin.mei@mediatek.com Change-Id: Ie6bdffb987d5acf286645550f1c53f294f71c38a --- M src/mainboard/google/asurada/mainboard.c 1 file changed, 62 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/85/46685/1
diff --git a/src/mainboard/google/asurada/mainboard.c b/src/mainboard/google/asurada/mainboard.c index 9146d7b..399bb67 100644 --- a/src/mainboard/google/asurada/mainboard.c +++ b/src/mainboard/google/asurada/mainboard.c @@ -2,10 +2,72 @@
#include <console/console.h> #include <device/device.h> +#include <device/mmio.h> +#include <soc/gpio.h> #include <soc/usb.h>
+#define MSDC0_DRV_MASK 0x3fffffff +#define MSDC1_DRV_MASK 0x3ffff000 +#define MSDC0_DRV_VALUE 0x24924924 +#define MSDC1_DRV_VALUE 0x24924000 + +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); +} + +static void configure_sdcard(void) +{ + void *gpio_base = (void *)IOCFG_RM_BASE; + 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 10mA */ + clrsetbits32(gpio_base, MSDC1_DRV_MASK, MSDC1_DRV_VALUE); +} + + static void mainboard_init(struct device *dev) { + configure_emmc(); + configure_sdcard(); setup_usb_host(); }
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46685 )
Change subject: asurada: mainboard: Set pinctrl for msdc0/1 ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/46685/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/46685/1//COMMIT_MSG@7 PS1, Line 7: asurada: mainboard: Set pinctrl for msdc0/1 mb/google/asurada: Configure pinctrl for SD and MMC
The pins for SD and MMC must be configured properly so we can access them in payloads.
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46685 )
Change subject: asurada: mainboard: Set pinctrl for msdc0/1 ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/46685/1/src/mainboard/google/asurad... File src/mainboard/google/asurada/mainboard.c:
https://review.coreboot.org/c/coreboot/+/46685/1/src/mainboard/google/asurad... PS1, Line 66: only one blank line between functions.
Hello Hung-Te Lin, build bot (Jenkins), Yu-Ping Wu,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/46685
to look at the new patch set (#2).
Change subject: mb/google/asurada: Configure pinctrl for SD and MMC ......................................................................
mb/google/asurada: Configure pinctrl for SD and MMC
The pins for SD and MMC must be configured properly so we can access them in payloads.
Signed-off-by: Wenbin Mei wenbin.mei@mediatek.com Change-Id: Ie6bdffb987d5acf286645550f1c53f294f71c38a --- M src/mainboard/google/asurada/mainboard.c 1 file changed, 61 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/85/46685/2
Yidi Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46685 )
Change subject: mb/google/asurada: Configure pinctrl for SD and MMC ......................................................................
Patch Set 2:
(2 comments)
https://review.coreboot.org/c/coreboot/+/46685/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/46685/1//COMMIT_MSG@7 PS1, Line 7: asurada: mainboard: Set pinctrl for msdc0/1
mb/google/asurada: Configure pinctrl for SD and MMC […]
Ack
https://review.coreboot.org/c/coreboot/+/46685/1/src/mainboard/google/asurad... File src/mainboard/google/asurada/mainboard.c:
https://review.coreboot.org/c/coreboot/+/46685/1/src/mainboard/google/asurad... PS1, Line 66:
only one blank line between functions.
Ack
Yu-Ping Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46685 )
Change subject: mb/google/asurada: Configure pinctrl for SD and MMC ......................................................................
Patch Set 2: Code-Review+2
Hung-Te Lin has submitted this change. ( https://review.coreboot.org/c/coreboot/+/46685 )
Change subject: mb/google/asurada: Configure pinctrl for SD and MMC ......................................................................
mb/google/asurada: Configure pinctrl for SD and MMC
The pins for SD and MMC must be configured properly so we can access them in payloads.
Signed-off-by: Wenbin Mei wenbin.mei@mediatek.com Change-Id: Ie6bdffb987d5acf286645550f1c53f294f71c38a Reviewed-on: https://review.coreboot.org/c/coreboot/+/46685 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Yu-Ping Wu yupingso@google.com --- M src/mainboard/google/asurada/mainboard.c 1 file changed, 61 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Yu-Ping Wu: Looks good to me, approved
diff --git a/src/mainboard/google/asurada/mainboard.c b/src/mainboard/google/asurada/mainboard.c index 9146d7b..7a37df5 100644 --- a/src/mainboard/google/asurada/mainboard.c +++ b/src/mainboard/google/asurada/mainboard.c @@ -2,10 +2,71 @@
#include <console/console.h> #include <device/device.h> +#include <device/mmio.h> +#include <soc/gpio.h> #include <soc/usb.h>
+#define MSDC0_DRV_MASK 0x3fffffff +#define MSDC1_DRV_MASK 0x3ffff000 +#define MSDC0_DRV_VALUE 0x24924924 +#define MSDC1_DRV_VALUE 0x24924000 + +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); +} + +static void configure_sdcard(void) +{ + void *gpio_base = (void *)IOCFG_RM_BASE; + 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 10mA */ + clrsetbits32(gpio_base, MSDC1_DRV_MASK, MSDC1_DRV_VALUE); +} + static void mainboard_init(struct device *dev) { + configure_emmc(); + configure_sdcard(); setup_usb_host(); }