From a37bd8e7ba34aeedce082fd32a5def98b9679a04 Mon Sep 17 00:00:00 2001 From: Declan Snyder Date: Mon, 29 Jan 2024 09:33:14 -0600 Subject: [PATCH] soc: rt5xx: Restore ISP pins state in soc init ROM configures the ISP boot pins as gpio to determine what boot mode to be in. But some ROM revisions have a bug where they do not restore the reset state of these pins before booting application. This can cause power leakage on these pins and is not an intended configuration from Zephyr user/board point of view, so restore the reset state as part of early SOC init (disable the pins). Configuration of pins should be left up to app/board devicetree. Signed-off-by: Declan Snyder --- soc/arm/nxp_imx/rt5xx/soc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/soc/arm/nxp_imx/rt5xx/soc.c b/soc/arm/nxp_imx/rt5xx/soc.c index 9be4c6c151d..ca2a89cd553 100644 --- a/soc/arm/nxp_imx/rt5xx/soc.c +++ b/soc/arm/nxp_imx/rt5xx/soc.c @@ -530,6 +530,14 @@ static int nxp_rt500_init(void) CACHE64_DisableCache(CACHE64_CTRL0); #endif + /* Some ROM versions may have errata leaving these pins in a non-reset state, + * which can often cause power leakage on most expected board designs, + * restore the reset state here and leave the pin configuration up to board/user DT + */ + IOPCTL->PIO[1][15] = 0; + IOPCTL->PIO[3][28] = 0; + IOPCTL->PIO[3][29] = 0; + return 0; }