Skip to content

LPIT Support on Zephyr #93167

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion drivers/clock_control/clock_control_mcux_ccm_rev2.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,25 @@ static int mcux_ccm_get_subsys_rate(const struct device *dev,
clock_root = kCLOCK_Root_Bus + instance;
break;
#endif

#ifdef CONFIG_COUNTER_MCUX_LPIT
#if defined(CONFIG_SOC_SERIES_IMXRT118X)
case IMX_CCM_LPIT_CLK:
switch (instance) {
case 0:
clock_root = kCLOCK_Root_Bus_Aon;
break;
case 1:
clock_root = kCLOCK_Root_Bus_Wakeup;
break;
case 2:
clock_root = kCLOCK_Root_Lpit3;
break;
default:
return -EINVAL;
}
break;
#endif
#endif
#ifdef CONFIG_ADC_MCUX_LPADC
case IMX_CCM_LPADC1_CLK:
clock_root = kCLOCK_Root_Adc1 + instance;
Expand Down
1 change: 1 addition & 0 deletions drivers/counter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ zephyr_library_sources_ifdef(CONFIG_COUNTER_MCUX_SNVS counter_mcux_snv
zephyr_library_sources_ifdef(CONFIG_COUNTER_MCUX_TPM counter_mcux_tpm.c)
zephyr_library_sources_ifdef(CONFIG_COUNTER_XEC counter_mchp_xec.c)
zephyr_library_sources_ifdef(CONFIG_COUNTER_MCUX_LPTMR counter_mcux_lptmr.c)
zephyr_library_sources_ifdef(CONFIG_COUNTER_MCUX_LPIT counter_mcux_lpit.c)
zephyr_library_sources_ifdef(CONFIG_COUNTER_MAXIM_DS3231 maxim_ds3231.c)
zephyr_library_sources_ifdef(CONFIG_COUNTER_NATIVE_SIM counter_native_sim.c)
zephyr_library_sources_ifdef(CONFIG_USERSPACE counter_handlers.c)
Expand Down
2 changes: 2 additions & 0 deletions drivers/counter/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ source "drivers/counter/Kconfig.xec"

source "drivers/counter/Kconfig.mcux_lptmr"

source "drivers/counter/Kconfig.mcux_lpit"

source "drivers/counter/Kconfig.maxim_ds3231"

source "drivers/counter/Kconfig.native_sim"
Expand Down
11 changes: 11 additions & 0 deletions drivers/counter/Kconfig.mcux_lpit
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright 2025 NXP
# SPDX-License-Identifier: Apache-2.0

# MCUXpresso SDK Low Power Periodic Interrupt Timer (LPIT)
config COUNTER_MCUX_LPIT
bool "NXP LPIT driver"
default y
depends on DT_HAS_NXP_LPIT_CHANNEL_ENABLED && \
DT_HAS_NXP_LPIT_ENABLED
help
Enable support for the NXP Low Power Periodic Interrupt Timer (LPIT).
Loading