From 79ba30af3f43cdbb4e7d8bd6f19579a4e1be05f4 Mon Sep 17 00:00:00 2001
From: Alan <Alan>
Date: Fri, 19 May 2023 17:11:36 +0800
Subject: [PATCH 07/11] Fix: PC3 eMMC sel pin set to pull down mode for boot
 from eMMC

---
 board/sunxi/board.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index c264790075..28f74ca363 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -484,6 +484,10 @@ static void mmc_pinmux_setup(int sdc)
 			sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP);
 			sunxi_gpio_set_drv(pin, 3);
 		}
+		/* PC3 eMMC sel pin set to pull down mode for boot from eMMC */
+		sunxi_gpio_set_cfgpin(SUNXI_GPC(3), SUNXI_GPIO_INPUT);
+		sunxi_gpio_set_pull(SUNXI_GPC(3), SUNXI_GPIO_PULL_DOWN);
+		sunxi_gpio_set_drv(SUNXI_GPC(3), 3);
 #elif defined(CONFIG_MACH_SUN9I)
 		/* SDC2: PC6-PC16 */
 		for (pin = SUNXI_GPC(6); pin <= SUNXI_GPC(16); pin++) {
-- 
2.34.1

