[PATCH 21/21] imx93_evk: Enable M.2 VPCIe_3V3 and deassert SD3_nRST

Peng Fan (OSS) peng.fan at oss.nxp.com
Tue Sep 17 05:34:13 CEST 2024


From: Ye Li <ye.li at nxp.com>

VPCIe_3V3 is used to supply the power to M.2 card, we must enable it
before using the flash.
The SD3_nRST is connected to reset pin of flash, must deassert
(pull up) it.

Reviewed-by: Peng Fan <peng.fan at nxp.com>
Signed-off-by: Ye Li <ye.li at nxp.com>
Signed-off-by: Peng Fan <peng.fan at nxp.com>
---
 board/freescale/imx93_evk/imx93_evk.c | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/board/freescale/imx93_evk/imx93_evk.c b/board/freescale/imx93_evk/imx93_evk.c
index 341831a7d30..08da1563f03 100644
--- a/board/freescale/imx93_evk/imx93_evk.c
+++ b/board/freescale/imx93_evk/imx93_evk.c
@@ -17,6 +17,7 @@
 #include <dm/uclass.h>
 #include <usb.h>
 #include <dwc3-uboot.h>
+#include <asm/gpio.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -48,11 +49,43 @@ int board_phy_config(struct phy_device *phydev)
 	return 0;
 }
 
+static void board_gpio_init(void)
+{
+	struct gpio_desc desc;
+	int ret;
+
+	/* Enable EXT1_PWREN for PCIE_3.3V */
+	ret = dm_gpio_lookup_name("gpio at 22_13", &desc);
+	if (ret)
+		return;
+
+	ret = dm_gpio_request(&desc, "EXT1_PWREN");
+	if (ret)
+		return;
+
+	dm_gpio_set_dir_flags(&desc, GPIOD_IS_OUT);
+	dm_gpio_set_value(&desc, 1);
+
+	/* Deassert SD3_nRST */
+	ret = dm_gpio_lookup_name("gpio at 22_12", &desc);
+	if (ret)
+		return;
+
+	ret = dm_gpio_request(&desc, "SD3_nRST");
+	if (ret)
+		return;
+
+	dm_gpio_set_dir_flags(&desc, GPIOD_IS_OUT);
+	dm_gpio_set_value(&desc, 1);
+}
+
 int board_init(void)
 {
 	if (IS_ENABLED(CONFIG_FEC_MXC))
 		setup_fec();
 
+	board_gpio_init();
+
 	return 0;
 }
 

-- 
2.35.3



More information about the U-Boot mailing list