ccimx93: iw612: add WiFi support

https://onedigi.atlassian.net/browse/DEL-8346

Signed-off-by: Isaac Hermida <isaac.hermida@digi.com>
This commit is contained in:
Isaac Hermida 2022-11-29 18:38:18 +01:00
parent 4200b2f06a
commit 38831535fb
4 changed files with 80 additions and 0 deletions

View File

@ -0,0 +1,16 @@
# Copyright (C) 2023 Digi International.
LIC_FILES_CHKSUM:ccimx93 = "file://EULA.txt;md5=add2d392714d3096ed7e0f7e2190724b"
SRCBRANCH:ccimx93 = "lf-6.1.1_1.0.0"
SRCREV:ccimx93 = "bacbeb4789c1b13d13aab12ada29217ce8c3e905"
do_install:append:ccimx93() {
install -m 444 ${S}/nxp/FwImage_IW612_SD/sduart_nw61x_v1.bin.se ${D}${base_libdir}/firmware/nxp
}
PACKAGES:prepend:ccimx93 = "${PN}-nxpiw612 "
FILES:${PN}-nxpiw612 = " \
${base_libdir}/firmware/nxp/sduart_nw61x_v1.bin.se \
"

View File

@ -0,0 +1,22 @@
# Copyright (C) 2023 Digi International.
FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:"
SRC_URI:append = " \
file://81-iw612-wifi.rules \
file://load_iw612.sh \
"
do_install:append () {
install -d ${D}${sysconfdir}/udev/rules.d
install -m 0644 ${WORKDIR}/81-iw612-wifi.rules ${D}${sysconfdir}/udev/rules.d/
install -d ${D}${sysconfdir}/udev/scripts
install -m 0777 ${WORKDIR}/load_iw612.sh ${D}${sysconfdir}/udev/scripts/
}
FILES:${PN}:append = " \
${sysconfdir}/udev/rules.d \
${sysconfdir}/udev/scripts \
"
RDEPENDS:${PN}:remove = "wireless-tools"

View File

@ -0,0 +1,2 @@
# Load IW612 wireless module (sdio)
SUBSYSTEM=="sdio", ACTION=="add", ENV{MODALIAS}=="sdio:c00v0471d0205", RUN="/etc/udev/scripts/load_iw612.sh"

View File

@ -0,0 +1,40 @@
#!/bin/sh
# The bit settings of drv_mode are:
# Bit 0 : STA
# Bit 1 : uAP
# Bit 2 : WIFIDIRECT
# eg, for STA + uAP + WIFIDIRECT, set 7 (b'111)
DRIVER_MODE=1 # Only STA
# MREG_D(00000200), MERROR(00000004),MFATAL(00000002)
DRIVER_DEBUG="0x206"
MOAL_PARAMS=" \
cfg80211_wext=0xf \
max_vir_bss=1 \
cal_data_cfg=none \
ps_mode=1 \
auto_ds=1 \
host_mlme=1 \
drv_mode=${DRIVER_MODE} \
drvdbg=${DRIVER_DEBUG} \
fw_name=nxp/sduart_nw61x_v1.bin.se\
"
log() {
printf "<3>iw612-wifi: $1\n" >/dev/kmsg
}
if ! [ -e "/proc/device-tree/wireless/mac-address" ]; then
log "[ERROR] wireless mac-address not found"
exit 1
fi
WLANADDR=$(hexdump -ve '1/1 "%02X" ":"' /proc/device-tree/wireless/mac-address 2>/dev/null | sed 's/:$//g')
modprobe mlan && \
modprobe moal ${MOAL_PARAMS} mac_addr=${WLANADDR} && \
log "Wi-Fi activated" && exit 0
log "[ERROR] cannot load Wi-Fi driver"
exit 1