boards: nxp: frdm_mcxn947: enable GPIO in all modes
For CPU1 access, enable GPIO access in non-secure and non-privilege modes. Signed-off-by: Derek Snell <derek.snell@nxp.com>
This commit is contained in:
parent
e4a9467b25
commit
d75fe02adf
1 changed files with 19 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2024 NXP
|
* Copyright 2024-2025 NXP
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
#include <zephyr/init.h>
|
#include <zephyr/init.h>
|
||||||
|
@ -84,6 +84,19 @@ __ramfunc static void enable_cache64(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static void unsecure_gpio(GPIO_Type * base)
|
||||||
|
{
|
||||||
|
/* Enables CPU1 to access GPIO registers
|
||||||
|
* Pins and interrupts can be configured in non-secure access
|
||||||
|
*/
|
||||||
|
base->PCNS = 0xFFFFFFFFU;
|
||||||
|
base->ICNS = GPIO_ICNS_NSE1_MASK | GPIO_ICNS_NSE0_MASK;
|
||||||
|
|
||||||
|
/* Pins and interrupts can be configured in non-privilege access */
|
||||||
|
base->PCNP = 0xFFFFFFFFU;
|
||||||
|
base->ICNP = GPIO_ICNP_NPE1_MASK | GPIO_ICNP_NPE0_MASK;
|
||||||
|
}
|
||||||
|
|
||||||
void board_early_init_hook(void)
|
void board_early_init_hook(void)
|
||||||
{
|
{
|
||||||
power_mode_od();
|
power_mode_od();
|
||||||
|
@ -183,22 +196,27 @@ void board_early_init_hook(void)
|
||||||
|
|
||||||
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(gpio0))
|
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(gpio0))
|
||||||
CLOCK_EnableClock(kCLOCK_Gpio0);
|
CLOCK_EnableClock(kCLOCK_Gpio0);
|
||||||
|
unsecure_gpio(GPIO0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(gpio1))
|
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(gpio1))
|
||||||
CLOCK_EnableClock(kCLOCK_Gpio1);
|
CLOCK_EnableClock(kCLOCK_Gpio1);
|
||||||
|
unsecure_gpio(GPIO1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(gpio2))
|
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(gpio2))
|
||||||
CLOCK_EnableClock(kCLOCK_Gpio2);
|
CLOCK_EnableClock(kCLOCK_Gpio2);
|
||||||
|
unsecure_gpio(GPIO2);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(gpio3))
|
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(gpio3))
|
||||||
CLOCK_EnableClock(kCLOCK_Gpio3);
|
CLOCK_EnableClock(kCLOCK_Gpio3);
|
||||||
|
unsecure_gpio(GPIO3);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(gpio4))
|
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(gpio4))
|
||||||
CLOCK_EnableClock(kCLOCK_Gpio4);
|
CLOCK_EnableClock(kCLOCK_Gpio4);
|
||||||
|
unsecure_gpio(GPIO4);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(dac0))
|
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(dac0))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue