Skip to content

Commit bd6d7b6

Browse files
committed
soc: nxp: Introduce Kconfig.peripherals for NXP devices
Introduce Kconfig.peripherals for NXP devices. In this file, we defined kconfig options like MCUX_HW_HAS_xxx, these kconfig option is set to true or false depending on whether the peripheral instance node in DT is enabled or not. why we need MCUX_HW_HAS_xxx? For example, the konfig option 'COUNTER_MCUX_LPTMR_WAKEUP_SOURCE_INDEX' only sets its value when LPTMR is used as a wakeup source. Therefore, we need to use the predefined kconfig function 'dt_nodelabel_bool_prop' in kconfig to determine whether LPTMR enabled the wakeup-source property. To do this, we need to iterate over all LPTMR nodes in the DT, such as lptmr0, lptmr1, and so on, to see if they enabled the wakeup-source property. How can we iterate over all LPTMR nodes? We need to pass in the currently iterated LPTMR instance. How do we know which instance we are currently iterating over? We need to determine whether MCUX_HW_HAS_LPTMRn is true and then define the current mcux_hw_lptmr_index to n. This will determine the instance. This is why we need MCUX_HW_HAS_xxx and Kconfig.peripherals Signed-off-by: Zhaoxiang Jin <[email protected]>
1 parent f3c2df0 commit bd6d7b6

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

soc/nxp/common/Kconfig.peripherals

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# NXP Semiconductors MCU peripherals list.
2+
3+
# Copyright 2025 NXP
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
config MCUX_HW_HAS_LPTMR0
7+
def_bool $(dt_nodelabel_enabled_with_compat,lptmr0,$(DT_COMPAT_NXP_LPTMR))
8+
9+
config MCUX_HW_HAS_LPTMR1
10+
def_bool $(dt_nodelabel_enabled_with_compat,lptmr1,$(DT_COMPAT_NXP_LPTMR))
11+
12+
config MCUX_HW_HAS_LPTMR2
13+
def_bool $(dt_nodelabel_enabled_with_compat,lptmr2,$(DT_COMPAT_NXP_LPTMR))
14+
15+
config MCUX_HW_HAS_LPTMR3
16+
def_bool $(dt_nodelabel_enabled_with_compat,lptmr3,$(DT_COMPAT_NXP_LPTMR))

soc/nxp/mcx/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
rsource "*/Kconfig"
5+
rsource "../common/Kconfig.peripherals"

0 commit comments

Comments
 (0)