Skip to content

Commit 3b743cb

Browse files
LPIT Support on Zephyr
1. Provide counter driver based on lpit driver from NXP mcux-sdk-ng 2. Enable tests/drivers/counter/counter_nxp_lpit_api based on NXP mimxrt1180_evk, all channels test pass. Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
1 parent f52d71c commit 3b743cb

File tree

19 files changed

+1389
-1
lines changed

19 files changed

+1389
-1
lines changed

drivers/clock_control/clock_control_mcux_ccm_rev2.c

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,25 @@ static int mcux_ccm_get_subsys_rate(const struct device *dev,
256256
clock_root = kCLOCK_Root_Bus + instance;
257257
break;
258258
#endif
259-
259+
#ifdef CONFIG_COUNTER_MCUX_LPIT
260+
#if defined(CONFIG_SOC_SERIES_IMXRT118X)
261+
case IMX_CCM_LPIT_CLK:
262+
switch (instance) {
263+
case 0:
264+
clock_root = kCLOCK_Root_Bus_Aon;
265+
break;
266+
case 1:
267+
clock_root = kCLOCK_Root_Bus_Wakeup;
268+
break;
269+
case 2:
270+
clock_root = kCLOCK_Root_Lpit3;
271+
break;
272+
default:
273+
return -EINVAL;
274+
}
275+
break;
276+
#endif
277+
#endif
260278
#ifdef CONFIG_ADC_MCUX_LPADC
261279
case IMX_CCM_LPADC1_CLK:
262280
clock_root = kCLOCK_Root_Adc1 + instance;

drivers/counter/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ zephyr_library_sources_ifdef(CONFIG_COUNTER_MCUX_SNVS counter_mcux_snv
3333
zephyr_library_sources_ifdef(CONFIG_COUNTER_MCUX_TPM counter_mcux_tpm.c)
3434
zephyr_library_sources_ifdef(CONFIG_COUNTER_XEC counter_mchp_xec.c)
3535
zephyr_library_sources_ifdef(CONFIG_COUNTER_MCUX_LPTMR counter_mcux_lptmr.c)
36+
zephyr_library_sources_ifdef(CONFIG_COUNTER_MCUX_LPIT counter_mcux_lpit.c)
3637
zephyr_library_sources_ifdef(CONFIG_COUNTER_MAXIM_DS3231 maxim_ds3231.c)
3738
zephyr_library_sources_ifdef(CONFIG_COUNTER_NATIVE_SIM counter_native_sim.c)
3839
zephyr_library_sources_ifdef(CONFIG_USERSPACE counter_handlers.c)

drivers/counter/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ source "drivers/counter/Kconfig.xec"
7070

7171
source "drivers/counter/Kconfig.mcux_lptmr"
7272

73+
source "drivers/counter/Kconfig.mcux_lpit"
74+
7375
source "drivers/counter/Kconfig.maxim_ds3231"
7476

7577
source "drivers/counter/Kconfig.native_sim"

drivers/counter/Kconfig.mcux_lpit

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright 2025 NXP
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# MCUXpresso SDK Low Power Periodic Interrupt Timer (LPIT)
5+
config COUNTER_MCUX_LPIT
6+
bool "NXP LPIT driver"
7+
default y
8+
depends on DT_HAS_NXP_LPIT_CHANNEL_ENABLED && \
9+
DT_HAS_NXP_LPIT_ENABLED
10+
help
11+
Enable support for the NXP Low Power Periodic Interrupt Timer (LPIT).

0 commit comments

Comments
 (0)