Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions MAINTAINERS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2878,6 +2878,18 @@
tests:
- drivers.net.wifi

"Drivers: Wi-Fi as Broadcom brcmfmac":
status: maintained
maintainers:
- jetpax
collaborators:

Check warning on line 2885 in MAINTAINERS.yml

View workflow job for this annotation

GitHub Actions / Pull Request/Issue Assignment

User lacks access

jetpax does not have the required access level to zephyrproject-rtos/zephyr. This is a warning only and does not block merging.
- jukkar
files:
- drivers/wifi/brcmfmac/
- dts/bindings/wifi/brcm,bcm43xxx-sdio.yaml
labels:
- "area: Wi-Fi"

"Drivers: Wi-Fi as nRF Wi-Fi":
status: maintained
maintainers:
Expand Down
1 change: 1 addition & 0 deletions drivers/wifi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ endif() # CONFIG_BUILD_ONLY_NO_BLOBS

# zephyr-keep-sorted-start
add_subdirectory_ifdef(CONFIG_WIFI_AIROC infineon)
add_subdirectory_ifdef(CONFIG_WIFI_BRCMFMAC brcmfmac)
add_subdirectory_ifdef(CONFIG_WIFI_ESP32 esp32)
add_subdirectory_ifdef(CONFIG_WIFI_ESP_AT esp_at)
add_subdirectory_ifdef(CONFIG_WIFI_ESP_HOSTED esp_hosted)
Expand Down
2 changes: 2 additions & 0 deletions drivers/wifi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ source "subsys/net/Kconfig.template.log_config.net"
config WIFI_INIT_PRIORITY
int "Wi-Fi driver init priority"
default 86 if WIFI_AIROC && AIROC_WIFI_BUS_SDIO
default 86 if WIFI_BRCMFMAC
default 80
help
Wi-Fi device driver initialization priority.
Expand All @@ -37,6 +38,7 @@ config WIFI_USE_NATIVE_NETWORKING
to use native ethernet stack interface.

# zephyr-keep-sorted-start
source "drivers/wifi/brcmfmac/Kconfig.brcmfmac"
source "drivers/wifi/esp32/Kconfig.esp32"
source "drivers/wifi/esp_at/Kconfig.esp_at"
source "drivers/wifi/esp_hosted/Kconfig.esp_hosted"
Expand Down
54 changes: 54 additions & 0 deletions drivers/wifi/brcmfmac/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Copyright (c) 2026 Jonathan Elliot Peace <jep@alphabetiq.com>
# SPDX-License-Identifier: Apache-2.0

if(CONFIG_WIFI_BRCMFMAC)

zephyr_library()
zephyr_library_sources(
brcmfmac_core.c
brcmfmac_chip.c
brcmfmac_sdio.c
brcmfmac_bcdc.c
brcmfmac_net.c
brcmfmac_fw_blob.c
)

set(brcmfmac_gen_dir ${ZEPHYR_BINARY_DIR}/include/generated/brcmfmac)
zephyr_library_include_directories(${brcmfmac_gen_dir})

if(CONFIG_BUILD_ONLY_NO_BLOBS)
# CI build path: hal_broadcom may not be present and blobs are not
# fetched. Emit empty .inc files so brcmfmac_fw_blob.c compiles into
# zero-length arrays; the driver will refuse to upload at runtime,
# which is the expected failure mode for a no-blobs build.
file(WRITE ${brcmfmac_gen_dir}/brcmfmac_fw.inc "")
file(WRITE ${brcmfmac_gen_dir}/brcmfmac_nvram.inc "")
file(WRITE ${brcmfmac_gen_dir}/brcmfmac_clm_blob.inc "")
else()
# Pull the firmware and per-board NVRAM from hal_broadcom (fetched
# via `west blobs fetch hal_broadcom`) and convert each into a
# comma-separated byte sequence that brcmfmac_fw_blob.c #include's
# as the body of a const array.
zephyr_blobs_verify(MODULE hal_broadcom REQUIRED)
set(brcmfmac_blob_dir
${ZEPHYR_HAL_BROADCOM_MODULE_DIR}/zephyr/blobs/img/brcmfmac)
generate_inc_file_for_target(${ZEPHYR_CURRENT_LIBRARY}
${brcmfmac_blob_dir}/${CONFIG_WIFI_BRCMFMAC_FIRMWARE_FILE}
${brcmfmac_gen_dir}/brcmfmac_fw.inc)
generate_inc_file_for_target(${ZEPHYR_CURRENT_LIBRARY}
${brcmfmac_blob_dir}/${CONFIG_WIFI_BRCMFMAC_NVRAM_FILE}
${brcmfmac_gen_dir}/brcmfmac_nvram.inc)

# CLM blob is optional: a board that needs it sets
# CONFIG_WIFI_BRCMFMAC_CLM_FILE in its defconfig; an unset/empty
# string links a zero-length array and the driver skips upload.
if(CONFIG_WIFI_BRCMFMAC_CLM_FILE STREQUAL "")
file(WRITE ${brcmfmac_gen_dir}/brcmfmac_clm_blob.inc "")
else()
generate_inc_file_for_target(${ZEPHYR_CURRENT_LIBRARY}
${brcmfmac_blob_dir}/${CONFIG_WIFI_BRCMFMAC_CLM_FILE}
${brcmfmac_gen_dir}/brcmfmac_clm_blob.inc)
endif()
endif()

endif()
66 changes: 66 additions & 0 deletions drivers/wifi/brcmfmac/Kconfig.brcmfmac
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Copyright (c) 2026 Jonathan Elliot Peace <jep@alphabetiq.com>
# SPDX-License-Identifier: Apache-2.0

menuconfig WIFI_BRCMFMAC
bool "Broadcom BCM43xxx SDIO Wi-Fi (brcmfmac)"
depends on DT_HAS_BRCM_BCM43XXX_SDIO_ENABLED
default y
select WIFI_USE_NATIVE_NETWORKING
select NET_L2_ETHERNET
select NET_L2_WIFI_MGMT
select SDHC
select SDIO_STACK
select GPIO
help
Native-L2 driver for SDIO-attached Broadcom/Cypress combo chips
speaking the brcmfmac SDPCM+BCDC protocol. The chip handles
802.11; Zephyr's ethernet/IP stack runs on top. Firmware and
per-board NVRAM are supplied by the hal_broadcom module via
`west blobs fetch hal_broadcom`.

When using samples/net/wifi/shell, raise
CONFIG_NET_MGMT_EVENT_STACK_SIZE to 4096 -- the 768-byte default
overflows on scan-result formatting (each AP raises a net_mgmt
event whose handler prints a row).

if WIFI_BRCMFMAC

config WIFI_BRCMFMAC_FIRMWARE_FILE
string "Firmware file name (under hal_broadcom blobs)"
default "brcmfmac43436s-sdio.bin"
help
Name of the brcmfmac firmware blob under
${ZEPHYR_HAL_BROADCOM_MODULE_DIR}/zephyr/blobs/img/brcmfmac/.
Set by the board defconfig to match the on-board chip.

config WIFI_BRCMFMAC_NVRAM_FILE
string "NVRAM file name (under hal_broadcom blobs)"
default "brcmfmac43436s-sdio.txt"
help
Name of the brcmfmac per-board NVRAM blob under
${ZEPHYR_HAL_BROADCOM_MODULE_DIR}/zephyr/blobs/img/brcmfmac/.
Encodes board-specific antenna, calibration and PA settings.

config WIFI_BRCMFMAC_CLM_FILE
string "CLM blob file name (under hal_broadcom blobs)"
default ""
help
Optional Country Locale Matrix blob under
${ZEPHYR_HAL_BROADCOM_MODULE_DIR}/zephyr/blobs/img/brcmfmac/.
Required by chips whose firmware ships without built-in regulatory
tables (e.g. BCM43458F); chips that have them (e.g. BCM43430A1)
still accept the upload harmlessly. Leave empty to skip CLM upload
entirely -- the driver links a zero-length blob in that case.

config WIFI_BRCMFMAC_RX_THREAD_STACK_SIZE
int "RX thread stack size"
default 4096
help
Stack for the dedicated RX polling thread that drains F2 and
dispatches frames by SDPCM channel.

config WIFI_BRCMFMAC_RX_THREAD_PRIO
int "RX thread priority"
default 4

endif # WIFI_BRCMFMAC
Loading
Loading