From c35b81faa1dcace4d6d3959973992f3c24ed8199 Mon Sep 17 00:00:00 2001 From: Nirav Agrawal Date: Wed, 12 Mar 2025 16:21:39 +0530 Subject: [PATCH 1/3] west: update dependent hal_nxp PR - Current PR is dependent on nxp_hal PR, so updating manifest. Signed-off-by: Nirav Agrawal --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 4ae20b9895bc..f1c8b3273b44 100644 --- a/west.yml +++ b/west.yml @@ -203,7 +203,7 @@ manifest: groups: - hal - name: hal_nxp - revision: 6b11d190e0092aafec81489d0e7045a3bcf80c60 + revision: 601e1e538abaf9f5985e28531b3b6a2a07e38d2a path: modules/hal/nxp groups: - hal From f9a2b6e6b7c65953cb5bddb559b53464cf121e8e Mon Sep 17 00:00:00 2001 From: Nirav Agrawal Date: Wed, 12 Feb 2025 13:20:48 +0530 Subject: [PATCH 2/3] drivers: bluetooth: hci: add IW416 BT Controller Support Added IW416 SoC support to enable Bluetooth HCI driver perform firmware load, and works with blueooth HCI interface. Removed cmake file from bt_controller/, added support in hal_nxp module to fetch firmware blobs for iW416/nw612 BT Only FW. Signed-off-by: Nirav Agrawal --- drivers/bluetooth/hci/Kconfig.nxp | 14 ++++++++--- drivers/bluetooth/hci/hci_nxp_setup.c | 7 +++--- .../middleware/bt_controller/CMakeLists.txt | 25 ------------------- .../middleware/bt_controller/src/no_blobs.h | 14 ----------- .../mcux-sdk-ng/middleware/middleware.cmake | 2 -- 5 files changed, 15 insertions(+), 47 deletions(-) delete mode 100644 modules/hal_nxp/mcux/mcux-sdk-ng/middleware/bt_controller/CMakeLists.txt delete mode 100644 modules/hal_nxp/mcux/mcux-sdk-ng/middleware/bt_controller/src/no_blobs.h diff --git a/drivers/bluetooth/hci/Kconfig.nxp b/drivers/bluetooth/hci/Kconfig.nxp index d5f72a0d7208..1f6983ee9894 100644 --- a/drivers/bluetooth/hci/Kconfig.nxp +++ b/drivers/bluetooth/hci/Kconfig.nxp @@ -1,5 +1,5 @@ # -# Copyright 2023-2024 NXP +# Copyright 2023-2025 NXP # # SPDX-License-Identifier: Apache-2.0 # @@ -80,15 +80,23 @@ choice BT_NXP_MODULE config BT_NXP_NW612 bool "NW612 firmware for NXP IW612 Chipset" help - NXP IW612 Chipset supports Wi-Fi? 802.11a/b/g/n/ac/ax + Bluetooth? 5.3 + NXP IW612 Chipset supports Wi-Fi? 802.11a/b/g/n/ac/ax + Bluetooth? 5.4 BR/EDR/LE + IEEE802.1.5.4 up to 601 Mbps data rate on Wi-Fi? and 2Mbps data rate on Bluetooth?. 4-wire UART@3M baud is supported. PCM for audio is also supported. - Details of the module could be fond on https://www.nxp.com/products/ + Details of the module could be found on https://www.nxp.com/products/ wireless-connectivity/wi-fi-plus-bluetooth-plus-802-15-4/2-4-5-ghz- dual-band-1x1-wi-fi-6-802-11ax-plus-bluetooth-5-4-plus-802-15-4-tri- radio-solution:IW612. +config BT_NXP_IW416 + bool "NXP IW416 Chipset" + help + NXP IW416 Chipset supports Wi-Fi4 + Bluetooth5.2 + Details of the module could be found on https://www.nxp.com/products/ + wireless-connectivity/wi-fi-plus-bluetooth-plus-802-15-4/2-4-5-ghz- + dual-band-1x1-wi-fi-4-802-11n-plus-bluetooth-5-2-solution:IW416. + endchoice # BT_NXP_MODULE endif # BT_H4_NXP_CTLR diff --git a/drivers/bluetooth/hci/hci_nxp_setup.c b/drivers/bluetooth/hci/hci_nxp_setup.c index 6bd0e5d5764c..6fa34d0a24eb 100644 --- a/drivers/bluetooth/hci/hci_nxp_setup.c +++ b/drivers/bluetooth/hci/hci_nxp_setup.c @@ -1,5 +1,5 @@ /* - * Copyright 2024 NXP + * Copyright 2024-2025 NXP * * SPDX-License-Identifier: Apache-2.0 */ @@ -27,12 +27,13 @@ LOG_MODULE_REGISTER(bt_nxp_ctlr); #include "common/bt_str.h" -#include "bt_nxp_ctlr_fw.h" - #define DT_DRV_COMPAT nxp_bt_hci_uart #define FW_UPLOAD_CHANGE_TIMEOUT_RETRY_COUNT 6 +extern const unsigned char *bt_fw_bin; +extern const unsigned int bt_fw_bin_len; + static const struct device *uart_dev = DEVICE_DT_GET(DT_INST_GPARENT(0)); #if DT_NODE_HAS_PROP(DT_DRV_INST(0), sdio_reset_gpios) diff --git a/modules/hal_nxp/mcux/mcux-sdk-ng/middleware/bt_controller/CMakeLists.txt b/modules/hal_nxp/mcux/mcux-sdk-ng/middleware/bt_controller/CMakeLists.txt deleted file mode 100644 index 9d17f2d353df..000000000000 --- a/modules/hal_nxp/mcux/mcux-sdk-ng/middleware/bt_controller/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -# -# Copyright 2024-2025 NXP -# -# SPDX-License-Identifier: Apache-2.0 -# - -set(hal_nxp_dir ${ZEPHYR_HAL_NXP_MODULE_DIR}) -set(hal_nxp_blobs_dir ${hal_nxp_dir}/zephyr/blobs) -set(blob_gen_file ${ZEPHYR_BINARY_DIR}/include/generated/bt_nxp_ctlr_fw.h) - -if(CONFIG_BUILD_ONLY_NO_BLOBS) - set(blob_file src/no_blobs.h) -elseif(CONFIG_BT_NXP_NW612) - set(blob_file ${hal_nxp_blobs_dir}/iw612/uart_nw61x_se.h) -endif() - -if (NOT DEFINED blob_file) - message(FATAL_ERROR "Unsupported controller. Please select a BT conntroller, refer to ./driver/bluetooth/hci/Kconfig.nxp") -endif() - -if(NOT CONFIG_BUILD_ONLY_NO_BLOBS) - zephyr_blobs_verify(FILES ${blob_file} REQUIRED) -endif() - -configure_file(${blob_file} ${blob_gen_file} COPYONLY) diff --git a/modules/hal_nxp/mcux/mcux-sdk-ng/middleware/bt_controller/src/no_blobs.h b/modules/hal_nxp/mcux/mcux-sdk-ng/middleware/bt_controller/src/no_blobs.h deleted file mode 100644 index 361d7420b871..000000000000 --- a/modules/hal_nxp/mcux/mcux-sdk-ng/middleware/bt_controller/src/no_blobs.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright 2024 NXP - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef __UART_BT_FW_H__ -#define __UART_BT_FW_H__ - - -const unsigned char *bt_fw_bin; -unsigned int bt_fw_bin_len; - -#endif /* __UART_BT_FW_H__ */ diff --git a/modules/hal_nxp/mcux/mcux-sdk-ng/middleware/middleware.cmake b/modules/hal_nxp/mcux/mcux-sdk-ng/middleware/middleware.cmake index 37b0b479abde..f30bcd65a2d3 100644 --- a/modules/hal_nxp/mcux/mcux-sdk-ng/middleware/middleware.cmake +++ b/modules/hal_nxp/mcux/mcux-sdk-ng/middleware/middleware.cmake @@ -39,5 +39,3 @@ endif() add_subdirectory(${MCUX_SDK_NG_DIR}/middleware/usb ${CMAKE_CURRENT_BINARY_DIR}/usb ) - -add_subdirectory_ifdef(CONFIG_BT_H4_NXP_CTLR ${CMAKE_CURRENT_LIST_DIR}/bt_controller) From 16041085151ce45193a2210c5a0a5a8c5aa1991c Mon Sep 17 00:00:00 2001 From: Nirav Agrawal Date: Wed, 12 Feb 2025 13:20:50 +0530 Subject: [PATCH 3/3] boards: shields: add nxp_m2_wifi_bt shield - Added new shield to add support for WIFI and BT interface. - Added board overlay for MIMXRT1060EVKC. - Removed mimxrt1062 overlay from shell example to avoid conflicts. - Added seperate shield overlay for supported M.2 module to enable BT or WIFI or Both. - Added default kconfigs for each BT and WIFI which enables supported modules and SoC as part of enabled shield through build param. - Added shield document. Signed-off-by: Nirav Agrawal --- boards/nxp/mimxrt1060_evk/doc/index.rst | 12 +++ boards/nxp/mimxrt1060_evk/mimxrt1060_evk.dtsi | 6 +- .../shields/nxp_m2_wifi_bt/Kconfig.defconfig | 91 +++++++++++++++++++ boards/shields/nxp_m2_wifi_bt/Kconfig.shield | 8 ++ .../mimxrt1060_evk_mimxrt1062_qspi_C.overlay | 90 ++++++++++++++++++ boards/shields/nxp_m2_wifi_bt/doc/index.rst | 62 +++++++++++++ .../nxp_m2_wifi_bt/nxp_m2_1xk_wifi_bt.overlay | 37 ++++++++ .../nxp_m2_wifi_bt/nxp_m2_2el_wifi_bt.overlay | 37 ++++++++ .../mimxrt1060_evk_mimxrt1062_qspi.overlay | 22 ----- .../mimxrt1060_evk_mimxrt1062_qspi_C.overlay | 22 ----- 10 files changed, 342 insertions(+), 45 deletions(-) create mode 100644 boards/shields/nxp_m2_wifi_bt/Kconfig.defconfig create mode 100644 boards/shields/nxp_m2_wifi_bt/Kconfig.shield create mode 100644 boards/shields/nxp_m2_wifi_bt/boards/mimxrt1060_evk_mimxrt1062_qspi_C.overlay create mode 100644 boards/shields/nxp_m2_wifi_bt/doc/index.rst create mode 100644 boards/shields/nxp_m2_wifi_bt/nxp_m2_1xk_wifi_bt.overlay create mode 100644 boards/shields/nxp_m2_wifi_bt/nxp_m2_2el_wifi_bt.overlay delete mode 100644 tests/bluetooth/shell/boards/mimxrt1060_evk_mimxrt1062_qspi.overlay delete mode 100644 tests/bluetooth/shell/boards/mimxrt1060_evk_mimxrt1062_qspi_C.overlay diff --git a/boards/nxp/mimxrt1060_evk/doc/index.rst b/boards/nxp/mimxrt1060_evk/doc/index.rst index 3f2265cb6a9b..d2a04b184210 100644 --- a/boards/nxp/mimxrt1060_evk/doc/index.rst +++ b/boards/nxp/mimxrt1060_evk/doc/index.rst @@ -137,6 +137,10 @@ The MIMXRT1060 SoC has five pairs of pinmux/gpio controllers. +---------------+-----------------+---------------------------+ | GPIO_AD_B1_01 | LPI2C1_SDA | I2C | +---------------+-----------------+---------------------------+ +| GPIO_AD_B1_04 | LPUART3_CTS | UART BT HCI | ++---------------+-----------------+---------------------------+ +| GPIO_AD_B1_05 | LPUART3_RTS | UART BT HCI | ++---------------+-----------------+---------------------------+ | GPIO_AD_B1_06 | LPUART3_TX | UART BT HCI | +---------------+-----------------+---------------------------+ | GPIO_AD_B1_07 | LPUART3_RX | UART BT HCI | @@ -428,6 +432,14 @@ should see the following message in the terminal: ***** Booting Zephyr OS v1.14.0-rc1 ***** Hello World! mimxrt1060_evk//qspi +Shield for M.2 Wi-Fi and BT Interface +===================================== + +Rev C version is tested with :ref:`nxp_m2_wifi_bt` shield to attach any M.2 module +with BT HCI UART interface and Wi-Fi SDIO interface. The shield binds the required NXP +HCI driver or SDIO driver to perform firmware-load and other setup configurations +for NXP SoC IW416/IW612. + Troubleshooting =============== diff --git a/boards/nxp/mimxrt1060_evk/mimxrt1060_evk.dtsi b/boards/nxp/mimxrt1060_evk/mimxrt1060_evk.dtsi index 2a26160c2a25..c9b7edc56674 100644 --- a/boards/nxp/mimxrt1060_evk/mimxrt1060_evk.dtsi +++ b/boards/nxp/mimxrt1060_evk/mimxrt1060_evk.dtsi @@ -1,5 +1,5 @@ /* - * Copyright 2018,2024 NXP + * Copyright 2018,2024-2025 NXP * * SPDX-License-Identifier: Apache-2.0 */ @@ -308,3 +308,7 @@ arduino_spi: &lpspi1 { dvp_fpc24_i2c: &lpi2c1 {}; dvp_fpc24_interface: &csi {}; + +m2_hci_bt_uart: &lpuart3 {}; + +m2_wifi_sdio: &usdhc1 {}; diff --git a/boards/shields/nxp_m2_wifi_bt/Kconfig.defconfig b/boards/shields/nxp_m2_wifi_bt/Kconfig.defconfig new file mode 100644 index 000000000000..79692b8f2e2a --- /dev/null +++ b/boards/shields/nxp_m2_wifi_bt/Kconfig.defconfig @@ -0,0 +1,91 @@ +# Copyright 2025 NXP +# SPDX-License-Identifier: Apache-2.0 + +if SHIELD_NXP_M2_1XK_WIFI_BT + +if BT + +choice BT_NXP_MODULE + default BT_NXP_IW416 +endchoice + +endif # BT + +if WIFI + +config WIFI_NXP + default y + +choice NXP_WIFI_PART + default NXP_IW416 +endchoice + +choice NXP_IW416_MODULE + default NXP_IW416_MURATA_1XK_M2 +endchoice + +endif # WIFI + +endif # SHIELD_NXP_M2_1XK_WIFI_BT + +if SHIELD_NXP_M2_2EL_WIFI_BT + +if BT + +choice BT_NXP_MODULE + default BT_NXP_NW612 +endchoice + +endif # BT + +if WIFI + +config WIFI_NXP + default y + +choice NXP_WIFI_PART + default NXP_IW61X +endchoice + +choice NXP_IW61X_MODULE + default NXP_IW612_MURATA_2EL_M2 +endchoice + +endif # WIFI + +endif # SHIELD_NXP_M2_2EL_WIFI_BT + +if (BT_NXP_IW416) || (BT_NXP_NW612) || (NXP_IW416) || (NXP_IW61X) + +if BT + +config SYSTEM_WORKQUEUE_STACK_SIZE + default 2048 + +config BT_LONG_WQ_STACK_SIZE + default 2560 + +config MAIN_STACK_SIZE + default 2560 + +if SHELL + +config SHELL_STACK_SIZE + default 4096 + +endif # SHELL + +endif # BT + +if WIFI_NXP + +if SHELL + +config NXP_WIFI_SHELL + default y + +endif # SHELL + +endif # WIFI_NXP + +endif diff --git a/boards/shields/nxp_m2_wifi_bt/Kconfig.shield b/boards/shields/nxp_m2_wifi_bt/Kconfig.shield new file mode 100644 index 000000000000..d61c97955ef9 --- /dev/null +++ b/boards/shields/nxp_m2_wifi_bt/Kconfig.shield @@ -0,0 +1,8 @@ +# Copyright 2025 NXP +# SPDX-License-Identifier: Apache-2.0 + +config SHIELD_NXP_M2_1XK_WIFI_BT + def_bool $(shields_list_contains,nxp_m2_1xk_wifi_bt) + +config SHIELD_NXP_M2_2EL_WIFI_BT + def_bool $(shields_list_contains,nxp_m2_2el_wifi_bt) diff --git a/boards/shields/nxp_m2_wifi_bt/boards/mimxrt1060_evk_mimxrt1062_qspi_C.overlay b/boards/shields/nxp_m2_wifi_bt/boards/mimxrt1060_evk_mimxrt1062_qspi_C.overlay new file mode 100644 index 000000000000..3c9276102f2f --- /dev/null +++ b/boards/shields/nxp_m2_wifi_bt/boards/mimxrt1060_evk_mimxrt1062_qspi_C.overlay @@ -0,0 +1,90 @@ +/* + * Copyright 2025 NXP + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + chosen { + zephyr,uart-pipe = &lpuart1; + }; +}; + +&m2_hci_bt_uart { + /delete-property/ pinctrl-0; + /delete-property/ pinctrl-1; + /delete-property/ pinctrl-2; + /delete-property/ pinctrl-names; + pinctrl-0 = <&pinmux_lpuart3_flow_control>; + pinctrl-1 = <&pinmux_lpuart3_sleep>; + pinctrl-names = "default", "sleep"; + + bt_hci_uart: bt_hci_uart { + m2_bt_module: m2_bt_module { + sdio-reset-gpios = <&gpio1 24 GPIO_ACTIVE_HIGH>; + w-disable-gpios = <&gpio1 19 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&m2_wifi_sdio { + /* Use dat3 detection method */ + detect-dat3; + pinctrl-4 = <&pinmux_usdhc1_dat3_nopull>; + pinctrl-names = "default", "slow", "med", "fast", "nopull"; +}; + +&pinctrl { + /* removes pull on dat3 for card detect */ + pinmux_usdhc1_dat3_nopull: pinmux_usdhc1_dat3_nopull { + + group0 { + pinmux = <&iomuxc_gpio_sd_b0_01_usdhc1_clk>; + bias-disable; + drive-strength = "r0"; + input-schmitt-enable; + slew-rate = "fast"; + nxp,speed = "100-mhz"; + }; + + group1 { + pinmux = <&iomuxc_gpio_b1_12_gpio2_io28>, + <&iomuxc_gpio_sd_b0_00_usdhc1_cmd>, + <&iomuxc_gpio_sd_b0_02_usdhc1_data0>, + <&iomuxc_gpio_sd_b0_03_usdhc1_data1>, + <&iomuxc_gpio_sd_b0_04_usdhc1_data2>; + drive-strength = "r0"; + input-schmitt-enable; + bias-pull-up; + bias-pull-up-value = "47k"; + slew-rate = "fast"; + nxp,speed = "100-mhz"; + }; + + group2 { + pinmux = <&iomuxc_gpio_b1_14_usdhc1_vselect>; + drive-strength = "r0-4"; + input-schmitt-enable; + bias-pull-up; + bias-pull-up-value = "47k"; + slew-rate = "fast"; + nxp,speed = "100-mhz"; + }; + + group3 { + pinmux = <&iomuxc_gpio_ad_b0_05_gpio1_io05>; + drive-strength = "r0-6"; + slew-rate = "slow"; + nxp,speed = "100-mhz"; + }; + + group4 { + pinmux = <&iomuxc_gpio_sd_b0_05_usdhc1_data3>; + bias-disable; + drive-strength = "r0"; + slew-rate = "fast"; + nxp,speed = "100-mhz"; + input-schmitt-enable; + }; + }; +}; diff --git a/boards/shields/nxp_m2_wifi_bt/doc/index.rst b/boards/shields/nxp_m2_wifi_bt/doc/index.rst new file mode 100644 index 000000000000..eaf57ac01e53 --- /dev/null +++ b/boards/shields/nxp_m2_wifi_bt/doc/index.rst @@ -0,0 +1,62 @@ +.. _nxp_m2_wifi_bt: + +NXP M.2 Wi-Fi and BT Shield +########################### + +Overview +******** + +This Zephyr shield is tested with the following M.2 modules and hardware for Wi-Fi and Bluetooth applications: + +- Embedded Artist 1XK module - uses Murata 1XK radio module with NXP IW416 chipset +- Embedded Artist 2EL module - uses Murata 2EL radio module with NXP IW612 chipset + +More information about supported chipsets, radio modules and M.2 modules can be found in below links, + +- `IW612 NXP Chipset `_ +- `IW416 NXP Chipset `_ +- `2EL Murata Radio Module `_ +- `1XK Murata Radio Module `_ +- `1XK Embedded Artist Module `_ +- `2EL Embedded Artist Module `_ + +Requirements +************ + +To use the shield, below requirements needs to be satisfied. + +- M.2 module with BT HCI UART and SDIO Interface with NXP IW416 or IW612 SoC support. +- Host platform shall have compatible M.2 interface slot. +- For Coex (Wi-Fi + BT), UART driver that supports UART RTS line control to wakeup BT CPU from sleep. +- To use default Bluetooth-Shell app it needs ~490KB flash & ~130KB RAM memory. +- To use default Wi-Fi-Shell app it needs ~1MB flash & ~1.2MB RAM memory. + +Integration Platform +******************** + +This shield works with below host platform, + +- :zephyr:board:`mimxrt1060_evk` Rev-C. + +Programming +*********** + +Below are the supported shields to be used with ``--shield