boards: rt595: Changes to support Power management
1. Add code to setup the PMIC voltages during low power modes 2. Add Zephyr power states that are supported to device tree 3. Add low power pin configration for Flash pins to pinctrl Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
This commit is contained in:
parent
0eb3c15715
commit
84967b00dd
4 changed files with 103 additions and 1 deletions
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include <zephyr/init.h>
|
||||
#include "fsl_power.h"
|
||||
#include <zephyr/pm/policy.h>
|
||||
|
||||
#if CONFIG_REGULATOR
|
||||
#include <zephyr/drivers/regulator.h>
|
||||
|
@ -71,6 +72,9 @@ static int board_config_pmic(const struct device *dev)
|
|||
return ret;
|
||||
}
|
||||
|
||||
/* We can enter deep low power modes */
|
||||
pm_policy_state_lock_put(PM_STATE_SUSPEND_TO_IDLE, PM_ALL_SUBSTATES);
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
@ -88,6 +92,9 @@ static int mimxrt595_evk_init(const struct device *dev)
|
|||
|
||||
POWER_SetPadVolRange(&vrange);
|
||||
|
||||
/* Do not enter deep low power modes until the PMIC modes have been initialized */
|
||||
pm_policy_state_lock_get(PM_STATE_SUSPEND_TO_IDLE, PM_ALL_SUBSTATES);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -100,6 +100,9 @@ already supported, which can also be re-used on this mimxrt595_evk board:
|
|||
+-----------+------------+-------------------------------------+
|
||||
| RTC | on-chip | counter |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| PM | on-chip | power management; uses SoC sleep, |
|
||||
| | | deep sleep and deep-powerdown modes |
|
||||
+-----------+------------+-------------------------------------+
|
||||
|
||||
The default configuration can be found in the defconfig file:
|
||||
|
||||
|
|
|
@ -98,4 +98,45 @@
|
|||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
|
||||
pinmux_flexspi: pinmux_flexspi {
|
||||
group0 {
|
||||
pinmux = <FLEXSPI0_SCLK_PIO1_18>,
|
||||
<FLEXSPI0_SS0_N_PIO1_19>,
|
||||
<FLEXSPI0_DATA0_PIO1_20>,
|
||||
<FLEXSPI0_DATA1_PIO1_21>,
|
||||
<FLEXSPI0_DATA2_PIO1_22>,
|
||||
<FLEXSPI0_DATA3_PIO1_23>,
|
||||
<FLEXSPI0_DATA4_PIO1_24>,
|
||||
<FLEXSPI0_DATA5_PIO1_25>,
|
||||
<FLEXSPI0_DATA6_PIO1_26>,
|
||||
<FLEXSPI0_DATA7_PIO1_27>;
|
||||
input-enable;
|
||||
slew-rate = "normal";
|
||||
drive-strength = "high";
|
||||
};
|
||||
};
|
||||
|
||||
pinmux_flexspi_sleep: pinmux_flexspi_sleep {
|
||||
group0 {
|
||||
pinmux = <FLEXSPI0_SCLK_PIO1_18>,
|
||||
<FLEXSPI0_SS0_N_PIO1_19>;
|
||||
slew-rate = "normal";
|
||||
drive-strength = "high";
|
||||
};
|
||||
group1 {
|
||||
pinmux = <FLEXSPI0_DATA0_PIO1_20>,
|
||||
<FLEXSPI0_DATA1_PIO1_21>,
|
||||
<FLEXSPI0_DATA2_PIO1_22>,
|
||||
<FLEXSPI0_DATA3_PIO1_23>,
|
||||
<FLEXSPI0_DATA4_PIO1_24>,
|
||||
<FLEXSPI0_DATA5_PIO1_25>,
|
||||
<FLEXSPI0_DATA6_PIO1_26>,
|
||||
<FLEXSPI0_DATA7_PIO1_27>;
|
||||
input-enable;
|
||||
slew-rate = "normal";
|
||||
drive-strength = "high";
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -91,6 +91,41 @@
|
|||
<20 0 &gpio4 22 0>, /* D14 */
|
||||
<21 0 &gpio4 21 0>; /* D15 */
|
||||
};
|
||||
|
||||
power-states {
|
||||
/* This is the setting Sleep Mode */
|
||||
idle: idle {
|
||||
compatible = "zephyr,power-state";
|
||||
power-state-name = "runtime-idle";
|
||||
min-residency-us = <0>;
|
||||
exit-latency-us = <0>;
|
||||
};
|
||||
/* This is the setting for Deep-sleep Mode */
|
||||
suspend: suspend {
|
||||
compatible = "nxp,pdcfg-power", "zephyr,power-state";
|
||||
power-state-name = "suspend-to-idle";
|
||||
min-residency-us = <500>;
|
||||
exit-latency-us = <120>;
|
||||
/*
|
||||
* These values are written to the PDSLEEPCFG registers to keep certain
|
||||
* blocks such as LPOSC, SRAM's, FlexSPI0 SRAM powered on during deep
|
||||
* sleep mode.
|
||||
*/
|
||||
deep-sleep-config = <0xC800>,
|
||||
<0x80000004>,
|
||||
<0xFFFFFFFF>,
|
||||
<0>;
|
||||
};
|
||||
/*
|
||||
* Deep power-down mode is supported in this SoC through 'PM_STATE_SOFT_OFF' state.
|
||||
* There is no entry for this in device tree, user can call pm_state_force to enter
|
||||
* this state.
|
||||
*/
|
||||
};
|
||||
};
|
||||
|
||||
&cpu0 {
|
||||
cpu-power-states = <&idle &suspend>;
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -164,23 +199,35 @@ arduino_serial: &flexcomm12 {
|
|||
|
||||
pca9420_sw1: BUCK1 {
|
||||
regulator-boot-on;
|
||||
nxp,mode0-microvolt = <1100000>;
|
||||
nxp,mode1-microvolt = <600000>;
|
||||
nxp,mode2-microvolt = <0>;
|
||||
};
|
||||
|
||||
pca9420_sw2: BUCK2 {
|
||||
regulator-boot-on;
|
||||
nxp,mode0-microvolt = <1800000>;
|
||||
nxp,mode1-microvolt = <1800000>;
|
||||
nxp,mode2-microvolt = <1800000>;
|
||||
|
||||
};
|
||||
|
||||
pca9420_ldo1: LDO1 {
|
||||
regulator-boot-on;
|
||||
nxp,mode0-microvolt = <1800000>;
|
||||
nxp,mode1-microvolt = <1800000>;
|
||||
nxp,mode2-microvolt = <1800000>;
|
||||
};
|
||||
|
||||
pca9420_ldo2: LDO2 {
|
||||
regulator-boot-on;
|
||||
nxp,mode0-microvolt = <3300000>;
|
||||
nxp,mode1-microvolt = <3300000>;
|
||||
nxp,mode2-microvolt = <3300000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
&gpio0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
@ -272,6 +319,10 @@ zephyr_udc0: &usbhs {
|
|||
|
||||
&flexspi {
|
||||
status = "okay";
|
||||
pinctrl-0 = <&pinmux_flexspi>;
|
||||
pinctrl-1 = <&pinmux_flexspi_sleep>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
|
||||
mx25um51345g: mx25um51345g@0 {
|
||||
compatible = "nxp,imx-flexspi-mx25um51345g";
|
||||
/* MX25UM51245G is 64MB, 512MBit flash part */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue