meta-digi-arm: add support for Worldwide regulatory domains
- For Qualcomm QCA65x4 platforms:
Add support to create the 'World' board data file for the QCA65x4 Wi-Fi
chip to operate on World regulatory domain.
Kernel wireless driver already supports selecting the correct file based
on the configured Regulatory Domain via Kernel command line argument
'wlan.regdmn', which allows the following parameters:
* "US", for U.S.A. (default)
* "World", for worldwide
- For Murata type2AE platforms:
Add World CLM blob file for the wireless interface and JRL hcd file for
the Bluetooth interface. Also add the autocountry ininitialization script
and systemd service.
World CLM blob file:
- cyfmac4373-sdio_World.clm_blob (1abe7f3fa86d4123b0586cbbf0ec91ac)
Kernel wireless and bluetooth drivers already support selecting the correct
files based on the configured Regulatory Domain via Kernel command line
arguments 'brcmfmac.regdmn' and 'btbcm.regdmn' respectively, which allow the
following parameters:
'brcmfmac.regdmn':
* "US", for U.S.A. (default)
* "World", for worldwide
'btbcm.regdmn':
* "FCC.CE", for U.S.A., Europe and the rest of the world (default)
* "JRL", for Japan
https://onedigi.atlassian.net/browse/DEL-8905
Co-authored-by: Gonzalo Ruiz <Gonzalo.Ruiz@digi.com>
Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
This commit is contained in:
parent
3fc0a30115
commit
22429e62cb
|
|
@ -59,7 +59,7 @@ MACHINE_FEATURES += "wifi"
|
||||||
# =========================================================================
|
# =========================================================================
|
||||||
# Firmware
|
# Firmware
|
||||||
# =========================================================================
|
# =========================================================================
|
||||||
MACHINE_FIRMWARE:append = " firmware-murata-infineon firmware-murata-infineon-mfgtest"
|
MACHINE_FIRMWARE:append = " firmware-murata-infineon"
|
||||||
|
|
||||||
MACHINE_EXTRA_RRECOMMENDS += " \
|
MACHINE_EXTRA_RRECOMMENDS += " \
|
||||||
${MACHINE_FIRMWARE} \
|
${MACHINE_FIRMWARE} \
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ MACHINE_FEATURES += "gpu"
|
||||||
# =========================================================================
|
# =========================================================================
|
||||||
# Firmware
|
# Firmware
|
||||||
# =========================================================================
|
# =========================================================================
|
||||||
MACHINE_FIRMWARE:append = " firmware-murata-infineon firmware-murata-infineon-mfgtest"
|
MACHINE_FIRMWARE:append = " firmware-murata-infineon"
|
||||||
|
|
||||||
MACHINE_EXTRA_RRECOMMENDS += " \
|
MACHINE_EXTRA_RRECOMMENDS += " \
|
||||||
${MACHINE_FIRMWARE} \
|
${MACHINE_FIRMWARE} \
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2022,2024 Digi International Inc.
|
# Copyright (C) 2022-2024 Digi International Inc.
|
||||||
|
|
||||||
SUMMARY = "Murata Infineon firmware binaries"
|
SUMMARY = "Murata Infineon firmware binaries"
|
||||||
SECTION = "base"
|
SECTION = "base"
|
||||||
|
|
@ -12,6 +12,9 @@ SRC_URI = " \
|
||||||
git://github.com/murata-wireless/cyw-fmac-utils-imx32;protocol=http;branch=master;destsuffix=cyw-fmac-utils-imx32;name=cyw-fmac-utils-imx32 \
|
git://github.com/murata-wireless/cyw-fmac-utils-imx32;protocol=http;branch=master;destsuffix=cyw-fmac-utils-imx32;name=cyw-fmac-utils-imx32 \
|
||||||
git://github.com/murata-wireless/cyw-fmac-utils-imx64;protocol=http;branch=master;destsuffix=cyw-fmac-utils-imx64;name=cyw-fmac-utils-imx64 \
|
git://github.com/murata-wireless/cyw-fmac-utils-imx64;protocol=http;branch=master;destsuffix=cyw-fmac-utils-imx64;name=cyw-fmac-utils-imx64 \
|
||||||
file://cyfmac4373-sdio_US.clm_blob \
|
file://cyfmac4373-sdio_US.clm_blob \
|
||||||
|
file://cyfmac4373-sdio_World.clm_blob \
|
||||||
|
file://cyw4373-autocountry \
|
||||||
|
file://cyw4373-autocountry.service \
|
||||||
"
|
"
|
||||||
|
|
||||||
SRCREV_cyw-fmac-fw="db8deb03b8d24e5069ac4581d1c35b767012e926"
|
SRCREV_cyw-fmac-fw="db8deb03b8d24e5069ac4581d1c35b767012e926"
|
||||||
|
|
@ -35,11 +38,13 @@ do_install () {
|
||||||
# Install Bluetooth patch *.HCD file
|
# Install Bluetooth patch *.HCD file
|
||||||
# For Murata 2AE (LBEE5PK2AE-564)
|
# For Murata 2AE (LBEE5PK2AE-564)
|
||||||
install -m 444 ${S}/cyw-bt-patch/BCM4373A0_001.001.025.0103.0155.FCC.CE.2AE.hcd ${D}${base_libdir}/firmware/brcm/BCM4373A0_FCC.CE.hcd
|
install -m 444 ${S}/cyw-bt-patch/BCM4373A0_001.001.025.0103.0155.FCC.CE.2AE.hcd ${D}${base_libdir}/firmware/brcm/BCM4373A0_FCC.CE.hcd
|
||||||
|
install -m 444 ${S}/cyw-bt-patch/BCM4373A0_001.001.025.0103.0156.JRL.2AE.hcd ${D}${base_libdir}/firmware/brcm/BCM4373A0_JRL.hcd
|
||||||
|
|
||||||
# Install WLAN firmware file (*.bin) and Regulatory binary file (*.clm_blob)
|
# Install WLAN firmware file (*.bin) and Regulatory binary file (*.clm_blob)
|
||||||
# For Murata 2AE (LBEE5PK2AE-564)
|
# For Murata 2AE (LBEE5PK2AE-564)
|
||||||
install -m 444 ${S}/cyw-fmac-fw/cyfmac4373-sdio.2AE.bin ${D}${base_libdir}/firmware/cypress/cyfmac4373-sdio.bin
|
install -m 444 ${S}/cyw-fmac-fw/cyfmac4373-sdio.2AE.bin ${D}${base_libdir}/firmware/cypress/cyfmac4373-sdio.bin
|
||||||
install -m 444 cyfmac4373-sdio_US.clm_blob ${D}${base_libdir}/firmware/cypress/cyfmac4373-sdio_US.clm_blob
|
install -m 444 cyfmac4373-sdio_US.clm_blob ${D}${base_libdir}/firmware/cypress/cyfmac4373-sdio_US.clm_blob
|
||||||
|
install -m 444 cyfmac4373-sdio_World.clm_blob ${D}${base_libdir}/firmware/cypress/cyfmac4373-sdio_World.clm_blob
|
||||||
|
|
||||||
# Install NVRAM files (*.txt)
|
# Install NVRAM files (*.txt)
|
||||||
# For Murata 2AE (LBEE5PK2AE-564)
|
# For Murata 2AE (LBEE5PK2AE-564)
|
||||||
|
|
@ -51,9 +56,31 @@ do_install () {
|
||||||
else
|
else
|
||||||
install -m 755 ${S}/cyw-fmac-utils-imx32/wl ${D}${sbindir}
|
install -m 755 ${S}/cyw-fmac-utils-imx32/wl ${D}${sbindir}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
|
||||||
|
# Install systemd unit files
|
||||||
|
install -d ${D}${systemd_unitdir}/system/
|
||||||
|
install -m 0644 ${WORKDIR}/cyw4373-autocountry.service ${D}${systemd_unitdir}/system/cyw4373-autocountry.service
|
||||||
|
fi
|
||||||
|
|
||||||
|
install -d ${D}${sysconfdir}/init.d/
|
||||||
|
install -m 0755 ${WORKDIR}/cyw4373-autocountry ${D}${sysconfdir}/cyw4373-autocountry
|
||||||
|
ln -sf /etc/cyw4373-autocountry ${D}${sysconfdir}/init.d/cyw4373-autocountry
|
||||||
}
|
}
|
||||||
|
|
||||||
PACKAGES =+ "${PN}-mfgtest"
|
inherit update-rc.d systemd
|
||||||
|
|
||||||
|
INITSCRIPT_PACKAGES += "${PN}-autocountry"
|
||||||
|
INITSCRIPT_NAME:${PN}-autocountry = "cyw4373-autocountry"
|
||||||
|
INITSCRIPT_PARAMS:${PN}-autocountry = "start 19 2 3 4 5 . stop 21 0 1 6 ."
|
||||||
|
|
||||||
|
SYSTEMD_PACKAGES = "${PN}-autocountry"
|
||||||
|
SYSTEMD_SERVICE:${PN}-autocountry = "cyw4373-autocountry.service"
|
||||||
|
|
||||||
|
PACKAGES =+ " \
|
||||||
|
${PN}-mfgtest \
|
||||||
|
${PN}-autocountry \
|
||||||
|
"
|
||||||
|
|
||||||
FILES:${PN} = " \
|
FILES:${PN} = " \
|
||||||
${base_libdir}/firmware \
|
${base_libdir}/firmware \
|
||||||
|
|
@ -63,6 +90,15 @@ FILES:${PN}-mfgtest = " \
|
||||||
${sbindir} \
|
${sbindir} \
|
||||||
"
|
"
|
||||||
|
|
||||||
|
FILES:${PN}-autocountry = " \
|
||||||
|
${sysconfdir}/cyw4373-autocountry \
|
||||||
|
${sysconfdir}/init.d/cyw4373-autocountry \
|
||||||
|
${systemd_unitdir}/system/cyw4373-autocountry.service \
|
||||||
|
"
|
||||||
|
|
||||||
|
RDEPENDS:${PN}:append = " ${PN}-autocountry"
|
||||||
|
RDEPENDS:${PN}-autocountry:append = " ${PN}-mfgtest"
|
||||||
|
|
||||||
INSANE_SKIP:${PN} += "build-deps"
|
INSANE_SKIP:${PN} += "build-deps"
|
||||||
INSANE_SKIP:${PN} += "file-rdeps"
|
INSANE_SKIP:${PN} += "file-rdeps"
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -0,0 +1,38 @@
|
||||||
|
#!/bin/sh
|
||||||
|
#===============================================================================
|
||||||
|
#
|
||||||
|
# Copyright (C) 2024 by Digi International Inc.
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify it
|
||||||
|
# under the terms of the GNU General Public License version 2 as published by
|
||||||
|
# the Free Software Foundation.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# !Description: Enable Wireless autocountry feature (802.11d)
|
||||||
|
#
|
||||||
|
#===============================================================================
|
||||||
|
|
||||||
|
SCRIPTNAME="$(basename ${0})"
|
||||||
|
|
||||||
|
log() {
|
||||||
|
if type "systemd-cat" >/dev/null 2>/dev/null; then
|
||||||
|
systemd-cat -p "${1}" -t "${SCRIPTNAME}" printf "%s" "${2}"
|
||||||
|
else
|
||||||
|
logger -p "${1}" -t "${SCRIPTNAME}" "${2}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Only for Wireless variants
|
||||||
|
if [ -d "/proc/device-tree/wireless" ]; then
|
||||||
|
# Check if WorldWide regulatory domain is available
|
||||||
|
if wl country list | grep -qs ^XZ; then
|
||||||
|
# Select WorldWide Country Code as driver operational region
|
||||||
|
wl country XZ/0 agg
|
||||||
|
# Select WorldWide Country Code for use with Auto Contry Discovery
|
||||||
|
wl autocountry_default XZ
|
||||||
|
# Enable 802.11d
|
||||||
|
wl autocountry 1
|
||||||
|
log info "Set WorldWide regulatory domain"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
[Unit]
|
||||||
|
Description=CYW4373 autocountry (802.11d)
|
||||||
|
After=network.target suspend.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/etc/cyw4373-autocountry
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target suspend.target
|
||||||
|
|
@ -132,6 +132,10 @@ do_install() {
|
||||||
length="$(expr $(stat -L -c %s ${D}${base_libdir}/firmware/qca/nvm_tlv_3.2.bin) - 4)"
|
length="$(expr $(stat -L -c %s ${D}${base_libdir}/firmware/qca/nvm_tlv_3.2.bin) - 4)"
|
||||||
/bin/echo -ne "\x$(printf '%02x' $(expr $length % 256))" | dd of=${D}${base_libdir}/firmware/qca/nvm_tlv_3.2.bin bs=1 seek=1 count=1 conv=notrunc,fsync
|
/bin/echo -ne "\x$(printf '%02x' $(expr $length % 256))" | dd of=${D}${base_libdir}/firmware/qca/nvm_tlv_3.2.bin bs=1 seek=1 count=1 conv=notrunc,fsync
|
||||||
/bin/echo -ne "\x$(printf '%02x' $(expr $length / 256))" | dd of=${D}${base_libdir}/firmware/qca/nvm_tlv_3.2.bin bs=1 seek=2 count=1 conv=notrunc,fsync
|
/bin/echo -ne "\x$(printf '%02x' $(expr $length / 256))" | dd of=${D}${base_libdir}/firmware/qca/nvm_tlv_3.2.bin bs=1 seek=2 count=1 conv=notrunc,fsync
|
||||||
|
|
||||||
|
# Create World BDF file
|
||||||
|
cp ${D}${WIFI_FW_PATH}/bdwlan30_US.bin ${D}${WIFI_FW_PATH}/bdwlan30_World.bin
|
||||||
|
/bin/echo -ne "\x60\x00" | dd of="${D}${WIFI_FW_PATH}/bdwlan30_World.bin" bs=1 seek=12 count=2 conv=notrunc,fsync
|
||||||
}
|
}
|
||||||
|
|
||||||
QCA_MODEL ?= "qca6564"
|
QCA_MODEL ?= "qca6564"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue