diff --git a/boards/arm/mimxrt1010_evk/mimxrt1010_evk.dts b/boards/arm/mimxrt1010_evk/mimxrt1010_evk.dts index 320570f8e7..a573ed12c7 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 e66a7eec85..97992dbdb2 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 0bbdf53523..453537a72e 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 2a8b346211..cd8fe279a2 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 4cc6519e91..b8c3857645 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 8edd99b1bf..c55dfc4d0f 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 023a88c458..ee01f6b347 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 1cc65b2802..a92f93feb8 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 278e0f2901..2be16c130e 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 f00884d6c8..c4402d7fec 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 b7c9d83b02..dafefb4870 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 78f485a814..a3e55c4e54 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 ec984d6a9a..c3043d9352 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 a1739308c5..e26825f98a 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 d613f52203..9692cd0203 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