meta-digi: Add the redpine wireless driver.
This included the recipe where the driver is cloned from git and compiled from source. The recipe also copies the firmware files and the if-pre-up scrip. Pending is the recipe to link from precompiled objects in a .tar.gz file. Signed-off-by: Alex Gonzalez <alex.gonzalez@digi.com>
This commit is contained in:
parent
60fb77c8c7
commit
f305d31d6f
|
|
@ -18,3 +18,5 @@ MACHINE_FEATURES += " wifi"
|
||||||
|
|
||||||
UBOOT_ENTRYPOINT_mx51 = "0x94000000"
|
UBOOT_ENTRYPOINT_mx51 = "0x94000000"
|
||||||
UBOOT_LOADADDRESS_mx51 = "0x94000000"
|
UBOOT_LOADADDRESS_mx51 = "0x94000000"
|
||||||
|
|
||||||
|
MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "kernel-module-redpine"
|
||||||
|
|
|
||||||
|
|
@ -18,3 +18,5 @@ MACHINE_FEATURES += " wifi"
|
||||||
|
|
||||||
UBOOT_ENTRYPOINT_mx53 = "0x70800000"
|
UBOOT_ENTRYPOINT_mx53 = "0x70800000"
|
||||||
UBOOT_LOADADDRESS_mx53 = "0x70800000"
|
UBOOT_LOADADDRESS_mx53 = "0x70800000"
|
||||||
|
|
||||||
|
MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "kernel-module-redpine"
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,117 @@
|
||||||
|
#!/bin/sh -l
|
||||||
|
#===============================================================================
|
||||||
|
#
|
||||||
|
# redpine_pre-up
|
||||||
|
#
|
||||||
|
# Copyright (C) 2012 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: Load Redpine's wireless driver
|
||||||
|
#
|
||||||
|
#===============================================================================
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Driver Mode
|
||||||
|
# (1) WiFi mode
|
||||||
|
# (2) RF Eval mode
|
||||||
|
#DRIVER_MODE="1"
|
||||||
|
|
||||||
|
# BT Coexistence
|
||||||
|
# (0) disable
|
||||||
|
# (1) enable
|
||||||
|
#BT_COEXISTENCE="0"
|
||||||
|
|
||||||
|
# SDIO Clock frequency (MHz)
|
||||||
|
#SDIO_CLK="20"
|
||||||
|
|
||||||
|
# High speed mode
|
||||||
|
# (0) disable
|
||||||
|
# (1) enable
|
||||||
|
#ENABLE_HIGH_SPEED="0"
|
||||||
|
|
||||||
|
# TCP/UDP checksum offload
|
||||||
|
# (0) disable
|
||||||
|
# (1) enable
|
||||||
|
#TCP_CSUM_OFFLD="1"
|
||||||
|
|
||||||
|
# Debug Level
|
||||||
|
# (0) quiet
|
||||||
|
# (debug mask)
|
||||||
|
#DEBUG="0"
|
||||||
|
|
||||||
|
## == Nothing to customize below this line == ##
|
||||||
|
|
||||||
|
[ "${IFACE}" != "wlan0" ] && exit 0
|
||||||
|
|
||||||
|
FIRMWARE_DIR="/lib/firmware/redpine/"
|
||||||
|
|
||||||
|
#MAC_ADDR="$(nvram print module ethaddr2 | sed 's,ethaddr2=,,g')"
|
||||||
|
|
||||||
|
# TODO: Hardcoded until passed to kernel command line from U-Boot.
|
||||||
|
MAC_ADDR="00:04:F3:AA:BB:05"
|
||||||
|
|
||||||
|
# TODO: Read wdmode from NVRAM or pass in kernel command line.
|
||||||
|
# Driver mode variable in u-boot takes precedence (for test purposes)
|
||||||
|
#wdmode="$(ubootenv -p wdmode | sed 's,^wdmode=,,g')"
|
||||||
|
#[ "${wdmode}" = "1" -o "${wdmode}" = "2" ] && DRIVER_MODE="${wdmode}"
|
||||||
|
|
||||||
|
# Crystal frequency depends on the platform and HW revision.
|
||||||
|
#
|
||||||
|
# +---------------------+--------------+
|
||||||
|
# | platform | crystal_freq |
|
||||||
|
# +---------------------+--------------+
|
||||||
|
# | cwme9210js | 20000000 |
|
||||||
|
# | ccwmx51js (rev = 0) | 20000000 |
|
||||||
|
# | ccwmx51js (rev > 0) | 40000000 |
|
||||||
|
# | ccwmx53js | 40000000 |
|
||||||
|
# +---------------------+--------------+
|
||||||
|
#
|
||||||
|
# Default is 20MHz, so in that case we don't need to set the parameter on load.
|
||||||
|
read -r platform < /sys/kernel/machine/name
|
||||||
|
if [ "${platform}" = "ccxmx53" ]; then
|
||||||
|
CRYSTAL_FREQ=40000000
|
||||||
|
else
|
||||||
|
mod_rev="/sys/kernel/ccwmx51/mod_rev"
|
||||||
|
[ -f "${mod_rev}" ] && [ "$(cat ${mod_rev})" -gt "0" ] && CRYSTAL_FREQ=40000000
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Master module kernel parameters
|
||||||
|
[ -n "${DRIVER_MODE}" ] && \
|
||||||
|
master_params="${master_params} driver_mode=${DRIVER_MODE}"
|
||||||
|
[ -n "${BT_COEXISTENCE}" ] && \
|
||||||
|
master_params="${master_params} BT_Coexistence=${BT_COEXISTENCE}"
|
||||||
|
[ -n "${SDIO_CLK}" ] && \
|
||||||
|
master_params="${master_params} sdio_clock=${SDIO_CLK}"
|
||||||
|
[ -n "${ENABLE_HIGH_SPEED}" ] && \
|
||||||
|
master_params="${master_params} enable_high_speed=${ENABLE_HIGH_SPEED}"
|
||||||
|
[ -n "${TCP_CSUM_OFFLD}" ] && \
|
||||||
|
master_params="${master_params} tcp_csumoffld_enable=${TCP_CSUM_OFFLD}"
|
||||||
|
[ -n "${FIRMWARE_DIR}" ] && \
|
||||||
|
master_params="${master_params} firmware_path=${FIRMWARE_DIR}"
|
||||||
|
[ -n "${DEBUG}" ] && \
|
||||||
|
master_params="${master_params} dbg_level=${DEBUG}"
|
||||||
|
|
||||||
|
# Client module kernel parameters
|
||||||
|
[ -n "${CRYSTAL_FREQ}" ] && \
|
||||||
|
client_params="${client_params} crystal_freq=${CRYSTAL_FREQ}"
|
||||||
|
[ -n "${MAC_ADDR}" ] && \
|
||||||
|
client_params="${client_params} macaddr=${MAC_ADDR}"
|
||||||
|
|
||||||
|
# Load the client module
|
||||||
|
grep -qs rsi_client /proc/modules || \
|
||||||
|
/sbin/modprobe -q rsi_client ${client_params} || \
|
||||||
|
echo "Loading rsi_client module: [FAILED]"
|
||||||
|
|
||||||
|
# Load the master module
|
||||||
|
grep -qs rsi_master /proc/modules || \
|
||||||
|
/sbin/modprobe -q rsi_master ${master_params} || \
|
||||||
|
echo "Loading rsi_master module: [FAILED]"
|
||||||
|
|
||||||
|
# Delay required so the interface 'wlan0' is settled down before trying to configure it.
|
||||||
|
sleep 1
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
DESCRIPTION = "Redpine's wireless driver"
|
||||||
|
LICENSE = "Proprietary"
|
||||||
|
LIC_FILES_CHKSUM = "file://RS.GENR.LNX.SD_NON_GPL/include/ganges_faf.h;endline=6;md5=2b5a9aab5291bd86a1103ca1165f9afa"
|
||||||
|
|
||||||
|
inherit module
|
||||||
|
|
||||||
|
PR = "r0"
|
||||||
|
|
||||||
|
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
|
||||||
|
SRCREV = "del-5.9.2.1"
|
||||||
|
SRC_URI = "${DIGI_LOG_GIT}linux-modules/redpine.git;protocol=git \
|
||||||
|
file://redpine"
|
||||||
|
|
||||||
|
S = "${WORKDIR}/git"
|
||||||
|
|
||||||
|
EXTRA_OEMAKE += "-C ${STAGING_KERNEL_DIR} M=${S} CONFIG_DEL_KMOD_REDPINE=y"
|
||||||
|
|
||||||
|
do_install_append() {
|
||||||
|
install -d ${D}${sysconfdir}/network/if-pre-up.d
|
||||||
|
install -m 0755 ${WORKDIR}/redpine ${D}${sysconfdir}/network/if-pre-up.d/
|
||||||
|
install -d ${D}/lib/firmware/redpine
|
||||||
|
install -m 0755 ${S}/RS.GENR.LNX.SD_GPL/OSD/LINUX/release/tadm ${D}/lib/firmware/redpine/
|
||||||
|
install -m 0755 ${S}/RS.GENR.LNX.SD_GPL/OSD/LINUX/release/taim ${D}/lib/firmware/redpine/
|
||||||
|
install -m 0755 ${S}/RS.GENR.LNX.SD_GPL/OSD/LINUX/release/instructionSet ${D}/lib/firmware/redpine/
|
||||||
|
}
|
||||||
|
|
||||||
|
FILES_${PN} += " /lib/firmware/redpine/tadm \
|
||||||
|
/lib/firmware/redpine/taim \
|
||||||
|
/lib/firmware/redpine/instructionSet "
|
||||||
|
|
||||||
|
COMPATIBLE_MACHINE = "(ccxmx51js|ccxmx53js)"
|
||||||
|
|
@ -5,3 +5,4 @@
|
||||||
PACKAGE_GROUP_del-audio = "task-del-audio"
|
PACKAGE_GROUP_del-audio = "task-del-audio"
|
||||||
PACKAGE_GROUP_del-gstreamer = "task-del-gstreamer"
|
PACKAGE_GROUP_del-gstreamer = "task-del-gstreamer"
|
||||||
PACKAGE_GROUP_del-network = "task-del-network"
|
PACKAGE_GROUP_del-network = "task-del-network"
|
||||||
|
PACKAGE_GROUP_del-wireless = "task-del-wireless"
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
#
|
||||||
|
# Copyright (C) 2012 Digi International.
|
||||||
|
#
|
||||||
|
DESCRIPTION = "Wireless task for DEL image"
|
||||||
|
LICENSE = "MIT"
|
||||||
|
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
|
||||||
|
PACKAGE_ARCH = "${MACHINE_ARCH}"
|
||||||
|
ALLOW_EMPTY = "1"
|
||||||
|
PR = "r0"
|
||||||
|
|
||||||
|
#
|
||||||
|
# Set by the machine configuration with packages essential for device bootup
|
||||||
|
#
|
||||||
|
MACHINE_ESSENTIAL_EXTRA_RDEPENDS ?= ""
|
||||||
|
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS ?= ""
|
||||||
|
|
||||||
|
PACKAGES = "\
|
||||||
|
task-del-wireless \
|
||||||
|
task-del-wireless-dbg \
|
||||||
|
task-del-wireless-dev \
|
||||||
|
"
|
||||||
|
|
||||||
|
RDEPENDS_task-del-wireless = "\
|
||||||
|
wpa-supplicant \
|
||||||
|
wireless-tools \
|
||||||
|
${MACHINE_ESSENTIAL_EXTRA_RDEPENDS}"
|
||||||
|
|
||||||
|
RRECOMMENDS_task-del-wireless = "\
|
||||||
|
${MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS}"
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -20,6 +20,7 @@ IMAGE_FEATURES = "ssh-server-dropbear"
|
||||||
IMAGE_FEATURES += "del-audio"
|
IMAGE_FEATURES += "del-audio"
|
||||||
IMAGE_FEATURES += "del-gstreamer"
|
IMAGE_FEATURES += "del-gstreamer"
|
||||||
IMAGE_FEATURES += "del-network"
|
IMAGE_FEATURES += "del-network"
|
||||||
|
IMAGE_FEATURES += '${@base_contains("MACHINE_FEATURES", "wifi", "del-wireless", "", d)}'
|
||||||
|
|
||||||
# core-image disables the root password if debug-tweak is not enabled.
|
# core-image disables the root password if debug-tweak is not enabled.
|
||||||
# This override will use the shadow file instead.
|
# This override will use the shadow file instead.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue