From 1b76aeb3e56141abd36d1455a0edb5d1ff6ef2d2 Mon Sep 17 00:00:00 2001 From: Sumit Batra Date: Sun, 11 May 2025 10:49:16 +0530 Subject: [PATCH 1/3] soc: nxp: Add kw45 SoC support Signed-off-by: Sumit Batra --- soc/nxp/kinetis/kw45/CMakeLists.txt | 22 ++++ soc/nxp/kinetis/kw45/Kconfig | 23 ++++ soc/nxp/kinetis/kw45/Kconfig.defconfig | 53 +++++++++ soc/nxp/kinetis/kw45/Kconfig.soc | 24 ++++ soc/nxp/kinetis/kw45/power.c | 146 +++++++++++++++++++++++++ soc/nxp/kinetis/soc.yml | 3 + west.yml | 2 +- 7 files changed, 272 insertions(+), 1 deletion(-) create mode 100644 soc/nxp/kinetis/kw45/CMakeLists.txt create mode 100644 soc/nxp/kinetis/kw45/Kconfig create mode 100644 soc/nxp/kinetis/kw45/Kconfig.defconfig create mode 100644 soc/nxp/kinetis/kw45/Kconfig.soc create mode 100644 soc/nxp/kinetis/kw45/power.c diff --git a/soc/nxp/kinetis/kw45/CMakeLists.txt b/soc/nxp/kinetis/kw45/CMakeLists.txt new file mode 100644 index 0000000000000..ad53ef89db294 --- /dev/null +++ b/soc/nxp/kinetis/kw45/CMakeLists.txt @@ -0,0 +1,22 @@ +# Copyright 2025 NXP +# +# SPDX-License-Identifier: Apache-2.0 + +zephyr_sources(../../mcx/mcxw/soc.c ../../mcx/mcxw/mcxw71_platform_init.S) + +zephyr_include_directories(../../mcx/mcxw/) + +zephyr_sources_ifdef(CONFIG_NXP_NBU + ../../common/nxp_nbu.c + ) + +zephyr_include_directories(.) + +zephyr_sources_ifdef( + CONFIG_PM + power.c +) + +set(SOC_LINKER_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/../../mcx/mcxw/linker.ld CACHE INTERNAL "") + +zephyr_linker_sources_ifdef(CONFIG_BT RAM_SECTIONS ../../mcx/mcxw/sections.ld) diff --git a/soc/nxp/kinetis/kw45/Kconfig b/soc/nxp/kinetis/kw45/Kconfig new file mode 100644 index 0000000000000..10097397dcdc1 --- /dev/null +++ b/soc/nxp/kinetis/kw45/Kconfig @@ -0,0 +1,23 @@ +# KW45 Series + +# Copyright 2025 NXP +# SPDX-License-Identifier: Apache-2.0 + +config SOC_SERIES_KINETIS_KW45 + select ARM + select CPU_CORTEX_M33 + select CPU_CORTEX_M_HAS_DWT + select HAS_MCUX + select CLOCK_CONTROL + select SOC_RESET_HOOK + select SOC_EARLY_INIT_HOOK + +config SOC_KW45B41Z83 + select ARM_TRUSTZONE_M + select CPU_CORTEX_M_HAS_SYSTICK + select CPU_HAS_FPU + select CPU_HAS_ARM_SAU + select CPU_HAS_ARM_MPU + select ARMV8_M_DSP + + rsource "../../common/Kconfig.nbu" diff --git a/soc/nxp/kinetis/kw45/Kconfig.defconfig b/soc/nxp/kinetis/kw45/Kconfig.defconfig new file mode 100644 index 0000000000000..adf578cd779e7 --- /dev/null +++ b/soc/nxp/kinetis/kw45/Kconfig.defconfig @@ -0,0 +1,53 @@ +# KW45 series configuration options + +# Copyright 2025 NXP +# SPDX-License-Identifier: Apache-2.0 + +if SOC_SERIES_KINETIS_KW45 + +config SYS_CLOCK_HW_CYCLES_PER_SEC + default 96000000 if CORTEX_M_SYSTICK + +config MCUX_FLASH_K4_API + default y + +config WDOG_INIT + default n + +config SOC_SERIES + default "kw45" + +config NUM_IRQS + default 74 + +if BT + +# Include intercore messaging component +config NXP_RF_IMU + default y + +# Set the controller's public identity using NXP vendor command +config BT_HCI_SET_PUBLIC_ADDR + default y + +# HCI RX buffers are received in ISR context. RX messages +# need to be queued and processed by a dedicated thread +config HCI_NXP_RX_THREAD + default y + +endif # BT + +config PM + select COUNTER + +config FLASH + default y if BT + +config BT_BUF_EVT_DISCARDABLE_SIZE + default 84 if BT + +choice LIBC_IMPLEMENTATION + default NEWLIB_LIBC if PM +endchoice + +endif # SOC_SERIES_KINETIS_KW45 diff --git a/soc/nxp/kinetis/kw45/Kconfig.soc b/soc/nxp/kinetis/kw45/Kconfig.soc new file mode 100644 index 0000000000000..dfdd4903d8b60 --- /dev/null +++ b/soc/nxp/kinetis/kw45/Kconfig.soc @@ -0,0 +1,24 @@ +# KW45 Series + +# Copyright 2025 NXP +# SPDX-License-Identifier: Apache-2.0 + +config SOC_SERIES_KINETIS_KW45 + bool + select SOC_FAMILY_KINETIS + +config SOC_SERIES + default "kw45" if SOC_SERIES_KINETIS_KW45 + +config SOC_KW45B41Z83 + bool + select SOC_SERIES_KINETIS_KW45 + +config SOC + default "kw45b41z83" if SOC_KW45B41Z83 + +config SOC_PART_NUMBER_KW45B41Z83AFTA + bool + +config SOC_PART_NUMBER + default "KW45B41Z83AFTA" if SOC_PART_NUMBER_KW45B41Z83AFTA diff --git a/soc/nxp/kinetis/kw45/power.c b/soc/nxp/kinetis/kw45/power.c new file mode 100644 index 0000000000000..2cded3686a0bf --- /dev/null +++ b/soc/nxp/kinetis/kw45/power.c @@ -0,0 +1,146 @@ +/* + * Copyright 2025 NXP + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include +#include +#include +#include + +#include "fsl_pm_core.h" +#include "fsl_pm_board.h" + +#include "fwk_platform_lowpower.h" + +#include +LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL); + +#define LPTMR0_DEV DT_NODELABEL(lptmr0) +const struct device *const counter_dev = DEVICE_DT_GET(LPTMR0_DEV); + +/* TODO: change this line when PowerDown is enabled + * This definition is needed for compilation, but only used on PowerDown + */ +uint32_t m_warmboot_stack_end __section("RetainedMem"); + +/* -------------------------------------------------------------------------- */ +/* Private variables */ +/* -------------------------------------------------------------------------- */ + +static pm_handle_t pm_hdl; +static bool unsupported_state; +static uint8_t lowest_state; + +/* -------------------------------------------------------------------------- */ +/* Public functions */ +/* -------------------------------------------------------------------------- */ + +__weak void pm_state_set(enum pm_state state, uint8_t substate_id) +{ + int32_t timeout_expiry; + struct counter_top_cfg counter_info; + + ARG_UNUSED(substate_id); + + __ASSERT(device_is_ready(counter_dev), "ERROR: Counter is not ready to be used"); + + __disable_irq(); + irq_unlock(0); + + unsupported_state = false; + + switch (state) { + case PM_STATE_SUSPEND_TO_IDLE: + lowest_state = PM_LP_STATE_DEEP_SLEEP; + break; + + default: + LOG_DBG("Unsupported power state %u", state); + unsupported_state = true; + break; + } + + if (!unsupported_state) { + + if (PM_SetConstraints(lowest_state, 0) != 0) { + __ASSERT(0, "ERROR: to set constraint"); + } + + timeout_expiry = z_get_next_timeout_expiry(); + + counter_info.ticks = + counter_us_to_ticks(counter_dev, k_ticks_to_us_floor32(timeout_expiry)); + counter_info.callback = NULL; + counter_info.user_data = NULL; + + counter_set_top_value(counter_dev, &counter_info); + /* Disable systick before going to low power */ + SysTick->CTRL &= ~(SysTick_CTRL_TICKINT_Msk | SysTick_CTRL_ENABLE_Msk); + /* LPTMR (counter) is set to wakeup the system after the requested time */ + if (counter_start(counter_dev) != 0) { + __ASSERT(0, "ERROR: can't start timer to wakeup"); + } + + PM_EnterLowPower(k_ticks_to_us_floor64(timeout_expiry)); + } +} + +/* Handle SOC specific activity after Low Power Mode Exit */ +__weak void pm_state_exit_post_ops(enum pm_state state, uint8_t substate_id) +{ + uint32_t slept_time_ticks; + uint32_t slept_time_us; + + ARG_UNUSED(state); + ARG_UNUSED(substate_id); + + if (!unsupported_state) { + counter_get_value(counter_dev, &slept_time_ticks); + /* Reactivate systick */ + SysTick->CTRL |= (SysTick_CTRL_TICKINT_Msk | SysTick_CTRL_ENABLE_Msk); + + counter_stop(counter_dev); + slept_time_us = counter_ticks_to_us(counter_dev, slept_time_ticks); + /* Announce the time slept to the kernel*/ + sys_clock_announce(k_us_to_ticks_near32(slept_time_us)); + + if (PM_ReleaseConstraints(lowest_state, 0) != 0) { + __ASSERT(0, "ERROR: to release constraint"); + } + } + /* Clear PRIMASK */ + __enable_irq(); +} + +static int kw45_power_init(void) +{ + int ret = 0; + + PM_CreateHandle(&pm_hdl); + PM_EnablePowerManager(true); + + PLATFORM_LowPowerInit(); +#if !defined(CONFIG_BT) + RFMC->CTRL |= RFMC_CTRL_RFMC_RST(0x1U); + RFMC->CTRL &= ~RFMC_CTRL_RFMC_RST_MASK; + + /* NBU was probably in low power before the RFMC reset, so we need to wait for + * the FRO clock to be valid before accessing RF_CMC + */ + while ((RFMC->RF2P4GHZ_STAT & RFMC_RF2P4GHZ_STAT_FRO_CLK_VLD_STAT_MASK) == 0U) { + ; + } + + RF_CMC1->RADIO_LP |= RF_CMC1_RADIO_LP_CK(0x2); + + /* Force low power entry request to the radio domain */ + RFMC->RF2P4GHZ_CTRL |= RFMC_RF2P4GHZ_CTRL_LP_ENTER(0x1U); +#endif + return ret; +} + +SYS_INIT(kw45_power_init, PRE_KERNEL_2, 0); diff --git a/soc/nxp/kinetis/soc.yml b/soc/nxp/kinetis/soc.yml index f308479122f2a..b3610adae33be 100644 --- a/soc/nxp/kinetis/soc.yml +++ b/soc/nxp/kinetis/soc.yml @@ -34,6 +34,9 @@ family: - name: mke15z7 - name: mke17z7 - name: mke17z9 + - name: kw45 + socs: + - name: kw45b41z83 runners: run_once: '--erase': diff --git a/west.yml b/west.yml index feb3a99f34bed..b6830a3ae9730 100644 --- a/west.yml +++ b/west.yml @@ -208,7 +208,7 @@ manifest: groups: - hal - name: hal_nxp - revision: 5e5a498e79347c6b1be9cf6d7e553c5ff96cb379 + revision: pull/502/head path: modules/hal/nxp groups: - hal From c5799eb8225e454df9c4909d10f3b423b7f566a0 Mon Sep 17 00:00:00 2001 From: Sumit Batra Date: Sun, 11 May 2025 10:59:30 +0530 Subject: [PATCH 2/3] boards: nxp: Add kw45b41z-evk board support Signed-off-by: Sumit Batra --- boards/nxp/kw45b41z_evk/Kconfig | 8 + boards/nxp/kw45b41z_evk/Kconfig.defconfig | 11 ++ boards/nxp/kw45b41z_evk/Kconfig.kw45b41z_evk | 6 + boards/nxp/kw45b41z_evk/board.cmake | 6 + boards/nxp/kw45b41z_evk/board.yml | 8 + .../kw45b41z_evk/kw45b41z_evk-pinctrl.dtsi | 62 ++++++++ boards/nxp/kw45b41z_evk/kw45b41z_evk.dts | 150 ++++++++++++++++++ boards/nxp/kw45b41z_evk/kw45b41z_evk.yaml | 20 +++ .../nxp/kw45b41z_evk/kw45b41z_evk_defconfig | 10 ++ samples/bluetooth/beacon/sample.yaml | 1 + .../spi_loopback/boards/kw45b41z_evk.overlay | 18 +++ 11 files changed, 300 insertions(+) create mode 100644 boards/nxp/kw45b41z_evk/Kconfig create mode 100644 boards/nxp/kw45b41z_evk/Kconfig.defconfig create mode 100644 boards/nxp/kw45b41z_evk/Kconfig.kw45b41z_evk create mode 100644 boards/nxp/kw45b41z_evk/board.cmake create mode 100644 boards/nxp/kw45b41z_evk/board.yml create mode 100644 boards/nxp/kw45b41z_evk/kw45b41z_evk-pinctrl.dtsi create mode 100644 boards/nxp/kw45b41z_evk/kw45b41z_evk.dts create mode 100644 boards/nxp/kw45b41z_evk/kw45b41z_evk.yaml create mode 100644 boards/nxp/kw45b41z_evk/kw45b41z_evk_defconfig create mode 100644 tests/drivers/spi/spi_loopback/boards/kw45b41z_evk.overlay diff --git a/boards/nxp/kw45b41z_evk/Kconfig b/boards/nxp/kw45b41z_evk/Kconfig new file mode 100644 index 0000000000000..0d86105aa6ed0 --- /dev/null +++ b/boards/nxp/kw45b41z_evk/Kconfig @@ -0,0 +1,8 @@ +# Copyright 2025 NXP +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_INIT_PRIORITY + int "Board initialization priority" + default 45 + help + Board initialization priority. diff --git a/boards/nxp/kw45b41z_evk/Kconfig.defconfig b/boards/nxp/kw45b41z_evk/Kconfig.defconfig new file mode 100644 index 0000000000000..75e4820145ac5 --- /dev/null +++ b/boards/nxp/kw45b41z_evk/Kconfig.defconfig @@ -0,0 +1,11 @@ +# KW45B41Z-EVK board + +# Copyright 2025 NXP +# SPDX-License-Identifier: Apache-2.0 + +if BOARD_KW45B41Z_EVK + +config BT_DIS_MANUF + default "NXP" + +endif # BOARD_KW45B41Z_EVK diff --git a/boards/nxp/kw45b41z_evk/Kconfig.kw45b41z_evk b/boards/nxp/kw45b41z_evk/Kconfig.kw45b41z_evk new file mode 100644 index 0000000000000..1833941e43a34 --- /dev/null +++ b/boards/nxp/kw45b41z_evk/Kconfig.kw45b41z_evk @@ -0,0 +1,6 @@ +# Copyright 2025 NXP +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_KW45B41Z_EVK + select SOC_KW45B41Z83 + select SOC_PART_NUMBER_KW45B41Z83AFTA diff --git a/boards/nxp/kw45b41z_evk/board.cmake b/boards/nxp/kw45b41z_evk/board.cmake new file mode 100644 index 0000000000000..90010f3dbd54f --- /dev/null +++ b/boards/nxp/kw45b41z_evk/board.cmake @@ -0,0 +1,6 @@ +# Copyright 2025 NXP +# SPDX-License-Identifier: Apache-2.0 + +board_runner_args(jlink "--device=kw45b41z83" "--reset-after-load") + +include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/nxp/kw45b41z_evk/board.yml b/boards/nxp/kw45b41z_evk/board.yml new file mode 100644 index 0000000000000..fefd73dbe885e --- /dev/null +++ b/boards/nxp/kw45b41z_evk/board.yml @@ -0,0 +1,8 @@ +# Copyright 2025 NXP +# SPDX-License-Identifier: Apache-2.0 + +board: + name: kw45b41z_evk + vendor: nxp + socs: + - name: kw45b41z83 diff --git a/boards/nxp/kw45b41z_evk/kw45b41z_evk-pinctrl.dtsi b/boards/nxp/kw45b41z_evk/kw45b41z_evk-pinctrl.dtsi new file mode 100644 index 0000000000000..85dc58cf6067e --- /dev/null +++ b/boards/nxp/kw45b41z_evk/kw45b41z_evk-pinctrl.dtsi @@ -0,0 +1,62 @@ +/* + * Copyright 2025 NXP + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +&pinctrl { + pinmux_lpuart0: pinmux_lpuart0 { + group0 { + pinmux = , ; + drive-strength = "low"; + slew-rate = "fast"; + }; + }; + + pinmux_lpuart1: pinmux_lpuart1 { + group0 { + pinmux = , ; + drive-strength = "low"; + slew-rate = "fast"; + }; + }; + + pinmux_tpm0: pinmux_tpm0 { + group0 { + pinmux = , + , + ; + drive-strength = "low"; + slew-rate = "fast"; + }; + }; + + pinmux_lpi2c1: pinmux_lpi2c1 { + group0 { + pinmux = , + ; + drive-strength = "low"; + slew-rate = "fast"; + bias-pull-up; + }; + }; + + pinmux_lpspi1: pinmux_lpspi1 { + group0 { + pinmux = , + ; + slew-rate = "fast"; + drive-strength = "low"; + }; + }; + + pinmux_flexcan: pinmux_flexcan { + group0 { + pinmux = , ; + slew-rate = "slow"; + drive-strength = "low"; + }; + }; + +}; diff --git a/boards/nxp/kw45b41z_evk/kw45b41z_evk.dts b/boards/nxp/kw45b41z_evk/kw45b41z_evk.dts new file mode 100644 index 0000000000000..55f9f13eec375 --- /dev/null +++ b/boards/nxp/kw45b41z_evk/kw45b41z_evk.dts @@ -0,0 +1,150 @@ +/* + * Copyright 2025 NXP + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include "kw45b41z_evk-pinctrl.dtsi" + +/ { + model = "NXP KW45B41Z83-EVK board"; + compatible = "nxp,kw45"; + + aliases { + led0 = &blue_led; + blue-pwm-led = &blue_pwm_led; + green-pwm-led = &green_pwm_led; + red-pwm-led = &red_pwm_led; + }; + + chosen { + zephyr,flash = &flash; + zephyr,flash-controller = &fmu; + zephyr,code-partition = &slot0_partition; + zephyr,sram = &stcm0; + zephyr,console = &lpuart1; + zephyr,shell-uart = &lpuart1; + zephyr,uart-pipe = &lpuart0; + zephyr,canbus = &flexcan0; + }; + + leds { + compatible = "gpio-leds"; + blue_led: led { + gpios = <&gpiob 0 GPIO_ACTIVE_LOW>; + }; + }; + + pwmleds { + compatible = "pwm-leds"; + blue_pwm_led: pwm_led_0 { + pwms = <&tpm0 1 PWM_USEC(200) PWM_POLARITY_NORMAL>; + }; + green_pwm_led: pwm_led_1 { + pwms = <&tpm0 2 PWM_USEC(200) PWM_POLARITY_NORMAL>; + }; + red_pwm_led: pwm_led_2 { + pwms = <&tpm0 0 PWM_USEC(200) PWM_POLARITY_NORMAL>; + }; + }; +}; + +&vref { + status = "okay"; +}; + +&gpiob { + status = "okay"; +}; + +&lpuart0 { + current-speed = <115200>; + status = "okay"; + pinctrl-0 = <&pinmux_lpuart0>; + pinctrl-names = "default"; +}; + +&lpuart1 { + current-speed = <115200>; + status = "okay"; + pinctrl-0 = <&pinmux_lpuart1>; + pinctrl-names = "default"; +}; + +&lpi2c1 { + status = "okay"; + pinctrl-0 = <&pinmux_lpi2c1>; + pinctrl-names = "default"; +}; + +&lpspi1 { + status = "okay"; + pinctrl-0 = <&pinmux_lpspi1>; + pinctrl-names = "default"; +}; + +&flexcan0 { + status = "okay"; + bitrate = <125000>; + pinctrl-0 = <&pinmux_flexcan>; + pinctrl-names = "default"; + + can-transceiver { + max-bitrate = <420000000>; + }; +}; + +&flash { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + reg = <0x0 DT_SIZE_K(64)>; + }; + + slot0_partition: partition@10000 { + reg = <0x10000 DT_SIZE_K(416)>; + }; + + slot1_partition: partition@78000 { + reg = <0x78000 DT_SIZE_K(416)>; + }; + + storage_partition: partition@e0000 { + reg = <0xe0000 DT_SIZE_K(128)>; + }; + }; +}; + +&fmu { + status = "okay"; +}; + +&tpm0 { + status = "okay"; + pinctrl-0 = <&pinmux_tpm0>; + pinctrl-names = "default"; +}; + +&lptmr0 { + status = "okay"; +}; + +&flexcan0 { + status = "okay"; + pinctrl-0 = <&pinmux_flexcan>; + pinctrl-names = "default"; + + can-transceiver { + max-bitrate = <5000000>; + }; +}; + +&nbu { + status = "okay"; + wakeup-source; +}; diff --git a/boards/nxp/kw45b41z_evk/kw45b41z_evk.yaml b/boards/nxp/kw45b41z_evk/kw45b41z_evk.yaml new file mode 100644 index 0000000000000..2431b9df383a6 --- /dev/null +++ b/boards/nxp/kw45b41z_evk/kw45b41z_evk.yaml @@ -0,0 +1,20 @@ +# Copyright 2025 NXP +# SPDX-License-Identifier: Apache-2.0 + +identifier: kw45b41z_evk +name: NXP KW45B41Z-EVK +type: mcu +arch: arm +ram: 64 +flash: 1024 +toolchain: + - zephyr + - gnuarmemb + - xtools +supported: + - can + - gpio + - spi + - watchdog + - i2c +vendor: nxp diff --git a/boards/nxp/kw45b41z_evk/kw45b41z_evk_defconfig b/boards/nxp/kw45b41z_evk/kw45b41z_evk_defconfig new file mode 100644 index 0000000000000..f40f84081f02a --- /dev/null +++ b/boards/nxp/kw45b41z_evk/kw45b41z_evk_defconfig @@ -0,0 +1,10 @@ +# Copyright 2025 NXP +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_ARM_MPU=y +CONFIG_TRUSTED_EXECUTION_SECURE=y +CONFIG_PINCTRL=y +CONFIG_SERIAL=y +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y +CONFIG_GPIO=y diff --git a/samples/bluetooth/beacon/sample.yaml b/samples/bluetooth/beacon/sample.yaml index f6f08790092fb..f201d3c3bde75 100644 --- a/samples/bluetooth/beacon/sample.yaml +++ b/samples/bluetooth/beacon/sample.yaml @@ -10,6 +10,7 @@ tests: - nrf52dk/nrf52832 - nrf54l15dk/nrf54l15/cpuapp - ophelia4ev/nrf54l15/cpuapp + - kw45b41z_evk tags: bluetooth integration_platforms: - qemu_cortex_m3 diff --git a/tests/drivers/spi/spi_loopback/boards/kw45b41z_evk.overlay b/tests/drivers/spi/spi_loopback/boards/kw45b41z_evk.overlay new file mode 100644 index 0000000000000..baa1ce3c6ed86 --- /dev/null +++ b/tests/drivers/spi/spi_loopback/boards/kw45b41z_evk.overlay @@ -0,0 +1,18 @@ +/* + * Copyright 2024 NXP + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&lpspi1 { + slow@0 { + compatible = "test-spi-loopback-slow"; + reg = <0>; + spi-max-frequency = <500000>; + }; + fast@0 { + compatible = "test-spi-loopback-fast"; + reg = <0>; + spi-max-frequency = <16000000>; + }; +}; From b9385a7dcdd36ea2d52acd16bc728f708902ee2e Mon Sep 17 00:00:00 2001 From: Sumit Batra Date: Sun, 11 May 2025 11:09:44 +0530 Subject: [PATCH 3/3] hal_nxp: drivers: NXP HAL drivers support for KW45 SoC Signed-off-by: Sumit Batra --- .../mcux/mcux-sdk-ng/components/components.cmake | 2 +- modules/hal_nxp/mcux/mcux-sdk-ng/drivers/drivers.cmake | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/hal_nxp/mcux/mcux-sdk-ng/components/components.cmake b/modules/hal_nxp/mcux/mcux-sdk-ng/components/components.cmake index 8e2b4c105ec54..0477c3978b6ca 100644 --- a/modules/hal_nxp/mcux/mcux-sdk-ng/components/components.cmake +++ b/modules/hal_nxp/mcux/mcux-sdk-ng/components/components.cmake @@ -30,7 +30,7 @@ if(CONFIG_NXP_RF_IMU) set(CONFIG_MCUX_COMPONENT_driver.gdma ON) set(CONFIG_MCUX_COMPONENT_component.wireless_imu_adapter ON) set(CONFIG_MCUX_PRJSEG_component.osa_interface.osa_macro_used ON) - elseif(CONFIG_SOC_SERIES_MCXW) + elseif(CONFIG_SOC_SERIES_MCXW OR CONFIG_SOC_SERIES_KINETIS_KW45) set(CONFIG_MCUX_COMPONENT_component.lists ON) set(CONFIG_MCUX_COMPONENT_component.rpmsg_adapter ON) zephyr_compile_definitions(HAL_RPMSG_SELECT_ROLE=0U) diff --git a/modules/hal_nxp/mcux/mcux-sdk-ng/drivers/drivers.cmake b/modules/hal_nxp/mcux/mcux-sdk-ng/drivers/drivers.cmake index 98a7365ec6bc7..df4a5b8dab778 100644 --- a/modules/hal_nxp/mcux/mcux-sdk-ng/drivers/drivers.cmake +++ b/modules/hal_nxp/mcux/mcux-sdk-ng/drivers/drivers.cmake @@ -147,6 +147,7 @@ set_variable_ifdef(CONFIG_SOC_SERIES_IMXRT10XX CONFIG_MCUX_COMPONENT_driver.o set_variable_ifdef(CONFIG_SOC_SERIES_IMXRT11XX CONFIG_MCUX_COMPONENT_driver.ocotp) set_variable_ifdef(CONFIG_SOC_FAMILY_KINETIS CONFIG_MCUX_COMPONENT_driver.port) set_variable_ifdef(CONFIG_SOC_SERIES_MCXW CONFIG_MCUX_COMPONENT_driver.ccm32k) +set_variable_ifdef(CONFIG_SOC_SERIES_KINETIS_KW45 CONFIG_MCUX_COMPONENT_driver.ccm32k) set_variable_ifdef(CONFIG_SOC_SERIES_IMXRT5XX CONFIG_MCUX_COMPONENT_driver.iap3) if(CONFIG_SOC_MIMXRT1189) @@ -162,7 +163,8 @@ if(CONFIG_SOC_SERIES_MCXN OR CONFIG_SOC_SERIES_MCXA) set(CONFIG_MCUX_COMPONENT_driver.mcx_spc ON) endif() -if(CONFIG_BT_NXP AND CONFIG_SOC_SERIES_MCXW OR CONFIG_IEEE802154_MCXW) +if(CONFIG_BT_NXP AND CONFIG_SOC_SERIES_MCXW OR CONFIG_IEEE802154_MCXW OR + CONFIG_SOC_SERIES_KINETIS_KW45) set(CONFIG_MCUX_COMPONENT_driver.spc ON) endif() @@ -185,7 +187,11 @@ else() endif() if(CONFIG_SOC_FAMILY_KINETIS OR CONFIG_SOC_SERIES_MCXC) - set_variable_ifdef(CONFIG_SOC_FLASH_MCUX CONFIG_MCUX_COMPONENT_driver.flash) + if(CONFIG_SOC_SERIES_KINETIS_KW45) + set_variable_ifdef(CONFIG_SOC_FLASH_MCUX CONFIG_MCUX_COMPONENT_driver.flash_k4) + else() + set_variable_ifdef(CONFIG_SOC_FLASH_MCUX CONFIG_MCUX_COMPONENT_driver.flash) + endif() endif() if(CONFIG_SOC_MK82F25615 OR CONFIG_SOC_MK64F12 OR CONFIG_SOC_MK66F18 OR