diff --git a/boards/arm/mimxrt1010_evk/mimxrt1010_evk.dts b/boards/arm/mimxrt1010_evk/mimxrt1010_evk.dts index 320570f8e7c..a573ed12c7e 100644 --- a/boards/arm/mimxrt1010_evk/mimxrt1010_evk.dts +++ b/boards/arm/mimxrt1010_evk/mimxrt1010_evk.dts @@ -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"; +}; diff --git a/boards/arm/mimxrt1015_evk/mimxrt1015_evk.dts b/boards/arm/mimxrt1015_evk/mimxrt1015_evk.dts index e66a7eec852..97992dbdb26 100644 --- a/boards/arm/mimxrt1015_evk/mimxrt1015_evk.dts +++ b/boards/arm/mimxrt1015_evk/mimxrt1015_evk.dts @@ -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"; +}; diff --git a/boards/arm/mimxrt1020_evk/mimxrt1020_evk.dts b/boards/arm/mimxrt1020_evk/mimxrt1020_evk.dts index 0bbdf535238..453537a72ea 100644 --- a/boards/arm/mimxrt1020_evk/mimxrt1020_evk.dts +++ b/boards/arm/mimxrt1020_evk/mimxrt1020_evk.dts @@ -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"; +}; diff --git a/boards/arm/mimxrt1024_evk/mimxrt1024_evk.dts b/boards/arm/mimxrt1024_evk/mimxrt1024_evk.dts index 2a8b346211a..cd8fe279a28 100644 --- a/boards/arm/mimxrt1024_evk/mimxrt1024_evk.dts +++ b/boards/arm/mimxrt1024_evk/mimxrt1024_evk.dts @@ -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"; }; diff --git a/boards/arm/mimxrt1050_evk/mimxrt1050_evk.dts b/boards/arm/mimxrt1050_evk/mimxrt1050_evk.dts index 4cc6519e915..b8c38576452 100644 --- a/boards/arm/mimxrt1050_evk/mimxrt1050_evk.dts +++ b/boards/arm/mimxrt1050_evk/mimxrt1050_evk.dts @@ -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"; +}; diff --git a/boards/arm/mimxrt1060_evk/mimxrt1060_evk.dts b/boards/arm/mimxrt1060_evk/mimxrt1060_evk.dts index 8edd99b1bfe..c55dfc4d0fd 100644 --- a/boards/arm/mimxrt1060_evk/mimxrt1060_evk.dts +++ b/boards/arm/mimxrt1060_evk/mimxrt1060_evk.dts @@ -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"; }; diff --git a/boards/arm/mimxrt1064_evk/mimxrt1064_evk.dts b/boards/arm/mimxrt1064_evk/mimxrt1064_evk.dts index 023a88c458a..ee01f6b3473 100644 --- a/boards/arm/mimxrt1064_evk/mimxrt1064_evk.dts +++ b/boards/arm/mimxrt1064_evk/mimxrt1064_evk.dts @@ -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"; diff --git a/boards/arm/mimxrt1160_evk/mimxrt1160_evk_cm4.dts b/boards/arm/mimxrt1160_evk/mimxrt1160_evk_cm4.dts index 1cc65b28027..a92f93feb8d 100644 --- a/boards/arm/mimxrt1160_evk/mimxrt1160_evk_cm4.dts +++ b/boards/arm/mimxrt1160_evk/mimxrt1160_evk_cm4.dts @@ -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"; }; diff --git a/boards/arm/mimxrt1160_evk/mimxrt1160_evk_cm7.dts b/boards/arm/mimxrt1160_evk/mimxrt1160_evk_cm7.dts index 278e0f29019..2be16c130e3 100644 --- a/boards/arm/mimxrt1160_evk/mimxrt1160_evk_cm7.dts +++ b/boards/arm/mimxrt1160_evk/mimxrt1160_evk_cm7.dts @@ -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"; }; diff --git a/boards/arm/mimxrt1170_evk/mimxrt1170_evk_cm4.dts b/boards/arm/mimxrt1170_evk/mimxrt1170_evk_cm4.dts index f00884d6c88..c4402d7fec3 100644 --- a/boards/arm/mimxrt1170_evk/mimxrt1170_evk_cm4.dts +++ b/boards/arm/mimxrt1170_evk/mimxrt1170_evk_cm4.dts @@ -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"; }; diff --git a/boards/arm/mimxrt1170_evk/mimxrt1170_evk_cm7.dts b/boards/arm/mimxrt1170_evk/mimxrt1170_evk_cm7.dts index b7c9d83b021..dafefb4870a 100644 --- a/boards/arm/mimxrt1170_evk/mimxrt1170_evk_cm7.dts +++ b/boards/arm/mimxrt1170_evk/mimxrt1170_evk_cm7.dts @@ -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"; }; diff --git a/drivers/timer/Kconfig.mcux_gpt b/drivers/timer/Kconfig.mcux_gpt index 78f485a8147..a3e55c4e545 100644 --- a/drivers/timer/Kconfig.mcux_gpt +++ b/drivers/timer/Kconfig.mcux_gpt @@ -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 diff --git a/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1166_cm4 b/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1166_cm4 index ec984d6a9a3..c3043d93523 100644 --- a/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1166_cm4 +++ b/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1166_cm4 @@ -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 diff --git a/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1166_cm7 b/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1166_cm7 index a1739308c59..e26825f98a8 100644 --- a/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1166_cm7 +++ b/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1166_cm7 @@ -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 diff --git a/soc/arm/nxp_imx/rt/Kconfig.defconfig.series b/soc/arm/nxp_imx/rt/Kconfig.defconfig.series index d613f522039..9692cd0203c 100644 --- a/soc/arm/nxp_imx/rt/Kconfig.defconfig.series +++ b/soc/arm/nxp_imx/rt/Kconfig.defconfig.series @@ -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