From b330f18a3964883d3ca5c6d810b2860263fe75c9 Mon Sep 17 00:00:00 2001 From: Daniel DeGrasse Date: Thu, 14 Oct 2021 09:45:59 -0500 Subject: [PATCH] boards: mimxrt1xxx: Added support for GPT hardware timer on RT1xxx Adds support for using GPT as the hardware timer source (as opposed to systick) for all RT1xxx platforms. This requires moving the clock frequency of these devices into a defconfig so it can be overridden by the GPT clock frequency. Signed-off-by: Daniel DeGrasse --- boards/arm/mimxrt1010_evk/doc/index.rst | 6 ++++-- boards/arm/mimxrt1010_evk/mimxrt1010_evk.dts | 7 +++++++ boards/arm/mimxrt1010_evk/mimxrt1010_evk_defconfig | 2 -- boards/arm/mimxrt1015_evk/doc/index.rst | 6 ++++-- boards/arm/mimxrt1015_evk/mimxrt1015_evk.dts | 7 +++++++ boards/arm/mimxrt1015_evk/mimxrt1015_evk_defconfig | 2 -- boards/arm/mimxrt1020_evk/doc/index.rst | 6 ++++-- boards/arm/mimxrt1020_evk/mimxrt1020_evk.dts | 7 +++++++ boards/arm/mimxrt1020_evk/mimxrt1020_evk_defconfig | 2 -- boards/arm/mimxrt1024_evk/doc/index.rst | 6 ++++-- boards/arm/mimxrt1024_evk/mimxrt1024_evk.dts | 7 +++++++ boards/arm/mimxrt1024_evk/mimxrt1024_evk_defconfig | 2 -- boards/arm/mimxrt1050_evk/doc/index.rst | 6 ++++-- boards/arm/mimxrt1050_evk/mimxrt1050_evk.dts | 7 +++++++ boards/arm/mimxrt1050_evk/mimxrt1050_evk_defconfig | 2 -- boards/arm/mimxrt1050_evk/mimxrt1050_evk_qspi_defconfig | 2 -- boards/arm/mimxrt1060_evk/doc/index.rst | 6 ++++-- boards/arm/mimxrt1060_evk/mimxrt1060_evk.dts | 7 +++++++ boards/arm/mimxrt1060_evk/mimxrt1060_evk_defconfig | 2 -- .../arm/mimxrt1060_evk/mimxrt1060_evk_hyperflash_defconfig | 2 -- boards/arm/mimxrt1160_evk/doc/index.rst | 6 ++++-- boards/arm/mimxrt1160_evk/mimxrt1160_evk_cm4.dts | 7 +++++++ boards/arm/mimxrt1160_evk/mimxrt1160_evk_cm7.dts | 7 +++++++ boards/arm/mimxrt1170_evk/doc/index.rst | 6 ++++-- boards/arm/mimxrt1170_evk/mimxrt1170_evk_cm4.dts | 7 +++++++ boards/arm/mimxrt1170_evk/mimxrt1170_evk_cm4_defconfig | 2 -- boards/arm/mimxrt1170_evk/mimxrt1170_evk_cm7.dts | 7 +++++++ boards/arm/mimxrt1170_evk/mimxrt1170_evk_cm7_defconfig | 2 -- soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1010 | 3 +++ soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1015 | 3 +++ soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1021 | 3 +++ soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1024 | 3 +++ soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1052 | 3 +++ soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1062 | 3 +++ soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1176_cm4 | 3 +++ soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1176_cm7 | 3 +++ 36 files changed, 126 insertions(+), 36 deletions(-) diff --git a/boards/arm/mimxrt1010_evk/doc/index.rst b/boards/arm/mimxrt1010_evk/doc/index.rst index a74e2c9f5c0..71c068a7f60 100644 --- a/boards/arm/mimxrt1010_evk/doc/index.rst +++ b/boards/arm/mimxrt1010_evk/doc/index.rst @@ -78,6 +78,8 @@ features: +-----------+------------+-------------------------------------+ | ADC | on-chip | adc | +-----------+------------+-------------------------------------+ +| GPT | on-chip | gpt | ++-----------+------------+-------------------------------------+ The default configuration can be found in the defconfig file: ``boards/arm/mimxrt1010_evk/mimxrt1010_evk_defconfig`` @@ -120,8 +122,8 @@ The MIMXRT1010 SoC has five pairs of pinmux/gpio controllers. System Clock ============ -The MIMXRT1010 SoC is configured to use the 24 MHz external oscillator on the -board with the on-chip PLL to generate a 500 MHz core clock. +The MIMXRT1010 SoC is configured to use the 32 KHz low frequency oscillator on +the board as a source for the GPT timer to generate a system clock. Serial Port =========== diff --git a/boards/arm/mimxrt1010_evk/mimxrt1010_evk.dts b/boards/arm/mimxrt1010_evk/mimxrt1010_evk.dts index 2e94f27636f..c9a7c3610f6 100644 --- a/boards/arm/mimxrt1010_evk/mimxrt1010_evk.dts +++ b/boards/arm/mimxrt1010_evk/mimxrt1010_evk.dts @@ -83,3 +83,10 @@ zephyr_udc0: &usb1 { &edma0 { 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_hw_timer { + status = "okay"; +}; diff --git a/boards/arm/mimxrt1010_evk/mimxrt1010_evk_defconfig b/boards/arm/mimxrt1010_evk/mimxrt1010_evk_defconfig index b84a3356162..785deb09b20 100644 --- a/boards/arm/mimxrt1010_evk/mimxrt1010_evk_defconfig +++ b/boards/arm/mimxrt1010_evk/mimxrt1010_evk_defconfig @@ -9,8 +9,6 @@ CONFIG_SOC_SERIES_IMX_RT=y CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y CONFIG_SERIAL=y -CONFIG_CORTEX_M_SYSTICK=y CONFIG_GPIO=y -CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=500000000 CONFIG_ARM_MPU=y CONFIG_HW_STACK_PROTECTION=y diff --git a/boards/arm/mimxrt1015_evk/doc/index.rst b/boards/arm/mimxrt1015_evk/doc/index.rst index 82f0bd2803c..0d304a46b8a 100644 --- a/boards/arm/mimxrt1015_evk/doc/index.rst +++ b/boards/arm/mimxrt1015_evk/doc/index.rst @@ -78,6 +78,8 @@ features: +-----------+------------+-------------------------------------+ | ADC | on-chip | ADC | +-----------+------------+-------------------------------------+ +| GPT | on-chip | gpt | ++-----------+------------+-------------------------------------+ The default configuration can be found in the defconfig file: ``boards/arm/mimxrt1015_evk/mimxrt1015_evk_defconfig`` @@ -124,8 +126,8 @@ The MIMXRT1015 SoC has five pairs of pinmux/gpio controllers. System Clock ============ -The MIMXRT1015 SoC is configured to use the 24 MHz external oscillator on the -board with the on-chip PLL to generate a 500 MHz core clock. +The MIMXRT1015 SoC is configured to use the 32 KHz low frequency oscillator on +the board as a source for the GPT timer to generate a system clock. Serial Port =========== diff --git a/boards/arm/mimxrt1015_evk/mimxrt1015_evk.dts b/boards/arm/mimxrt1015_evk/mimxrt1015_evk.dts index 5533bed8afc..6f693555811 100644 --- a/boards/arm/mimxrt1015_evk/mimxrt1015_evk.dts +++ b/boards/arm/mimxrt1015_evk/mimxrt1015_evk.dts @@ -112,3 +112,10 @@ zephyr_udc0: &usb1 { &edma0 { 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_hw_timer { + status = "okay"; +}; diff --git a/boards/arm/mimxrt1015_evk/mimxrt1015_evk_defconfig b/boards/arm/mimxrt1015_evk/mimxrt1015_evk_defconfig index 634a9e0bf0d..bb3b60e6fa3 100644 --- a/boards/arm/mimxrt1015_evk/mimxrt1015_evk_defconfig +++ b/boards/arm/mimxrt1015_evk/mimxrt1015_evk_defconfig @@ -9,8 +9,6 @@ CONFIG_SOC_SERIES_IMX_RT=y CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y CONFIG_SERIAL=y -CONFIG_CORTEX_M_SYSTICK=y CONFIG_GPIO=y -CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=500000000 CONFIG_ARM_MPU=y CONFIG_HW_STACK_PROTECTION=y diff --git a/boards/arm/mimxrt1020_evk/doc/index.rst b/boards/arm/mimxrt1020_evk/doc/index.rst index bcfa04a0b94..477289941b4 100644 --- a/boards/arm/mimxrt1020_evk/doc/index.rst +++ b/boards/arm/mimxrt1020_evk/doc/index.rst @@ -92,6 +92,8 @@ features: +-----------+------------+-------------------------------------+ | ADC | on-chip | adc | +-----------+------------+-------------------------------------+ +| GPT | on-chip | gpt | ++-----------+------------+-------------------------------------+ The default configuration can be found in the defconfig file: ``boards/arm/mimxrt1020_evk/mimxrt1020_evk_defconfig`` @@ -174,8 +176,8 @@ The MIMXRT1020 SoC has five pairs of pinmux/gpio controllers. System Clock ============ -The MIMXRT1020 SoC is configured to use the 24 MHz external oscillator on the -board with the on-chip PLL to generate a 500 MHz core clock. +The MIMXRT1020 SoC is configured to use the 32 KHz low frequency oscillator on +the board as a source for the GPT timer to generate a system clock. Serial Port =========== diff --git a/boards/arm/mimxrt1020_evk/mimxrt1020_evk.dts b/boards/arm/mimxrt1020_evk/mimxrt1020_evk.dts index 4e9bafdb9db..aee07d9f7f1 100644 --- a/boards/arm/mimxrt1020_evk/mimxrt1020_evk.dts +++ b/boards/arm/mimxrt1020_evk/mimxrt1020_evk.dts @@ -169,3 +169,10 @@ zephyr_udc0: &usb1 { &edma0 { 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_hw_timer { + status = "okay"; +}; diff --git a/boards/arm/mimxrt1020_evk/mimxrt1020_evk_defconfig b/boards/arm/mimxrt1020_evk/mimxrt1020_evk_defconfig index 8bd73d28bc0..aecf8d92f24 100644 --- a/boards/arm/mimxrt1020_evk/mimxrt1020_evk_defconfig +++ b/boards/arm/mimxrt1020_evk/mimxrt1020_evk_defconfig @@ -9,8 +9,6 @@ CONFIG_SOC_SERIES_IMX_RT=y CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y CONFIG_SERIAL=y -CONFIG_CORTEX_M_SYSTICK=y CONFIG_GPIO=y -CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=500000000 CONFIG_ARM_MPU=y CONFIG_HW_STACK_PROTECTION=y diff --git a/boards/arm/mimxrt1024_evk/doc/index.rst b/boards/arm/mimxrt1024_evk/doc/index.rst index e5fd0a3025f..66c7197d56b 100644 --- a/boards/arm/mimxrt1024_evk/doc/index.rst +++ b/boards/arm/mimxrt1024_evk/doc/index.rst @@ -99,6 +99,8 @@ features: +-----------+------------+-------------------------------------+ | ADC | on-chip | adc | +-----------+------------+-------------------------------------+ +| GPT | on-chip | gpt | ++-----------+------------+-------------------------------------+ The default configuration can be found in the defconfig file: ``boards/arm/mimxrt1024_evk/mimxrt1024_evk_defconfig`` @@ -161,8 +163,8 @@ The MIMXRT1024 SoC has five pairs of pinmux/gpio controllers. System Clock ============ -The MIMXRT1024 SoC is configured to use the 24 MHz external oscillator on the -board with the on-chip PLL to generate a 500 MHz core clock. +The MIMXRT1024 SoC is configured to use the 32 KHz low frequency oscillator on +the board as a source for the GPT timer to generate a system clock. Serial Port =========== diff --git a/boards/arm/mimxrt1024_evk/mimxrt1024_evk.dts b/boards/arm/mimxrt1024_evk/mimxrt1024_evk.dts index 8d07f1769f5..19834938a7b 100644 --- a/boards/arm/mimxrt1024_evk/mimxrt1024_evk.dts +++ b/boards/arm/mimxrt1024_evk/mimxrt1024_evk.dts @@ -127,3 +127,10 @@ &adc1 { 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_hw_timer { + status = "okay"; +}; diff --git a/boards/arm/mimxrt1024_evk/mimxrt1024_evk_defconfig b/boards/arm/mimxrt1024_evk/mimxrt1024_evk_defconfig index dcba4293b9d..c192e938afb 100644 --- a/boards/arm/mimxrt1024_evk/mimxrt1024_evk_defconfig +++ b/boards/arm/mimxrt1024_evk/mimxrt1024_evk_defconfig @@ -9,8 +9,6 @@ CONFIG_SOC_SERIES_IMX_RT=y CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y CONFIG_SERIAL=y -CONFIG_CORTEX_M_SYSTICK=y CONFIG_GPIO=y -CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=500000000 CONFIG_ARM_MPU=y CONFIG_HW_STACK_PROTECTION=y diff --git a/boards/arm/mimxrt1050_evk/doc/index.rst b/boards/arm/mimxrt1050_evk/doc/index.rst index 30971f84b7c..f49c28b3e8d 100644 --- a/boards/arm/mimxrt1050_evk/doc/index.rst +++ b/boards/arm/mimxrt1050_evk/doc/index.rst @@ -118,6 +118,8 @@ features: +-----------+------------+-------------------------------------+ | ADC | on-chip | adc | +-----------+------------+-------------------------------------+ +| GPT | on-chip | gpt | ++-----------+------------+-------------------------------------+ The default configuration can be found in the defconfig file: @@ -255,8 +257,8 @@ The MIMXRT1050 SoC has five pairs of pinmux/gpio controllers. System Clock ============ -The MIMXRT1050 SoC is configured to use the 24 MHz external oscillator on the -board with the on-chip PLL to generate a 600 MHz core clock. +The MIMXRT1050 SoC is configured to use the 32 KHz low frequency oscillator on +the board as a source for the GPT timer to generate a system clock. Serial Port =========== diff --git a/boards/arm/mimxrt1050_evk/mimxrt1050_evk.dts b/boards/arm/mimxrt1050_evk/mimxrt1050_evk.dts index 17331e5d39b..eb062b42439 100644 --- a/boards/arm/mimxrt1050_evk/mimxrt1050_evk.dts +++ b/boards/arm/mimxrt1050_evk/mimxrt1050_evk.dts @@ -232,3 +232,10 @@ zephyr_udc0: &usb1 { &edma0 { 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_hw_timer { + status = "okay"; +}; diff --git a/boards/arm/mimxrt1050_evk/mimxrt1050_evk_defconfig b/boards/arm/mimxrt1050_evk/mimxrt1050_evk_defconfig index d7fd4dd692e..95e4ad9a580 100644 --- a/boards/arm/mimxrt1050_evk/mimxrt1050_evk_defconfig +++ b/boards/arm/mimxrt1050_evk/mimxrt1050_evk_defconfig @@ -10,8 +10,6 @@ CONFIG_BOARD_MIMXRT1050_EVK=y CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y CONFIG_SERIAL=y -CONFIG_CORTEX_M_SYSTICK=y CONFIG_GPIO=y -CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=600000000 CONFIG_ARM_MPU=y CONFIG_HW_STACK_PROTECTION=y diff --git a/boards/arm/mimxrt1050_evk/mimxrt1050_evk_qspi_defconfig b/boards/arm/mimxrt1050_evk/mimxrt1050_evk_qspi_defconfig index aed6db26496..c009123dc1f 100644 --- a/boards/arm/mimxrt1050_evk/mimxrt1050_evk_qspi_defconfig +++ b/boards/arm/mimxrt1050_evk/mimxrt1050_evk_qspi_defconfig @@ -10,8 +10,6 @@ CONFIG_BOARD_MIMXRT1050_EVK_QSPI=y CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y CONFIG_SERIAL=y -CONFIG_CORTEX_M_SYSTICK=y CONFIG_GPIO=y -CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=600000000 CONFIG_ARM_MPU=y CONFIG_HW_STACK_PROTECTION=y diff --git a/boards/arm/mimxrt1060_evk/doc/index.rst b/boards/arm/mimxrt1060_evk/doc/index.rst index 71ff1d1813b..a31fa40e740 100644 --- a/boards/arm/mimxrt1060_evk/doc/index.rst +++ b/boards/arm/mimxrt1060_evk/doc/index.rst @@ -123,6 +123,8 @@ features: +-----------+------------+-------------------------------------+ | SAI | on-chip | i2s | +-----------+------------+-------------------------------------+ +| GPT | on-chip | gpt | ++-----------+------------+-------------------------------------+ The default configuration can be found in the defconfig file: ``boards/arm/mimxrt1060_evk/mimxrt1060_evk_defconfig`` @@ -271,8 +273,8 @@ The MIMXRT1060 SoC has five pairs of pinmux/gpio controllers. System Clock ============ -The MIMXRT1060 SoC is configured to use the 24 MHz external oscillator on the -board with the on-chip PLL to generate a 600 MHz core clock. +The MIMXRT1060 SoC is configured to use the 32 KHz low frequency oscillator on +the board as a source for the GPT timer to generate a system clock. Serial Port =========== diff --git a/boards/arm/mimxrt1060_evk/mimxrt1060_evk.dts b/boards/arm/mimxrt1060_evk/mimxrt1060_evk.dts index 2b00a22b255..7446bf6573f 100644 --- a/boards/arm/mimxrt1060_evk/mimxrt1060_evk.dts +++ b/boards/arm/mimxrt1060_evk/mimxrt1060_evk.dts @@ -219,3 +219,10 @@ zephyr_udc0: &usb1 { &sai1 { 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_hw_timer { + status = "okay"; +}; diff --git a/boards/arm/mimxrt1060_evk/mimxrt1060_evk_defconfig b/boards/arm/mimxrt1060_evk/mimxrt1060_evk_defconfig index 8a32442e5ce..535467c4575 100644 --- a/boards/arm/mimxrt1060_evk/mimxrt1060_evk_defconfig +++ b/boards/arm/mimxrt1060_evk/mimxrt1060_evk_defconfig @@ -10,8 +10,6 @@ CONFIG_BOARD_MIMXRT1060_EVK=y CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y CONFIG_SERIAL=y -CONFIG_CORTEX_M_SYSTICK=y CONFIG_GPIO=y -CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=600000000 CONFIG_ARM_MPU=y CONFIG_HW_STACK_PROTECTION=y diff --git a/boards/arm/mimxrt1060_evk/mimxrt1060_evk_hyperflash_defconfig b/boards/arm/mimxrt1060_evk/mimxrt1060_evk_hyperflash_defconfig index 257a0bd794d..f3f6029c4d9 100644 --- a/boards/arm/mimxrt1060_evk/mimxrt1060_evk_hyperflash_defconfig +++ b/boards/arm/mimxrt1060_evk/mimxrt1060_evk_hyperflash_defconfig @@ -10,8 +10,6 @@ CONFIG_BOARD_MIMXRT1060_EVK_HYPERFLASH=y CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y CONFIG_SERIAL=y -CONFIG_CORTEX_M_SYSTICK=y CONFIG_GPIO=y -CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=600000000 CONFIG_ARM_MPU=y CONFIG_HW_STACK_PROTECTION=y diff --git a/boards/arm/mimxrt1160_evk/doc/index.rst b/boards/arm/mimxrt1160_evk/doc/index.rst index 3d676801bae..b07eb86f562 100644 --- a/boards/arm/mimxrt1160_evk/doc/index.rst +++ b/boards/arm/mimxrt1160_evk/doc/index.rst @@ -113,6 +113,8 @@ features: +-----------+------------+-------------------------------------+ | DMA | on-chip | dma | +-----------+------------+-------------------------------------+ +| GPT | on-chip | gpt | ++-----------+------------+-------------------------------------+ The default configuration can be found in the defconfig file: ``boards/arm/mimxrt1160_evk/mimxrt1160_evk_cm7_defconfig`` @@ -162,8 +164,8 @@ The MIMXRT1160 SoC has six pairs of pinmux/gpio controllers. System Clock ============ -The MIMXRT1160 SoC is configured to use the 24 MHz external oscillator on the -board with the on-chip PLL to generate a 600 MHz core clock. +The MIMXRT1160 SoC is configured to use the 32 KHz low frequency oscillator on +the board as a source for the GPT timer to generate a system clock. Serial Port =========== diff --git a/boards/arm/mimxrt1160_evk/mimxrt1160_evk_cm4.dts b/boards/arm/mimxrt1160_evk/mimxrt1160_evk_cm4.dts index 1e420201a72..249e03bf1d2 100644 --- a/boards/arm/mimxrt1160_evk/mimxrt1160_evk_cm4.dts +++ b/boards/arm/mimxrt1160_evk/mimxrt1160_evk_cm4.dts @@ -84,3 +84,10 @@ }; }; }; + +/* 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_hw_timer { + status = "okay"; +}; diff --git a/boards/arm/mimxrt1160_evk/mimxrt1160_evk_cm7.dts b/boards/arm/mimxrt1160_evk/mimxrt1160_evk_cm7.dts index b681c6e3b19..f9894f5ca5c 100644 --- a/boards/arm/mimxrt1160_evk/mimxrt1160_evk_cm7.dts +++ b/boards/arm/mimxrt1160_evk/mimxrt1160_evk_cm7.dts @@ -96,6 +96,13 @@ }; }; +/* 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_hw_timer { + status = "okay"; +}; + &lpadc0 { status = "okay"; }; diff --git a/boards/arm/mimxrt1170_evk/doc/index.rst b/boards/arm/mimxrt1170_evk/doc/index.rst index 6f2f171c159..a6346aa128a 100644 --- a/boards/arm/mimxrt1170_evk/doc/index.rst +++ b/boards/arm/mimxrt1170_evk/doc/index.rst @@ -113,6 +113,8 @@ features: +-----------+------------+-------------------------------------+ | DMA | on-chip | dma | +-----------+------------+-------------------------------------+ +| GPT | on-chip | gpt | ++-----------+------------+-------------------------------------+ The default configuration can be found in the defconfig file: ``boards/arm/mimxrt1170_evk/mimxrt1170_evk_cm7_defconfig`` @@ -162,8 +164,8 @@ The MIMXRT1170 SoC has six pairs of pinmux/gpio controllers. System Clock ============ -The MIMXRT1170 SoC is configured to use the 24 MHz external oscillator on the -board with the on-chip PLL to generate a 1 GHz core clock. +The MIMXRT1170 SoC is configured to use the 32 KHz low frequency oscillator on +the board as a source for the GPT timer to generate a system clock. Serial Port =========== diff --git a/boards/arm/mimxrt1170_evk/mimxrt1170_evk_cm4.dts b/boards/arm/mimxrt1170_evk/mimxrt1170_evk_cm4.dts index 9cae28654ce..443f0e8b07f 100644 --- a/boards/arm/mimxrt1170_evk/mimxrt1170_evk_cm4.dts +++ b/boards/arm/mimxrt1170_evk/mimxrt1170_evk_cm4.dts @@ -84,3 +84,10 @@ }; }; }; + +/* 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_hw_timer { + status = "okay"; +}; diff --git a/boards/arm/mimxrt1170_evk/mimxrt1170_evk_cm4_defconfig b/boards/arm/mimxrt1170_evk/mimxrt1170_evk_cm4_defconfig index fbf4b380c06..713468e4423 100644 --- a/boards/arm/mimxrt1170_evk/mimxrt1170_evk_cm4_defconfig +++ b/boards/arm/mimxrt1170_evk/mimxrt1170_evk_cm4_defconfig @@ -9,8 +9,6 @@ CONFIG_SOC_SERIES_IMX_RT=y CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y CONFIG_SERIAL=y -CONFIG_CORTEX_M_SYSTICK=y CONFIG_GPIO=y -CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=400000000 CONFIG_ARM_MPU=y CONFIG_HW_STACK_PROTECTION=y diff --git a/boards/arm/mimxrt1170_evk/mimxrt1170_evk_cm7.dts b/boards/arm/mimxrt1170_evk/mimxrt1170_evk_cm7.dts index 0bf2a62e37d..c9afd5c15e7 100644 --- a/boards/arm/mimxrt1170_evk/mimxrt1170_evk_cm7.dts +++ b/boards/arm/mimxrt1170_evk/mimxrt1170_evk_cm7.dts @@ -110,3 +110,10 @@ &edma0 { 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_hw_timer { + status = "okay"; +}; diff --git a/boards/arm/mimxrt1170_evk/mimxrt1170_evk_cm7_defconfig b/boards/arm/mimxrt1170_evk/mimxrt1170_evk_cm7_defconfig index 197f6b008cc..f7a9c5037b7 100644 --- a/boards/arm/mimxrt1170_evk/mimxrt1170_evk_cm7_defconfig +++ b/boards/arm/mimxrt1170_evk/mimxrt1170_evk_cm7_defconfig @@ -9,9 +9,7 @@ CONFIG_SOC_SERIES_IMX_RT=y CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y CONFIG_SERIAL=y -CONFIG_CORTEX_M_SYSTICK=y CONFIG_GPIO=y -CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=996000000 CONFIG_ARM_MPU=y CONFIG_HW_STACK_PROTECTION=y CONFIG_FLEXSPI_CONFIG_BLOCK_OFFSET=0x400 diff --git a/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1010 b/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1010 index 1aea5894787..494eb6b344a 100644 --- a/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1010 +++ b/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1010 @@ -30,4 +30,7 @@ config GPIO config FLEXSPI_CONFIG_BLOCK_OFFSET default 0x400 +config SYS_CLOCK_HW_CYCLES_PER_SEC + default 500000000 if CORTEX_M_SYSTICK + endif # SOC_MIMXRT1010 diff --git a/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1015 b/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1015 index 2ef7f7269bc..0a615431d22 100644 --- a/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1015 +++ b/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1015 @@ -23,4 +23,7 @@ config IPG_DIV config GPIO default y +config SYS_CLOCK_HW_CYCLES_PER_SEC + default 500000000 if CORTEX_M_SYSTICK + endif # SOC_MIMXRT1015 diff --git a/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1021 b/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1021 index 2d694e8d2c6..dfebaa29141 100644 --- a/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1021 +++ b/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1021 @@ -23,4 +23,7 @@ config IPG_DIV config GPIO default y +config SYS_CLOCK_HW_CYCLES_PER_SEC + default 500000000 if CORTEX_M_SYSTICK + endif # SOC_MIMXRT1021 diff --git a/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1024 b/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1024 index 263d8c381c3..736a60edad2 100644 --- a/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1024 +++ b/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1024 @@ -23,4 +23,7 @@ config IPG_DIV config GPIO default y +config SYS_CLOCK_HW_CYCLES_PER_SEC + default 500000000 if CORTEX_M_SYSTICK + endif # SOC_MIMXRT1024 diff --git a/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1052 b/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1052 index 35f0a49673e..e0632f785f3 100644 --- a/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1052 +++ b/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1052 @@ -23,4 +23,7 @@ config IPG_DIV config GPIO default y +config SYS_CLOCK_HW_CYCLES_PER_SEC + default 600000000 if CORTEX_M_SYSTICK + endif # SOC_MIMXRT1052 diff --git a/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1062 b/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1062 index b050dc32bcb..b04ccbcd9ee 100644 --- a/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1062 +++ b/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1062 @@ -23,4 +23,7 @@ config IPG_DIV config GPIO default y +config SYS_CLOCK_HW_CYCLES_PER_SEC + default 600000000 if CORTEX_M_SYSTICK + endif # SOC_MIMXRT1062 diff --git a/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1176_cm4 b/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1176_cm4 index a1ca7da6d7d..9df2704af34 100644 --- a/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1176_cm4 +++ b/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1176_cm4 @@ -14,4 +14,7 @@ config NUM_IRQS config GPIO default y +config SYS_CLOCK_HW_CYCLES_PER_SEC + default 400000000 if CORTEX_M_SYSTICK + endif # SOC_MIMXRT1170_CM4 diff --git a/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1176_cm7 b/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1176_cm7 index ae2e06c74d5..f829da5de87 100644 --- a/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1176_cm7 +++ b/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1176_cm7 @@ -14,4 +14,7 @@ config NUM_IRQS config GPIO default y +config SYS_CLOCK_HW_CYCLES_PER_SEC + default 996000000 if CORTEX_M_SYSTICK + endif # SOC_MIMXRT1176_CM7