driver: bluetooth: hci: Add NXP BT module support

Implement UART firmware download driver for NXP
BT module.

Only support Murata 2EL M.2 module on RT1170EVKB.

And only one instance can be supported now.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
This commit is contained in:
Lyle Zhu 2024-06-12 13:57:14 +08:00 committed by Anas Nashif
commit d164f9c0bb
7 changed files with 1324 additions and 1 deletions

View file

@ -69,6 +69,7 @@ Hardware
- Expansion port
- Arduino interface
- M.2 WIFI/BT interface
- CAN bus connector
@ -172,6 +173,8 @@ RT1170 EVKB (`mimxrt1170_evk@B//cm7/cm4`)
| VIDEO | on-chip | CSI; MIPI CSI-2 Rx. Tested with | Supported (M7) | Supported (M7) |
| | | :ref:`nxp_btb44_ov5640` shield | | |
+-----------+------------+-------------------------------------+-----------------+-----------------+
| UART | NXP NW61x | M.2 WIFI/BT module | Unsupported | Supported (M7) |
+-----------+------------+-------------------------------------+-----------------+-----------------+
The default configuration can be found in the defconfig files:
:zephyr_file:`boards/nxp/mimxrt1170_evk/mimxrt1170_evk_mimxrt1176_cm7_defconfig`
@ -247,6 +250,14 @@ The MIMXRT1170 SoC has six pairs of pinmux/gpio controllers.
+---------------------------+----------------+------------------+
| GPIO_AD_20_SAI1_RX_DATA00 | SAI1_RX_DATA00 | SAI |
+---------------------------+----------------+------------------+
| GPIO_DISP_B2_10 | LPUART2_TX | M.2 BT HCI |
+---------------------------+----------------+------------------+
| GPIO_DISP_B2_11 | LPUART2_RX | M.2 BT HCI |
+---------------------------+----------------+------------------+
| GPIO_DISP_B2_12 | LPUART2_CTS_B | M.2 BT HCI |
+---------------------------+----------------+------------------+
| GPIO_DISP_B2_13 | LPUART1_RTS_B | M.2 BT HCI |
+---------------------------+----------------+------------------+
Dual Core samples
*****************
@ -291,7 +302,8 @@ cost of reduced resolution
Serial Port
===========
The MIMXRT1170 SoC has 12 UARTs. One is configured for the console and the
The MIMXRT1170 SoC has 12 UARTs. ``LPUART1`` is configured for the console,
``LPUART2`` for the Bluetooth Host Controller Interface (BT HCI), and the
remaining are not used.
Programming and Debugging

View file

@ -290,6 +290,17 @@
};
};
pinmux_lpuart2_flowcontrol: pinmux_lpuart2_flowcontrol {
group0 {
pinmux = <&iomuxc_gpio_disp_b2_11_lpuart2_rx>,
<&iomuxc_gpio_disp_b2_10_lpuart2_tx>,
<&iomuxc_gpio_disp_b2_12_lpuart2_cts_b>,
<&iomuxc_gpio_disp_b2_13_lpuart2_rts_b>;
drive-strength = "high";
slew-rate = "fast";
};
};
pinmux_sai1: pinmux_sai1 {
group0 {
pinmux = <&iomuxc_gpio_ad_17_sai1_mclk>,

View file

@ -10,6 +10,7 @@
zephyr,flash-controller = &w25q512nw;
zephyr,flash = &w25q512nw;
zephyr,code-partition = &slot0_partition;
zephyr,bt-hci = &bt_hci_uart;
};
aliases {
@ -75,3 +76,29 @@
status = "okay";
};
};
m2_hci_uart: &lpuart2 {
pinctrl-0 = <&pinmux_lpuart2_flowcontrol>;
pinctrl-1 = <&pinmux_lpuart2_sleep>;
pinctrl-names = "default", "sleep";
bt_hci_uart: bt_hci_uart {
compatible = "zephyr,bt-hci-uart";
m2_bt_module {
compatible = "nxp,bt-hci-uart";
sdio-reset-gpios = <&gpio9 15 GPIO_ACTIVE_HIGH>;
w-disable-gpios = <&gpio9 30 GPIO_ACTIVE_HIGH>;
hci-operation-speed = <115200>;
hw-flow-control;
fw-download-primary-speed = <115200>;
fw-download-secondary-speed = <3000000>;
fw-download-secondary-flowcontrol;
};
};
};
&m2_hci_uart {
status = "okay";
current-speed = <115200>;
};

View file

@ -34,3 +34,4 @@ zephyr_library_sources_ifdef(CONFIG_SOC_NRF5340_CPUAPP nrf53_support.c)
zephyr_library_sources_ifdef(CONFIG_BT_AMBIQ_HCI hci_ambiq.c apollox_blue.c)
zephyr_library_sources_ifdef(CONFIG_BT_DA1469X hci_da1469x.c)
zephyr_library_sources_ifdef(CONFIG_BT_NXP hci_nxp.c)
zephyr_library_sources_ifdef(CONFIG_BT_H4_NXP_CTLR hci_nxp_setup.c)

View file

@ -248,3 +248,48 @@ config BT_SILABS_HCI_BUFFER_MEMORY
help
Select the size of allocated memory buffer for the Silicon Labs
Bluetooth Library.
config BT_H4_NXP_CTLR
bool "NXP Bluetooth Controller [EXPERIMENTAL]"
select GPIO
# select UART_USE_RUNTIME_CONFIGURE
select EXPERIMENTAL
depends on BT_H4
select CRC
default y
depends on DT_HAS_NXP_BT_HCI_UART_ENABLED
help
Enables support for NXP Bluetooth Controller.
Murata 2EL M.2 Moudle base on NXP IW612 Chipset which supports
Wi-Fi® 802.11a/b/g/n/ac/ax + Bluetooth® 5.3 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.embeddedartists.com/products/2el-m-2-module/
The configuration depends on the firmware (named uart_nw61x_se.h)
of Murata 2EL M.2 Moudle. It could be downloaded here
https://github.com/NXP/wifi_nxp/blob/MCUX_2.15.000/wifi_bt_firmware/nw61x/uart_nw61x_se.h
And it needs to be placed into the folder <zephyrproject>/zephyr/
drivers/bluetooth/hci.
More inforamtion about NXP Bluetooth profuct could be found on
https://www.nxp.com/products/wireless-connectivity/wi-fi-plus-bluetooth-plus-802-15-4:WIFI-BLUETOOTH
if BT_H4_NXP_CTLR
config BT_H4_NXP_CTLR_WAIT_HDR_SIG_TIMEOUT
int "Timeout for waiting HDR Signure"
range 1000 60000
default 2500
help
Timeout for waiting HDR Signure. Unit is millisecond.
config BT_H4_NXP_CTLR_WAIT_TIME_AFTER_UPLOAD
int "Waiting time after firmware is uploaded"
range 1000 5000
default 1000
help
Waiting time after firmware is uploaded. Unit is millisecond.
endif #BT_H4_NXP_CTLR

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,50 @@
# Copyright 2024 NXP
# SPDX-License-Identifier: Apache-2.0
description: |
Bluetooth module that uses NXP's Bluetooth Module (e.g. Murata 2EL)
compatible: "nxp,bt-hci-uart"
include: base.yaml
properties:
sdio-reset-gpios:
type: phandle-array
required: true
w-disable-gpios:
type: phandle-array
required: true
hci-operation-speed:
type: int
description: |
HCI UART baudrate for feature operation. If not defined
bus/current-speed will be used as default.
hw-flow-control:
type: boolean
description: Set to enable RTS/CTS flow control for HCI.
fw-download-primary-speed:
type: int
description: |
HCI UART primary baudrate for FW download operation.
If not defined bus/current-speed will be used as default.
fw-download-primary-flowcontrol:
type: boolean
description: |
Flow control setting for primary speed.
fw-download-secondary-speed:
type: int
description: |
HCI UART secondary baudrate for FW download operation.
If not defined bus/current-speed will be used as default.
fw-download-secondary-flowcontrol:
type: boolean
description: |
Flow control setting for secondary speed.