Skip to content

Commit

Permalink
soc: nxp: imx93: m33 early init for GPIO
Browse files Browse the repository at this point in the history
M33 early init for GPIO for secure access configuration,
so that driver can operate pins.

Signed-off-by: Yangbo Lu <[email protected]>
Signed-off-by: Chunlei Xu <[email protected]>
  • Loading branch information
yangbolu1991 authored and kartben committed Jan 15, 2025
1 parent 66dceba commit 314686e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions soc/nxp/imx/imx9/imx93/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ if(CONFIG_SOC_MIMX9352_A55)
elseif(CONFIG_SOC_MIMX9352_M33)
zephyr_include_directories(.)
zephyr_include_directories(m33)
zephyr_sources(m33/soc.c)
set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm/cortex_m/scripts/linker.ld CACHE INTERNAL "")
endif()
1 change: 1 addition & 0 deletions soc/nxp/imx/imx9/imx93/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ config SOC_MIMX9352_M33
select HAS_MCUX
select HAS_MCUX_IOMUXC if PINCTRL
select HAS_MCUX_CACHE
select SOC_EARLY_INIT_HOOK

config MCUX_CORE_SUFFIX
default "_ca55" if SOC_MIMX9352_A55
Expand Down
21 changes: 21 additions & 0 deletions soc/nxp/imx/imx9/imx93/m33/soc.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright 2025 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/init.h>
#include <soc.h>

#ifdef CONFIG_SOC_EARLY_INIT_HOOK
void soc_early_init_hook(void)
{
/* Configure secure access to pin registers */
GPIO1->PCNS = 0x0;
GPIO2->PCNS = 0x0;
GPIO3->PCNS = 0x0;
GPIO4->PCNS = 0x0;
}
#endif

0 comments on commit 314686e

Please sign in to comment.