soc: nxp: lpc55s69: Enable Sleep Mode
Enable sleep mode on LPC55S69 (corresponding to zephyr's runtime idle mode). Add DT description and power api implementations. Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
This commit is contained in:
parent
2d83371818
commit
a7988f2986
4 changed files with 43 additions and 0 deletions
|
@ -31,6 +31,7 @@
|
|||
reg = <0>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
cpu-power-states = <&sleep>;
|
||||
|
||||
mpu: mpu@e000ed90 {
|
||||
compatible = "arm,armv8m-mpu";
|
||||
|
@ -41,6 +42,15 @@
|
|||
compatible = "arm,cortex-m33";
|
||||
reg = <1>;
|
||||
};
|
||||
|
||||
power-states {
|
||||
sleep: sleep {
|
||||
compatible = "zephyr,power-state";
|
||||
power-state-name = "runtime-idle";
|
||||
min-residency-us = <4>;
|
||||
exit-latency-us = <4>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -24,6 +24,10 @@ if(NOT DEFINED CONFIG_LPC55XXX_SRAM_CLOCKS)
|
|||
zephyr_compile_definitions(DONT_ENABLE_DISABLED_RAMBANKS=1)
|
||||
endif()
|
||||
|
||||
if (CONFIG_SOC_LPC55S69_CPU0)
|
||||
zephyr_sources_ifdef(CONFIG_PM power.c)
|
||||
endif()
|
||||
|
||||
zephyr_include_directories(.)
|
||||
|
||||
set(SOC_LINKER_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/linker.ld CACHE INTERNAL "")
|
||||
|
|
|
@ -68,6 +68,7 @@ config SOC_LPC55S69_CPU0
|
|||
select HAS_MCUX_CTIMER
|
||||
select HAS_MCUX_SCTIMER
|
||||
select HAS_MCUX_RNG
|
||||
select HAS_PM
|
||||
|
||||
if SOC_SERIES_LPC55XXX
|
||||
|
||||
|
|
28
soc/nxp/lpc/lpc55xxx/power.c
Normal file
28
soc/nxp/lpc/lpc55xxx/power.c
Normal file
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
* Copyright 2024 NXP
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/pm/pm.h>
|
||||
|
||||
void pm_state_set(enum pm_state state, uint8_t id)
|
||||
{
|
||||
ARG_UNUSED(id);
|
||||
|
||||
switch (state) {
|
||||
case PM_STATE_RUNTIME_IDLE:
|
||||
k_cpu_idle();
|
||||
break;
|
||||
default:
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void pm_state_exit_post_ops(enum pm_state state, uint8_t id)
|
||||
{
|
||||
ARG_UNUSED(state);
|
||||
ARG_UNUSED(id);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue