soc: arm: nxp: switch imxrt boards to use systick timer unless CONFIG_PM=y

Switch all imxrt boards to use the systick timer by default, and only
enable the GPT timer when using low power modes. This is desirable
because the systick has a higher resolution, but the GPT can run
while the core clock is gated, making it useful for low power modes.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
This commit is contained in:
Daniel DeGrasse 2022-12-13 14:53:11 -06:00 committed by Carles Cufí
parent c1cc2c4a26
commit 4be1fb81ce
15 changed files with 88 additions and 22 deletions

View file

@ -104,9 +104,14 @@ zephyr_udc0: &usb1 {
status = "okay";
};
/* Enable GPT for use as a hardware timer. This disables Cortex Systick.
* to use systick, change this node from "gpt_hw_timer" to "systick"
/* GPT and Systick are enabled. If power management is enabled, the GPT
* timer will be used instead of systick, as allows the core clock to
* be gated.
*/
&gpt_hw_timer {
status = "okay";
};
&systick {
status = "okay";
};

View file

@ -131,9 +131,14 @@ zephyr_udc0: &usb1 {
pinctrl-names = "default";
};
/* Enable GPT for use as a hardware timer. This disables Cortex Systick.
* to use systick, change this node from "gpt_hw_timer" to "systick"
/* GPT and Systick are enabled. If power management is enabled, the GPT
* timer will be used instead of systick, as allows the core clock to
* be gated.
*/
&gpt_hw_timer {
status = "okay";
};
&systick {
status = "okay";
};

View file

@ -207,9 +207,14 @@ zephyr_udc0: &usb1 {
status = "okay";
};
/* Enable GPT for use as a hardware timer. This disables Cortex Systick.
* to use systick, change this node from "gpt_hw_timer" to "systick"
/* GPT and Systick are enabled. If power management is enabled, the GPT
* timer will be used instead of systick, as allows the core clock to
* be gated.
*/
&gpt_hw_timer {
status = "okay";
};
&systick {
status = "okay";
};

View file

@ -165,13 +165,18 @@
pinctrl-names = "default";
};
/* Enable GPT for use as a hardware timer. This disables Cortex Systick.
* to use systick, change this node from "gpt_hw_timer" to "systick"
/* GPT and Systick are enabled. If power management is enabled, the GPT
* timer will be used instead of systick, as allows the core clock to
* be gated.
*/
&gpt_hw_timer {
status = "okay";
};
&systick {
status = "okay";
};
zephyr_udc0: &usb1 {
status = "okay";
};

View file

@ -282,9 +282,14 @@ zephyr_udc0: &usb1 {
status = "okay";
};
/* Enable GPT for use as a hardware timer. This disables Cortex Systick.
* to use systick, change this node from "gpt_hw_timer" to "systick"
/* GPT and Systick are enabled. If power management is enabled, the GPT
* timer will be used instead of systick, as allows the core clock to
* be gated.
*/
&gpt_hw_timer {
status = "okay";
};
&systick {
status = "okay";
};

View file

@ -276,13 +276,18 @@ zephyr_udc0: &usb1 {
pinctrl-names = "default";
};
/* Enable GPT for use as a hardware timer. This disables Cortex Systick.
* to use systick, change this node from "gpt_hw_timer" to "systick"
/* GPT and Systick are enabled. If power management is enabled, the GPT
* timer will be used instead of systick, as allows the core clock to
* be gated.
*/
&gpt_hw_timer {
status = "okay";
};
&systick {
status = "okay";
};
&iomuxcgpr {
status = "okay";
};

View file

@ -337,13 +337,18 @@ zephyr_udc0: &usb1 {
pinctrl-names = "default";
};
/* Enable GPT for use as a hardware timer. This disables Cortex Systick.
* to use systick, change this node from "gpt_hw_timer" to "systick"
/* GPT and Systick are enabled. If power management is enabled, the GPT
* timer will be used instead of systick, as allows the core clock to
* be gated.
*/
&gpt_hw_timer {
status = "okay";
};
&systick {
status = "okay";
};
&itm {
pinctrl-0 = <&pinmux_swo>;
pinctrl-names = "default";

View file

@ -47,13 +47,18 @@
status = "okay";
};
/* Enable GPT for use as a hardware timer. This disables Cortex Systick.
* to use systick, change this node from "gpt_hw_timer" to "systick"
/* GPT and Systick are enabled. If power management is enabled, the GPT
* timer will be used instead of systick, as allows the core clock to
* be gated.
*/
&gpt_hw_timer {
status = "okay";
};
&systick {
status = "okay";
};
&edma_lpsr0 {
status = "okay";
};

View file

@ -60,13 +60,18 @@
status = "okay";
};
/* Enable GPT for use as a hardware timer. This disables Cortex Systick.
* to use systick, change this node from "gpt_hw_timer" to "systick"
/* GPT and Systick are enabled. If power management is enabled, the GPT
* timer will be used instead of systick, as allows the core clock to
* be gated.
*/
&gpt_hw_timer {
status = "okay";
};
&systick {
status = "okay";
};
&lpadc0 {
status = "okay";
};

View file

@ -47,13 +47,18 @@
status = "okay";
};
/* Enable GPT for use as a hardware timer. This disables Cortex Systick.
* to use systick, change this node from "gpt_hw_timer" to "systick"
/* GPT and Systick are enabled. If power management is enabled, the GPT
* timer will be used instead of systick, as allows the core clock to
* be gated.
*/
&gpt_hw_timer {
status = "okay";
};
&systick {
status = "okay";
};
&sai1 {
status = "okay";
};

View file

@ -135,13 +135,18 @@
status = "okay";
};
/* Enable GPT for use as a hardware timer. This disables Cortex Systick.
* to use systick, change this node from "gpt_hw_timer" to "systick"
/* GPT and Systick are enabled. If power management is enabled, the GPT
* timer will be used instead of systick, as allows the core clock to
* be gated.
*/
&gpt_hw_timer {
status = "okay";
};
&systick {
status = "okay";
};
&wdog1 {
status = "okay";
};

View file

@ -4,6 +4,7 @@
config MCUX_GPT_TIMER
bool "MCUX GPT Event timer"
default y
depends on PM
depends on DT_HAS_NXP_GPT_HW_TIMER_ENABLED
select TICKLESS_CAPABLE
help

View file

@ -14,4 +14,7 @@ config NUM_IRQS
config GPIO
default y
config SYS_CLOCK_HW_CYCLES_PER_SEC
default 240000000 if CORTEX_M_SYSTICK
endif # SOC_MIMXRT1166_CM4

View file

@ -14,4 +14,7 @@ config NUM_IRQS
config GPIO
default y
config SYS_CLOCK_HW_CYCLES_PER_SEC
default 600000000 if CORTEX_M_SYSTICK
endif # SOC_MIMXRT1166_CM7

View file

@ -47,6 +47,10 @@ config SYS_CLOCK_HW_CYCLES_PER_SEC
default $(dt_node_int_prop_int,$(DT_SYSCLK_PATH),clock-frequency) if SOC_SERIES_IMX_RT10XX && CORTEX_M_SYSTICK
default 32768 if MCUX_GPT_TIMER
# Disable systick if using MCUX_GPT_TIMER, as they will conflict
config CORTEX_M_SYSTICK
default n if MCUX_GPT_TIMER
config PM_MCUX_GPC
default y if HAS_MCUX_GPC
depends on SOC_SERIES_IMX_RT11XX && PM