From 904231cdfe0e14f5ec523c82e178d71a98746a7b Mon Sep 17 00:00:00 2001 From: csbobo <751541594@qq.com> Date: Tue, 17 Dec 2024 16:31:42 +0800 Subject: [PATCH 1/2] drivers: wifi: nxp: Fix the compilation error on the MIMXRT1170_EVK board with the NXP_88W8987_MURATA_1ZM_M2 WiFi module - Fix the compilation error on the MIMXRT1170_EVK board with the NXP_88W8987_MURATA_1ZM_M2 WiFi module Signed-off-by: csbobo <751541594@qq.com> --- drivers/wifi/nxp/Kconfig.nxp | 2 +- drivers/wifi/nxp/nxp_wifi_drv.c | 13 +- dts/bindings/wifi/nxp,wifi.yaml | 32 ++++ .../mimxrt1170_evk_mimxrt1176_cm7_A.conf | 168 ++++++++++++++++++ .../mimxrt1170_evk_mimxrt1176_cm7_A.overlay | 25 +++ samples/net/wifi/shell/sample.yaml | 1 + west.yml | 2 +- 7 files changed, 239 insertions(+), 4 deletions(-) create mode 100644 samples/net/wifi/shell/boards/mimxrt1170_evk_mimxrt1176_cm7_A.conf create mode 100644 samples/net/wifi/shell/boards/mimxrt1170_evk_mimxrt1176_cm7_A.overlay diff --git a/drivers/wifi/nxp/Kconfig.nxp b/drivers/wifi/nxp/Kconfig.nxp index 19e2c345d14e..d0d5e439cf9a 100644 --- a/drivers/wifi/nxp/Kconfig.nxp +++ b/drivers/wifi/nxp/Kconfig.nxp @@ -298,7 +298,7 @@ config NXP_88W8801_MURATA_2DS_USD https://www.murata.com/en-us/products/connectivitymodule/wi-fi-bluetooth/overview/lineup/type2ds https://www.murata.com/en-us/products/connectivitymodule/wi-fi-bluetooth/overview/lineup/usd-m2-adapter -config NXP_88W8801_MURATA_2DS_USD +config NXP_88W8801_MURATA_2DS_M2 bool "NXP MURATA-2DS-M2" help Murata Type 2DS is a small high-performance module (integrated PCB antenna) diff --git a/drivers/wifi/nxp/nxp_wifi_drv.c b/drivers/wifi/nxp/nxp_wifi_drv.c index f8b8bef03cd2..a8558e8069ea 100644 --- a/drivers/wifi/nxp/nxp_wifi_drv.c +++ b/drivers/wifi/nxp/nxp_wifi_drv.c @@ -1343,18 +1343,23 @@ static int nxp_wifi_power_save(const struct device *dev, struct wifi_ps_params * } break; case WIFI_PS_PARAM_MODE: + if (params->mode == WIFI_PS_MODE_WMM) { + #if CONFIG_NXP_WIFI_WMM_UAPSD ret = wlan_set_wmm_uapsd(1); if (ret != WM_SUCCESS) { status = NXP_WIFI_RET_FAIL; } + #endif } else if (params->mode == WIFI_PS_MODE_LEGACY) { + #if CONFIG_NXP_WIFI_WMM_UAPSD ret = wlan_set_wmm_uapsd(0); if (ret != WM_SUCCESS) { status = NXP_WIFI_RET_FAIL; - } + } + #endif } break; case WIFI_PS_PARAM_TIMEOUT: @@ -1405,11 +1410,15 @@ int nxp_wifi_get_power_save(const struct device *dev, struct wifi_ps_config *con config->ps_params.wakeup_mode = WIFI_PS_WAKEUP_MODE_DTIM; } +#if CONFIG_NXP_WIFI_WMM_UAPSD if (wlan_is_wmm_uapsd_enabled()) { config->ps_params.mode = WIFI_PS_MODE_WMM; - } else { + } else +#endif + { config->ps_params.mode = WIFI_PS_MODE_LEGACY; } + } else { status = NXP_WIFI_RET_FAIL; } diff --git a/dts/bindings/wifi/nxp,wifi.yaml b/dts/bindings/wifi/nxp,wifi.yaml index 32d6adc5a658..e6267010c686 100644 --- a/dts/bindings/wifi/nxp,wifi.yaml +++ b/dts/bindings/wifi/nxp,wifi.yaml @@ -8,3 +8,35 @@ description: | compatible: "nxp,wifi" include: [sd-device.yaml, pinctrl-device.yaml] + +properties: + + pdn-gpios: + type: phandle-array + required: false + description: | + Power Down control GPIO pin. + + Signal states: + - High: Module enabled and internally powered + - Low: Module disabled and powered down + + wl_rst-gpios: + type: phandle-array + required: false + description: | + WiFi SDIO reset control GPIO pin. + + Signal states: + - High: Normal operation mode + - Low: Module held in reset state + + bt_rst-gpios: + type: phandle-array + required: false + description: | + Bluetooth reset control GPIO pin. + + Signal states: + - High: Normal operation mode + - Low: Bluetooth held in reset state diff --git a/samples/net/wifi/shell/boards/mimxrt1170_evk_mimxrt1176_cm7_A.conf b/samples/net/wifi/shell/boards/mimxrt1170_evk_mimxrt1176_cm7_A.conf new file mode 100644 index 000000000000..4dec6a176ef1 --- /dev/null +++ b/samples/net/wifi/shell/boards/mimxrt1170_evk_mimxrt1176_cm7_A.conf @@ -0,0 +1,168 @@ +# Early Console and Debug Configuration +CONFIG_EARLY_CONSOLE=y +CONFIG_LOG=y +CONFIG_LOG_MODE_IMMEDIATE=y +# CONFIG_WIFI_LOG_LEVEL_DBG=y +# CONFIG_NET_LOG=y +# CONFIG_NET_SOCKETS_LOG_LEVEL_DBG=y +# CONFIG_NET_MGMT_EVENT_LOG_LEVEL_DBG=y +CONFIG_INIT_STACKS=y +CONFIG_TEST_RANDOM_GENERATOR=y + +# OS and Memory Configuration +CONFIG_THREAD_CUSTOM_DATA=y +CONFIG_EVENTS=y +CONFIG_SYS_HEAP_AUTO=y +CONFIG_HEAP_MEM_POOL_SIZE=307200 +CONFIG_SCHED_MULTIQ=y +CONFIG_ZVFS_OPEN_MAX=30 +CONFIG_POSIX_API=y +CONFIG_BUILD_OUTPUT_HEX=y + +# Stack Size Configuration +CONFIG_MAIN_STACK_SIZE=5200 +CONFIG_SHELL_STACK_SIZE=8192 +CONFIG_NET_TX_STACK_SIZE=4096 +CONFIG_NET_RX_STACK_SIZE=4096 +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096 +CONFIG_NET_MGMT_EVENT_STACK_SIZE=4096 +CONFIG_NET_SOCKETS_SERVICE_STACK_SIZE=4096 + +# WiFi Core Configuration +CONFIG_WIFI=y +CONFIG_WIFI_LOG_LEVEL_ERR=y +CONFIG_WIFI_NXP=y + +CONFIG_NXP_88W8987=y +CONFIG_NXP_88W8987_MURATA_1ZM_M2=y +# CONFIG_NXP_88W8987_MURATA_1ZM_USD=y +# CONFIG_NXP_88W8987_AW_CM358_USD=y +# CONFIG_NXP_88W8987_AW_CM358MA_M2=y + +# CONFIG_NXP_IW416=y +# CONFIG_NXP_IW416_AW_AM457MA_M2=y +# CONFIG_NXP_IW416_AW_AM457_USD=y +# CONFIG_NXP_IW416_AW_AM510_USD=y +# CONFIG_NXP_IW416_AW_AM510MA_M2=y +# CONFIG_NXP_IW416_MURATA_1XK_USD=y +# CONFIG_NXP_IW416_MURATA_1XK_M2=y + +# CONFIG_NXP_IW61X=y +# CONFIG_NXP_IW612_MURATA_2EL_USD=y +# CONFIG_NXP_IW612_MURATA_2EL_M2=y +# CONFIG_NXP_IW611_MURATA_2DL_USD=y +# CONFIG_NXP_IW611_MURATA_2DL_M2=y + +# CONFIG_NXP_88W8801=y +# CONFIG_NXP_88W8801_AW_NM191_USD=y +# CONFIG_NXP_88W8801_AW_NM191MA_M2=y +# CONFIG_NXP_88W8801_MURATA_2DS_USD=y +# CONFIG_NXP_88W8801_MURATA_2DS_M2=y + + +# WiFi Task Stack Configuration +CONFIG_NXP_WIFI_MON_TASK_STACK_SIZE=2048 +CONFIG_NXP_WIFI_WLCMGR_TASK_STACK_SIZE=8192 +CONFIG_NXP_WIFI_POWERSAVE_TASK_STACK_SIZE=1024 +CONFIG_NXP_WIFI_TX_TASK_STACK_SIZE=4096 +CONFIG_NXP_WIFI_DRIVER_TASK_STACK_SIZE=4096 +CONFIG_NXP_WIFI_SCAN_TASK_STACK_SIZE=4096 + +# Disable WMM feature +# CONFIG_NXP_WIFI_WMM=n +# CONFIG_NXP_WIFI_WMM_UAPSD=n +# CONFIG_NXP_WIFI_SDIO_MULTI_PORT_TX_AGGR=n +# CONFIG_NXP_WIFI_TURBO_MODE=n +# CONFIG_NXP_WIFI_11AX=n +# CONFIG_NXP_WIFI_11AC=n + +# SDIO Configuration +CONFIG_SDHC=y +CONFIG_SDIO_STACK=y + +# Network Core Configuration +CONFIG_NETWORKING=y +CONFIG_NET_IPV4=y +CONFIG_NET_IPV6=y +CONFIG_NET_TCP=y +CONFIG_NET_L2_ETHERNET=y +# CONFIG_NET_L2_ETHERNET_MGMT=y +# CONFIG_NET_MGMT=y +# CONFIG_NET_MGMT_EVENT=y + +# Network Buffer Configuration +# CONFIG_NET_BUF=y +CONFIG_NET_BUF_LOG=y +CONFIG_NET_BUF_DATA_SIZE=2048 +CONFIG_NET_PKT_RX_COUNT=32 +CONFIG_NET_PKT_TX_COUNT=32 +CONFIG_NET_BUF_RX_COUNT=64 +CONFIG_NET_BUF_TX_COUNT=64 +CONFIG_NET_MAX_CONTEXTS=16 + +# Network Thread Priority Configuration +CONFIG_NET_TC_THREAD_PRIO_CUSTOM=y +CONFIG_NET_TC_THREAD_PREEMPTIVE=y +CONFIG_NET_TCP_WORKER_PRIO=-16 +CONFIG_NET_TCP_WORKQ_STACK_SIZE=2048 +CONFIG_NET_TC_TX_THREAD_BASE_PRIO=3 +CONFIG_NET_TC_RX_THREAD_BASE_PRIO=3 +CONFIG_ZPERF_WORK_Q_THREAD_PRIORITY=3 +CONFIG_NET_SOCKETS_SERVICE_THREAD_PRIO=3 +CONFIG_NET_TC_SKIP_FOR_HIGH_PRIO=y +CONFIG_NET_CONTEXT_PRIORITY=y +CONFIG_NET_MGMT_THREAD_PRIO_CUSTOM=y +CONFIG_NET_MGMT_THREAD_PRIORITY=3 + +# Network Protocol Configuration +CONFIG_NET_TC_TX_COUNT=1 +CONFIG_NET_TC_RX_COUNT=1 +CONFIG_NET_MGMT_EVENT_QUEUE_SIZE=32 +CONFIG_NET_MGMT_EVENT_QUEUE_TIMEOUT=5000 +CONFIG_NET_IF_MAX_IPV4_COUNT=4 +CONFIG_NET_IF_MAX_IPV6_COUNT=4 +CONFIG_NET_MAX_CONN=10 + +# DHCP Configuration +CONFIG_NET_DHCPV4=y +# CONFIG_NET_DHCPV4_INITIAL_DELAY_MAX=10 +CONFIG_NET_DHCPV4_SERVER_ADDR_COUNT=32 +CONFIG_NET_DHCPV4_SERVER_ICMP_PROBE_TIMEOUT=100 + +# DNS Configuration +CONFIG_DNS_RESOLVER=y +CONFIG_DNS_RESOLVER_MAX_SERVERS=2 +CONFIG_NET_SOCKETS_POLL_MAX=14 + +# Network Features +CONFIG_NET_IPV4_FRAGMENT=y +CONFIG_NET_IPV4_FRAGMENT_MAX_COUNT=3 +CONFIG_NET_IPV4_FRAGMENT_MAX_PKT=7 +CONFIG_NET_IPV4_FRAGMENT_TIMEOUT=3 +CONFIG_NET_IPV6_FRAGMENT=y +CONFIG_NET_IPV6_FRAGMENT_MAX_COUNT=3 +CONFIG_NET_IPV6_FRAGMENT_MAX_PKT=8 +CONFIG_NET_IPV6_FRAGMENT_TIMEOUT=3 + +# Shell Configuration +CONFIG_NET_SHELL=y +CONFIG_NXP_WIFI_SHELL=y +CONFIG_NET_L2_WIFI_SHELL=y +CONFIG_SHELL=y +# CONFIG_SHELL_BACKEND_SERIAL=y +CONFIG_SHELL_CMD_BUFF_SIZE=512 +CONFIG_SHELL_ARGC_MAX=48 +CONFIG_WIFI_SHELL_MAX_AP_STA=8 +CONFIG_WIFI_MGMT_AP_MAX_NUM_STA=8 + +# Network Statistics +CONFIG_NET_STATISTICS=y +CONFIG_NET_STATISTICS_PERIODIC_OUTPUT=n +CONFIG_NET_STATISTICS_WIFI=y +CONFIG_NET_STATISTICS_USER_API=y + + +# Performance Testing +CONFIG_NET_ZPERF=y +CONFIG_NET_ZPERF_MAX_PACKET_SIZE=1500 +CONFIG_NET_ZPERF_MAX_SESSIONS=6 \ No newline at end of file diff --git a/samples/net/wifi/shell/boards/mimxrt1170_evk_mimxrt1176_cm7_A.overlay b/samples/net/wifi/shell/boards/mimxrt1170_evk_mimxrt1176_cm7_A.overlay new file mode 100644 index 000000000000..44ce9e3b6cd7 --- /dev/null +++ b/samples/net/wifi/shell/boards/mimxrt1170_evk_mimxrt1176_cm7_A.overlay @@ -0,0 +1,25 @@ +/* + * Copyright 2024 NXP + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&usdhc1 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + pinctrl-0 = <&pinmux_usdhc1>; + pinctrl-1 = <&pinmux_usdhc1_dat3_nopull>; + pinctrl-names = "default", "nopull"; + pwr-gpios = <&gpio10 2 GPIO_ACTIVE_LOW>; + power-delay-ms = <100>; + + wifi: nxp_wifi@0 { + compatible = "nxp,wifi"; + reg = <0>; + status = "okay"; + + pdn-gpios = <&gpio9 30 GPIO_ACTIVE_HIGH>; + wl_rst-gpios = <&gpio9 15 GPIO_ACTIVE_HIGH>; + }; +}; \ No newline at end of file diff --git a/samples/net/wifi/shell/sample.yaml b/samples/net/wifi/shell/sample.yaml index bc5f10b6751e..d1eae532fe32 100644 --- a/samples/net/wifi/shell/sample.yaml +++ b/samples/net/wifi/shell/sample.yaml @@ -80,3 +80,4 @@ tests: platform_allow: - frdm_rw612 - rd_rw612_bga + - mimxrt1170_evk/mimxrt1176/cm7 diff --git a/west.yml b/west.yml index a8d24ef7ce1c..eb2efca8ba45 100644 --- a/west.yml +++ b/west.yml @@ -203,7 +203,7 @@ manifest: groups: - hal - name: hal_nxp - revision: d2e2514cbe70babc2dfe6e8eb0e4f9e4c97769b6 + revision: pull/473/head path: modules/hal/nxp groups: - hal From 1736062cba646e6baeb43bf932c4d3d1b6b30815 Mon Sep 17 00:00:00 2001 From: csbobo <751541594@qq.com> Date: Tue, 17 Dec 2024 17:16:14 +0800 Subject: [PATCH 2/2] drivers: wifi: nxp: Fix the compilation error on the MIMXRT1170_EVK board with the NXP_88W8987_MURATA_1ZM_M2 WiFi module - Modify the west.yml file. Signed-off-by: csbobo <751541594@qq.com> --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index eb2efca8ba45..df848404ed8e 100644 --- a/west.yml +++ b/west.yml @@ -203,7 +203,7 @@ manifest: groups: - hal - name: hal_nxp - revision: pull/473/head + revision: pull/489/head path: modules/hal/nxp groups: - hal