summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2022-12-12 19:04:30 -0600
committerJohn Klug <john.klug@multitech.com>2023-01-10 16:42:56 -0600
commit7b5feeca46ea9eecc2d20b95cbcddba4fb5cc286 (patch)
tree5892196b5c80acdd087ac9a547553104d240ec0c
parentf8423158593151b0c934040b945129bb88d22f74 (diff)
downloadmeta-multitech-atmel-7b5feeca46ea9eecc2d20b95cbcddba4fb5cc286.tar.gz
meta-multitech-atmel-7b5feeca46ea9eecc2d20b95cbcddba4fb5cc286.tar.bz2
meta-multitech-atmel-7b5feeca46ea9eecc2d20b95cbcddba4fb5cc286.zip
Start of rsi-91x driver
-rwxr-xr-xrecipes-kernel/rsi-91x/files/onebox_util.sh25
-rw-r--r--recipes-kernel/rsi-91x/files/rs9113.default66
-rwxr-xr-xrecipes-kernel/rsi-91x/files/rs9113.init130
-rwxr-xr-xrecipes-kernel/rsi-91x/files/rs9113.reset25
-rwxr-xr-xrecipes-kernel/rsi-91x/files/rs9113_load_modules.sh189
-rwxr-xr-xrecipes-kernel/rsi-91x/files/rs9113_remove_modules.sh28
-rw-r--r--recipes-kernel/rsi-91x/files/rsi-91x-config.patch31
-rw-r--r--recipes-kernel/rsi-91x/files/rsi-bt91x-config.patch41
-rw-r--r--recipes-kernel/rsi-91x/files/rsi_91x.conf14
-rw-r--r--recipes-kernel/rsi-91x/rs9113-fw_1.6.5.bb19
-rw-r--r--recipes-kernel/rsi-91x/rsi-91x-fw_2.5.1.bb81
-rw-r--r--recipes-kernel/rsi-91x/rsi-91x-utils_2.5.1.bb31
-rw-r--r--recipes-kernel/rsi-91x/rsi-91x_2.5.1.bb34
-rw-r--r--recipes-kernel/rsi-91x/rsi-bt91x_2.5.1.bb34
14 files changed, 748 insertions, 0 deletions
diff --git a/recipes-kernel/rsi-91x/files/onebox_util.sh b/recipes-kernel/rsi-91x/files/onebox_util.sh
new file mode 100755
index 0000000..5a20d2b
--- /dev/null
+++ b/recipes-kernel/rsi-91x/files/onebox_util.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+# The purpose of this script is to allow
+# the rs9113 onebox_util functionality to
+# be implemented seamlessly for the rsi
+# driver.
+
+rpine=$1
+cmd=$2
+interface=$3
+
+if [[ $cmd == delete_vap ]] ; then
+ ip link set $interface down || exit 0
+ exit 0
+fi
+
+if [[ -L /sys/class/net/$interface ]] ; then
+ exit 0
+fi
+cd /sys/class/net/
+for d in wlan[0-9]* ; do
+ if ip link set $d down ; then
+ ip link set $d name $interface
+ exit 0
+ fi
+done
diff --git a/recipes-kernel/rsi-91x/files/rs9113.default b/recipes-kernel/rsi-91x/files/rs9113.default
new file mode 100644
index 0000000..ddafe92
--- /dev/null
+++ b/recipes-kernel/rsi-91x/files/rs9113.default
@@ -0,0 +1,66 @@
+#
+# Skip loading the RS9113 related drivers if
+# set to zero.
+#
+RS9113_LOAD=1
+
+# Parameters for rs9113 driver
+#
+# Enable Antenna Diversity (1)
+RSI_ANTENNA_DIVERSITY=0
+
+# COEX_MODE options:
+# 1 WLAN STATION or WLAN ACCESS POINT
+# 4 BT EDR MODE
+# 5 WLAN STATION + BT EDR MODE
+# 6 WLAN ACCESS POINT + BT EDR MODE
+# 8 BT LE MODE
+# 9 WLAN STATION + BT LE MODE
+# 10 WLAN ACCESS POINT + BT LE MODE
+# 12 BT EDR + BT LE MODE
+# 13 WLAN STATION + BT EDR MODE + BT LE MODE
+# 14 WLAN ACCESS POINT + BT EDR MODE+ BT LE MODE
+COEX_MODE=1
+
+
+# 2 – Select internal antenna
+# 3 – Select external antenna
+ANT_SEL_VAL=2
+
+RSI_ANTENNA_DIVERSITY=0
+
+# Parameters are described here:
+# https://github.com/SiliconLabs/RS911X-nLink-OSD/blob/master/rsi/rsi_91x_main.c
+#
+# RX_DATA_INACTIVE_INTERVAL
+# SLEEP_IND_GPIO_SEL"
+# ULP_GPIO_READ
+# ULP_GPIO_WRITE"
+# PS_SLEEP_TYPE
+# MAX_SP_LEN
+# ENABLED_UAPSD
+# LP_HANDSHAKE_MODE
+# ULP_HANDSHAKE_MODE
+# PEER_DIST
+# BT_FEATURE_BITMAP
+# UART_DEBUG
+# EXT_OPT
+# BLE_ROLES
+# BT_BDR_MODE
+# THREE_WIRE_COEX
+# ANCHOR_POINT_GAP
+# HOST_INTF_ON_DEMAND
+# SLEEP_CLK_SOURCE_SEL
+# FEATURE_BITMAP_9116
+# ENABLE_40MHZ_IN_2G
+# XTAL_GOOD_TIME
+# RSI_ZONE_ENABLED
+
+
+# Time to hold high, then hold low on reset during driver load reset
+SLEEPTIME=100000
+
+# Time to wait while looping for interrupt and wake-up pins
+# to go high.
+INTSLEEPTIME=100000
+
diff --git a/recipes-kernel/rsi-91x/files/rs9113.init b/recipes-kernel/rsi-91x/files/rs9113.init
new file mode 100755
index 0000000..2eb7697
--- /dev/null
+++ b/recipes-kernel/rsi-91x/files/rs9113.init
@@ -0,0 +1,130 @@
+#!/bin/bash
+# Note that none of the INIT stuff below works in the current open-embedded.
+### BEGIN INIT INFO
+# Provides: rs9116
+# Required-Start: mts-io
+# Default-Start: S
+# Default-Stop: 0 6
+# X-Start-Before: networking
+# Short-Description: load the rs9116 drivers
+# Description: rs9116 drivers are used to provide access to Bluetooth
+# and WiFi.
+### END INIT INFO
+
+CONFIG=${CONFIG:-/etc/default/rs9113}
+MTS_IODIR=/sys/devices/platform/mts-io
+RS9116_RESET=${MTS_IODIR}/wifi-bt-reset
+
+[ -f $CONFIG ] || exit 1
+
+. $CONFIG
+
+pid=$$
+LOG_ERR=3
+LOG_INFO=6
+name=rs9116
+format="%s[%d] %12.2fs: %s"
+function has_reset {
+ for i in {1..10} ; do
+ if [[ -f $RS9116_RESET ]] ; then
+ if [[ -f $RS9116_RESET ]] ; then
+ return 0
+ fi
+ return 1
+ fi
+ usleep $SLEEPTIME
+ done
+ return 1
+}
+
+function syslog {
+ pr=$1
+ shift
+ [[ $(cat /proc/uptime) =~ ([^[:space:]]+) ]]
+ s=$(printf "${format}" $name $pid ${BASH_REMATCH[1]} "$@")
+ echo "<${pr}>${s}" >/dev/kmsg
+}
+
+function logpipe {
+ OIFS="${IFS}"
+ IFS=$'\n'
+ while read ln ; do
+ syslog $1 $ln
+ done
+ IFS="${OIFS}"
+}
+
+function rs9116_reset {
+
+ for i in {1..10} ; do
+ if [[ -f $RS9116_RESET ]] ; then
+ break
+ fi
+ usleep 10000
+ done
+
+ # Reset the RS9116 chip is ready, and
+ # wait for it to settle.
+ if [[ -f $RS9116_RESET ]] ; then
+ echo 0 >$RS9116_RESET
+ usleep $SLEEPTIME
+ echo 1 >$RS9116_RESET
+ else
+ # No WiFi BT, but return 0 for development
+ return 0
+ fi
+}
+
+case "$1" in
+ start)
+ if ((RS9113_LOAD == 0)) ; then
+ # We don't want the driver loaded.
+ exit 0
+ fi
+ rs9116_reset
+ syslog $LOG_INFO "Loading rs9116 modules with COEX=$COEX_MODE and Country=$SET_COUNTRY_CODE"
+ /usr/sbin/rs9113_load_modules.sh $CONFIG
+ RETVAL=$?
+ if [ $RETVAL -eq 0 ] ; then
+ echo "OK"
+ else
+ echo "FAIL"
+ fi
+ ;;
+
+ stop)
+ syslog $LOG_INFO "Unloading rs9116 modules"
+ /usr/sbin/rs9113_remove_modules.sh
+ RETVAL=$?
+ if [ $RETVAL -eq 0 ] ; then
+ echo "OK"
+ else
+ echo "FAIL"
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ status)
+ for dir in /sys/class/net/rpine[0-9]* ; do
+ if [[ -d ${dir} ]] ; then
+ echo Driver is loaded
+ exit 0
+ fi
+ done
+ echo Driver is not loaded
+ exit 3
+ ;;
+ reset)
+ rs9116_reset
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|status|restart|reset}"
+ exit 2
+ ;;
+esac
+
+exit 0
+
diff --git a/recipes-kernel/rsi-91x/files/rs9113.reset b/recipes-kernel/rsi-91x/files/rs9113.reset
new file mode 100755
index 0000000..7992f7d
--- /dev/null
+++ b/recipes-kernel/rsi-91x/files/rs9113.reset
@@ -0,0 +1,25 @@
+#!/bin/sh
+# Reset rs9113
+# Must be done after /etc/init.d/mts-io executes, and
+# before any code that probes the USB bus.
+function do_reset {
+ if ! [[ -w /sys/devices/platform/mts-io/wifi-bt-reset ]] ; then
+ exit 0
+ fi
+ /etc/init.d/rs9113 reset
+}
+
+case $1 in
+ start)
+ do_reset
+ ;;
+ stop)
+ ;;
+ reload)
+ do_reset
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|reload}"
+ exit 2
+ ;;
+esac
diff --git a/recipes-kernel/rsi-91x/files/rs9113_load_modules.sh b/recipes-kernel/rsi-91x/files/rs9113_load_modules.sh
new file mode 100755
index 0000000..b77a781
--- /dev/null
+++ b/recipes-kernel/rsi-91x/files/rs9113_load_modules.sh
@@ -0,0 +1,189 @@
+#!/bin/bash
+
+UNBIND=/sys/devices/soc0/soc/2100000.aips-bus/2190000.usdhc/driver/unbind
+if [[ -f $UNBIND ]] ; then
+ echo 2190000.usdhc >$UNBIND
+fi
+sleep 1
+
+BIND="/sys/bus/soc/devices/soc0/soc/2100000.aips-bus/2190000.usdhc/subsystem/drivers/sdhci-esdhc-imx/bind"
+if [[ -f $BIND ]] ; then
+ echo 2190000.usdhc >$BIND
+fi
+
+defaults=/etc/default/rs9113
+usage()
+{
+ echo "Configuration values:"
+ echo " COEX_MODE"
+ echo " RSI_ANTENNA_DIVERSITY"
+ echo " ANT_SEL_VAL"
+ echo " RX_DATA_INACTIVE_INTERVAL"
+ echo " SLEEP_IND_GPIO_SEL"
+ echo " ULP_GPIO_READ"
+ echo " ULP_GPIO_WRITE"
+ echo " PS_SLEEP_TYPE"
+ echo " MAX_SP_LEN"
+ echo " ENABLED_UAPSD"
+ echo " LP_HANDSHAKE_MODE"
+ echo " ULP_HANDSHAKE_MODE"
+ echo " PEER_DIST"
+ echo " BT_FEATURE_BITMAP"
+ echo " UART_DEBUG"
+ echo " EXT_OPT"
+ echo " BLE_ROLES"
+ echo " BT_BDR_MODE"
+ echo " THREE_WIRE_COEX"
+ echo " ANCHOR_POINT_GAP"
+ echo " HOST_INTF_ON_DEMAND"
+ echo " SLEEP_CLK_SOURCE_SEL"
+ echo " FEATURE_BITMAP_9116"
+ echo " ENABLE_40MHZ_IN_2G"
+ echo " XTAL_GOOD_TIME"
+ echo " RSI_ZONE_ENABLED"
+ echo "Usage: $(basename $0) [config file]"
+ echo ""
+ echo "Config file is typically
+ /etc/default/rs9113 with the above parameters."
+ exit 1
+}
+if (($# > 1)); then
+ usage
+fi
+
+if ((${#COEX_MODE}==0)) && [[ -r $defaults ]]; then
+ set -e
+ . $defaults
+ set +e
+fi
+
+if (($# > 0)) && [[ -r $1 ]]; then
+ set -e
+ . $1
+ set +e
+fi
+
+err=0
+for x in COEX_MODE RSI_ANTENNA_DIVERSITY ANT_SEL_VAL ; do
+ if [[ -z ${!x} ]] ; then
+ echo Need to provide ${x} for configuration
+ err=1
+ fi
+done
+
+if((err)) ; then
+ usage
+fi
+cd /opt/rs9113/modules
+
+modprobe mac80211
+modprobe bluetooth
+
+# rs9116
+# dev_oper_mode
+# 1 STA or AP
+# 4 BT EDR
+# 5 STA and BT EDR
+# 6 AP and BT EDR
+# 8 BT LE
+# 9 STA and BT LE
+# 10 AP and BT LE
+# 12 BT EDR and BT LE
+# 13 STA and BT EDR and BT LE
+# 14 AP and BT EDR and BT LE
+usbd="rsi_usb.ko"
+sdiod="rsi_sdio.ko"
+rsid="rsi_91x.ko"
+
+case ${COEX_MODE} in
+ 1|2|3)
+ DEV_OPER_MODE=1
+ ;;
+ 4)
+ DEV_OPER_MODE=4
+ usbd="rsi_btusb.ko"
+ sdiod="rsi_btsdio.ko"
+ rsid="rsi_bt91x.ko"
+ ;;
+ 5)
+ DEV_OPER_MODE=5
+ ;;
+ 6)
+ DEV_OPER_MODE=6
+ ;;
+ 8)
+ DEV_OPER_MODE=8
+ usbd="rsi_btusb.ko"
+ sdiod="rsi_btsdio.ko"
+ rsid="rsi_bt91x.ko"
+ ;;
+ 9)
+ DEV_OPER_MODE=9
+ ;;
+ 10)
+ DEV_OPER_MODE=10
+ ;;
+ 12)
+ DEV_OPER_MODE=12
+ usbd="rsi_btusb.ko"
+ sdiod="rsi_btsdio.ko"
+ rsid="rsi_bt91x.ko"
+ ;;
+ 13)
+ DEV_OPER_MODE=13
+ ;;
+ 14)
+ DEV_OPER_MODE=14
+ ;;
+ *)
+ logger -s -p daemon.error "Coexistance mode $COEX_MODE does not exist"
+ usage9116
+ esac
+
+# Modes 4,8,12 require BT only driver
+
+PARAMS=" dev_oper_mode=$DEV_OPER_MODE antenna_diversity=$RSI_ANTENNA_DIVERSITY antenna_sel=$ANT_SEL_VAL"
+
+RS9116_VARS="RSI_ZONE_ENABLED LP_HANDSHAKE_MODE ULP_HANDSHAKE_MODE"
+RS9116_VARS+=" BT_FEATURE_BITMAP CONFIG_PEER_DISTANCE ENABLE_40MHZ_IN_2G"
+RS9116_VARS+=" THREE_WIRE_COEX ANCHOR_POINT_GAP HOST_INTF_ON_DEMAND"
+RS9116_VARS+=" SLEEP_CLK_SOURCE_SEL FEATURE_BITMAP_9116"
+
+
+for v in ${RS9116_VARS} ; do
+ if [[ -n ${!v} ]] ; then
+ PARAMS += ${v,,}=${!v}
+ fi
+done
+
+hosts=$(find /sys/devices -type d -name mmc_host)
+
+shim=$usbd
+for d in $hosts ; do
+ vendor=$(find $d -type f -name vendor)
+ devname=$(find $d -type f -name device)
+ if [[ -n $vendor ]] ; then
+ VENDOR=$(cat $vendor)
+ fi
+ if [[ -n $vendor ]] ; then
+ DEVNAME=$(cat $devname)
+ fi
+ if [[ $VENDOR == 0x041b ]] && [[ $DEVNAME == 0x9116 ]] ; then
+ shim=$sdiod
+ fi
+done
+
+#Use awk to split a very long line.
+if ! insmod $rsid $PARAMS ; then
+ echo "Failed: insmod $rsid $PARAMS" | awk '{printf gensub("(.{0,60})","\\1\n","g")}' | logger -s -t rs9113_load_modules.sh -p daemon.error
+fi
+insmod $shim
+# Wait for driver to load
+((count=0))
+while ((count < 10)) ; do
+ if [[ -L /sys/class/bluetooth/hci0 ]] || [[ -L /sys/class/net/wlan0 ]] ; then
+ break;
+ fi
+ usleep 100000
+ ((count++))
+done
diff --git a/recipes-kernel/rsi-91x/files/rs9113_remove_modules.sh b/recipes-kernel/rsi-91x/files/rs9113_remove_modules.sh
new file mode 100755
index 0000000..f468545
--- /dev/null
+++ b/recipes-kernel/rsi-91x/files/rs9113_remove_modules.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+killall -9 wpa_supplicant
+killall -9 hostapd
+killall -9 bluetoothd
+rm -rf /var/run/wpa_supplicant/
+sleep 2
+
+modules=" "$(lsmod)" "
+### COMMON HAL MODULES
+for mod in rsi_btsdio rsi_btusb rsi_bt91x rsi_sdio rsi_usb rsi_91x mac80211 cfg80211 bluetooth rfkill ; do
+ if [[ ${modules} =~ [[:space:]]${mod}[[:space:]] ]] ; then
+ result+=$(rmmod $mod 2>&1)
+ last=$?
+ if [[ -n $result ]] ; then
+ echo "$result" | logger -s -p daemon.notice
+ fi
+ fi
+done
+
+if ((last > 0)) ; then
+ echo "${result}" | logger -s -p daemon.notice
+ lsmod | grep rsi | logger -s -p daemon.notice
+fi
+UNBIND=/sys/devices/soc0/soc/2100000.aips-bus/2190000.usdhc/driver/unbind
+if [[ -f $UNBIND ]] ; then
+ echo 2190000.usdhc >$UNBIND
+fi
+
diff --git a/recipes-kernel/rsi-91x/files/rsi-91x-config.patch b/recipes-kernel/rsi-91x/files/rsi-91x-config.patch
new file mode 100644
index 0000000..c711698
--- /dev/null
+++ b/recipes-kernel/rsi-91x/files/rsi-91x-config.patch
@@ -0,0 +1,31 @@
+diff --git a/rsi/Makefile b/rsi/Makefile
+index 64f7742..e74d971 100644
+--- a/rsi/Makefile
++++ b/rsi/Makefile
+@@ -45,7 +45,7 @@ KERNELDIR=/lib/modules/$(KERNELRELEASE)/build
+ #CONFIG_RSI_BT_ALONE=y
+
+ # Uncomment below line for Wi-Fi BT coex mode
+-#CONFIG_RSI_COEX_MODE=y
++CONFIG_RSI_COEX_MODE=y
+
+ # Uncomment below line for WLAN + Zigbee coex mode
+ #CONFIG_RSI_ZIGB=y
+@@ -196,10 +196,15 @@ rsi_usb-objs := $(COMMON_USB_OBJS)
+ rsi_91x-objs := $(RSI_91X_OBJS)
+
+ all:
++ @echo env is:
++ env
+ @echo -e "\033[32mCompiling RSI drivers...\033[0m"
+ make -C$(KERNELDIR)/ M=$(PWD) modules
+- @echo -e "application compilation"
+- make CC="$(CC)" ROOT_DIR=$(ROOT_DIR) -C $(PWD)/apps
++ # @echo -e "application compilation"
++ # make CC="$(CC)" ROOT_DIR=$(ROOT_DIR) -C $(PWD)/apps
++
++modules_install:
++ $(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install
+
+ clean:
+ make -C$(KERNELDIR)/ M=$(PWD) clean
diff --git a/recipes-kernel/rsi-91x/files/rsi-bt91x-config.patch b/recipes-kernel/rsi-91x/files/rsi-bt91x-config.patch
new file mode 100644
index 0000000..3bda909
--- /dev/null
+++ b/recipes-kernel/rsi-91x/files/rsi-bt91x-config.patch
@@ -0,0 +1,41 @@
+diff --git a/rsi/Makefile b/rsi/Makefile
+index 64f7742..bc088b8 100644
+--- a/rsi/Makefile
++++ b/rsi/Makefile
+@@ -42,7 +42,7 @@ KERNELDIR=/lib/modules/$(KERNELRELEASE)/build
+ #CONFIG_SDIO_INTR_POLL=y
+
+ # Uncomment below line for BT alone (Classic/LE/Dual) mode
+-#CONFIG_RSI_BT_ALONE=y
++CONFIG_RSI_BT_ALONE=y
+
+ # Uncomment below line for Wi-Fi BT coex mode
+ #CONFIG_RSI_COEX_MODE=y
+@@ -190,16 +190,21 @@ ifeq ($(OFFLOAD_SCAN_TO_DEVICE), y)
+ EXTRA_CFLAGS += -DOFFLOAD_SCAN_TO_DEVICE
+ endif
+
+-obj-m := rsi_sdio.o rsi_usb.o rsi_91x.o
+-rsi_sdio-objs := $(COMMON_SDIO_OBJS)
+-rsi_usb-objs := $(COMMON_USB_OBJS)
+-rsi_91x-objs := $(RSI_91X_OBJS)
++obj-m := rsi_btsdio.o rsi_btusb.o rsi_bt91x.o
++rsi_btsdio-objs := $(COMMON_SDIO_OBJS)
++rsi_btusb-objs := $(COMMON_USB_OBJS)
++rsi_bt91x-objs := $(RSI_91X_OBJS)
+
+ all:
++ @echo env is:
++ env
+ @echo -e "\033[32mCompiling RSI drivers...\033[0m"
+ make -C$(KERNELDIR)/ M=$(PWD) modules
+- @echo -e "application compilation"
+- make CC="$(CC)" ROOT_DIR=$(ROOT_DIR) -C $(PWD)/apps
++ # @echo -e "application compilation"
++ # make CC="$(CC)" ROOT_DIR=$(ROOT_DIR) -C $(PWD)/apps
++
++modules_install:
++ $(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install
+
+ clean:
+ make -C$(KERNELDIR)/ M=$(PWD) clean
diff --git a/recipes-kernel/rsi-91x/files/rsi_91x.conf b/recipes-kernel/rsi-91x/files/rsi_91x.conf
new file mode 100644
index 0000000..6d08138
--- /dev/null
+++ b/recipes-kernel/rsi-91x/files/rsi_91x.conf
@@ -0,0 +1,14 @@
+# /etc/modules-load.d/rsi_91x
+#
+# dev_oper_mode for driver load
+# 1 STA or AP
+# 4 BT EDR
+# 5 STA and BT EDR
+# 6 AP and BT EDR
+# 8 BT LE
+# 9 STA and BT LE
+# 10 AP and BT LE
+# 12 BT EDR and BT LE
+# 13 STA and BT EDR and BT LE
+# 14 AP and BT EDR and BT LE
+options rsi_91x dev_oper_mode=1
diff --git a/recipes-kernel/rsi-91x/rs9113-fw_1.6.5.bb b/recipes-kernel/rsi-91x/rs9113-fw_1.6.5.bb
new file mode 100644
index 0000000..c3513c4
--- /dev/null
+++ b/recipes-kernel/rsi-91x/rs9113-fw_1.6.5.bb
@@ -0,0 +1,19 @@
+LICENSE = "Proprietary"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Proprietary;md5=0557f9d92cf58f2ccdd50f62f8ac0b28"
+
+PR = "r1"
+
+inherit allarch
+SRCREV = "v${PV}"
+
+SRC_URI = "https://www.multitech.net/mlinux/sources/rs9113-fw-1.6.5.tar.gz"
+SRC_URI[sha256sum] = "5d11e5859a9540364fb9b11948a4a70ea77bbe5cda9471f0db40458b691c252a"
+
+FILES_${PN} = "${nonarch_base_libdir}"
+
+do_install() {
+ cd ${WORKDIR}
+ pwd
+ install -m 0755 -d ${D}${base_libdir}/firmware/
+ install ${S}/*.rps ${D}${base_libdir}/firmware
+}
diff --git a/recipes-kernel/rsi-91x/rsi-91x-fw_2.5.1.bb b/recipes-kernel/rsi-91x/rsi-91x-fw_2.5.1.bb
new file mode 100644
index 0000000..bde9849
--- /dev/null
+++ b/recipes-kernel/rsi-91x/rsi-91x-fw_2.5.1.bb
@@ -0,0 +1,81 @@
+LIC_FILES_CHKSUM = "file://${WORKDIR}/git/rsi/Makefile;beginline=1;endline=29;md5=5eb8ffe925477437d8fcd5e2859c96a1"
+LICENSE = "BSD-3-Clause"
+PR = "r1"
+
+inherit allarch
+SRCREV = "v${PV}"
+
+SRC_URI = "git://github.com/SiliconLabs/RS911X-nLink-OSD.git;protocol=https \
+ file://rsi_91x.conf \
+ file://rs9113_load_modules.sh \
+ file://rs9113_remove_modules.sh \
+ file://rs9113.default \
+ file://rs9113.init \
+ file://rs9113.reset \
+ file://rsi_91x.conf \
+ "
+S = "${WORKDIR}/git/"
+PACKAGES =+ "rsi-91x-examples rsi-91x-reset rsi-91x-autostart"
+
+FILES_rsi-91x-examples = "/opt/rs9113/examples"
+FILES_rsi-91x-autostart = "/etc/init.d/rs9113"
+RDEPENDS_rsi-91x-autostart = "bash"
+FILES_rsi-91x-reset = "/etc/init.d/rs9113-reset"
+RDEPENDS_rsi-91x-reset = "bash"
+RDEPENDS_rsi-91x-fw = "bash"
+
+INITSCRIPT_PACKAGES = "rsi-91x-autostart rsi-91x-reset"
+INITSCRIPT_NAME_rsi-91x-autostart = "rs9113"
+INITSCRIPT_PARAMS_rsi-91x-autostart = "start 50 S ."
+
+INITSCRIPT_NAME_rsi-91x-reset = "rs9113-reset"
+INITSCRIPT_PARAMS_rsi-91x-reset = "start 40 S ."
+
+
+FILES_${PN} = "${base_libdir} ${prefix} /opt ${sysconfdir}"
+
+do_install() {
+ cd ${WORKDIR}
+ instdir="${D}/opt/rs9113"
+ install -m 0755 -d ${instdir}/tables
+ install -m 0755 -d ${D}${prefix}/sbin
+ install -m 0755 rs9113_load_modules.sh ${D}${prefix}/sbin
+ install -m 0755 rs9113_remove_modules.sh ${D}${prefix}/sbin
+ install -m 0755 -d ${D}${sysconfdir}/modprobe.d
+ install -m 0644 rsi_91x.conf ${D}${sysconfdir}/modprobe.d
+ install -m 0644 -d ${D}${sysconfdir}/default
+ install -m 0644 rs9113.default ${D}${sysconfdir}/default/rs9113
+ install -m 0755 -d ${D}${base_libdir}/firmware/
+ install ${S}/Firmware/* ${D}${base_libdir}/firmware
+ install -m 0755 -d ${D}${prefix}/share/${PN}
+ sed -n '1,29p' git/rsi/Makefile >${D}${prefix}/share/${PN}/LICENSE
+ install -m 0755 -d ${D}${sysconfdir}/init.d
+ install -m 0755 rs9113.init ${D}${sysconfdir}/init.d/rs9113
+ install -m 0755 rs9113.reset ${D}${sysconfdir}/init.d/rs9113-reset
+ install -m 0755 -d ${D}/opt/rs9113/tables
+ for f in ${S}/rsi/release/* ; do
+ if file "${f}" | grep ELF ; then
+ # Package from SiliconLabs is contaminated
+ continue
+ fi
+ install ${f} ${instdir}/tables
+ done
+ install -m 0755 -d ${instdir}/examples
+ cd ${S}/scripts
+ for d in $(find . -type d) ; do
+ install -m 0755 -d "${instdir}/examples/${d}"
+ dest="${instdir}/examples/${d}"
+ (
+ cd "${d}"
+ for f in $(find . -maxdepth 1 -type f) ; do
+ ftype=$(file "$f")
+ if file "${f}" | grep ELF ; then
+ # Package from SiliconLabs is contaminated
+ continue
+ fi
+ echo "Installing ${f} into ${instdir}/examples/${d}"
+ install -m 0644 "${f}" "${instdir}/examples/${d}"
+ done
+ )
+ done
+}
diff --git a/recipes-kernel/rsi-91x/rsi-91x-utils_2.5.1.bb b/recipes-kernel/rsi-91x/rsi-91x-utils_2.5.1.bb
new file mode 100644
index 0000000..f43d2d7
--- /dev/null
+++ b/recipes-kernel/rsi-91x/rsi-91x-utils_2.5.1.bb
@@ -0,0 +1,31 @@
+LIC_FILES_CHKSUM = "file://${WORKDIR}/git/rsi/apps/onebox_util.c;beginline=5;endline=17;md5=de9e3b7d092ee142ef090acc79db39c1"
+LICENSE = "CLOSED"
+PR = "r1"
+
+RDEPENDS_${PN} += "bash"
+
+SRCREV = "v${PV}"
+SRC_URI = "git://github.com/SiliconLabs/RS911X-nLink-OSD.git;protocol=https \
+ file://onebox_util.sh \
+ "
+S = "${WORKDIR}/git/rsi/apps"
+
+FILES_${PN} = "${base_libdir} ${prefix} /opt"
+TARGET_CC_ARCH += "${LDFLAGS}"
+do_install() {
+ instdir="${D}/opt/rs9113"
+ install -m 0755 -d ${D}${prefix}/share/${PN}
+ sed -n '5,17p' ${S}/onebox_util.c >${D}${prefix}/share/${PN}/LICENSE
+ install -m 0755 -d ${instdir}
+ cd "${S}"
+ for f in $(find . -type f) ; do
+ if file "$f" | grep ELF ; then
+ if [ "$f" = "./onebox_util" ] ; then
+ install -m 0755 $f ${instdir}/onebox_util_rsi
+ else
+ install -m 0755 $f ${instdir}
+ fi
+ fi
+ done
+ install -m 0755 ${WORKDIR}/onebox_util.sh ${instdir}/onebox_util
+}
diff --git a/recipes-kernel/rsi-91x/rsi-91x_2.5.1.bb b/recipes-kernel/rsi-91x/rsi-91x_2.5.1.bb
new file mode 100644
index 0000000..872e248
--- /dev/null
+++ b/recipes-kernel/rsi-91x/rsi-91x_2.5.1.bb
@@ -0,0 +1,34 @@
+LICENSE = "GPLv2+|BSD"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+PR = "r1"
+PKGR = "${PR}${KERNEL_MODULE_PACKAGE_SUFFIX}${EXTENDPRAUTO}"
+RPROVIDES_kernel-module-rsi-91x = "rsi-91x"
+inherit module
+
+SRCREV = "v${PV}"
+SRC_URI = "git://github.com/SiliconLabs/RS911X-nLink-OSD.git;protocol=https \
+ file://rsi-91x-config.patch;striplevel=2 \
+ "
+S = "${WORKDIR}/git/rsi"
+
+EXTRA_OEMAKE = " KERNELDIR=${STAGING_KERNEL_DIR} \
+ CROSS_COMPILE=${TARGET_PREFIX} \
+ ARCH=arm \
+ WLAN_COMPILE_FLAGS='' \
+ V=1 \
+ "
+
+PARALLEL_MAKE = ""
+PACKAGES += "kernel-module-rsi-usb kernel-module-rsi-sdio kernel-module-rsi-91x"
+INSTDIR = "/opt/rs9113/modules"
+FILES_kernel-module-rsi-usb = "${INSTDIR}/rsi_usb.ko"
+FILES_kernel-module-rsi-sdio = "${INSTDIR}/rsi_sdio.ko"
+FILES_kernel-module-rsi-91x = "${INSTDIR}/rsi_91x.ko"
+
+do_install() {
+ install -m 0755 -d ${D}${INSTDIR}
+ # use cp instead of install so the driver doesn't get stripped
+ cp ${S}/rsi_sdio.ko ${D}${INSTDIR}
+ cp ${S}/rsi_91x.ko ${D}${INSTDIR}
+ cp ${S}/rsi_usb.ko ${D}${INSTDIR}
+}
diff --git a/recipes-kernel/rsi-91x/rsi-bt91x_2.5.1.bb b/recipes-kernel/rsi-91x/rsi-bt91x_2.5.1.bb
new file mode 100644
index 0000000..044ae68
--- /dev/null
+++ b/recipes-kernel/rsi-91x/rsi-bt91x_2.5.1.bb
@@ -0,0 +1,34 @@
+LICENSE = "GPLv2+|BSD"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+PR = "r1"
+PKGR = "${PR}${KERNEL_MODULE_PACKAGE_SUFFIX}${EXTENDPRAUTO}"
+RPROVIDES_kernel-module-rsi-bt91x = "rsi-bt91x"
+inherit module
+
+SRCREV = "v${PV}"
+SRC_URI = "git://github.com/SiliconLabs/RS911X-nLink-OSD.git;protocol=https \
+ file://rsi-bt91x-config.patch;striplevel=2 \
+ "
+S = "${WORKDIR}/git/rsi"
+
+EXTRA_OEMAKE = " KERNELDIR=${STAGING_KERNEL_DIR} \
+ CROSS_COMPILE=${TARGET_PREFIX} \
+ ARCH=arm \
+ WLAN_COMPILE_FLAGS='' \
+ V=1 \
+ "
+
+PARALLEL_MAKE = ""
+PACKAGES = "kernel-module-rsi-btusb kernel-module-rsi-btsdio kernel-module-rsi-bt91x rsi-bt91x-dev rsi-bt91x-dbg"
+FILES_kernel-module-rsi-btusb = "/opt/rs9113/modules/rsi_btusb.ko"
+FILES_kernel-module-rsi-btsdio = "/opt/rs9113/modules/rsi_btsdio.ko"
+FILES_kernel-module-rsi-bt91x = "/opt/rs9113/modules/rsi_bt91x.ko"
+
+do_install() {
+ instdir="${D}/opt/rs9113/modules"
+ install -m 0755 -d "${instdir}"
+ # use cp instead of install so the driver doesn't get stripped
+ cp ${S}/rsi_btsdio.ko "${instdir}"
+ cp ${S}/rsi_bt91x.ko "${instdir}"
+ cp ${S}/rsi_btusb.ko "${instdir}"
+}