diff --git a/meta-digi-arm/conf/machine/ccxmx51js.conf b/meta-digi-arm/conf/machine/ccxmx51js.conf index 5268f27db..edcb96120 100644 --- a/meta-digi-arm/conf/machine/ccxmx51js.conf +++ b/meta-digi-arm/conf/machine/ccxmx51js.conf @@ -18,3 +18,5 @@ MACHINE_FEATURES += " wifi" UBOOT_ENTRYPOINT_mx51 = "0x94000000" UBOOT_LOADADDRESS_mx51 = "0x94000000" + +MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "kernel-module-redpine" diff --git a/meta-digi-arm/conf/machine/ccxmx53js.conf b/meta-digi-arm/conf/machine/ccxmx53js.conf index 5b057189b..3a812672e 100644 --- a/meta-digi-arm/conf/machine/ccxmx53js.conf +++ b/meta-digi-arm/conf/machine/ccxmx53js.conf @@ -18,3 +18,5 @@ MACHINE_FEATURES += " wifi" UBOOT_ENTRYPOINT_mx53 = "0x70800000" UBOOT_LOADADDRESS_mx53 = "0x70800000" + +MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "kernel-module-redpine" diff --git a/meta-digi-arm/recipes-kernel/kernel-module-redpine/files/redpine b/meta-digi-arm/recipes-kernel/kernel-module-redpine/files/redpine new file mode 100644 index 000000000..5258e4186 --- /dev/null +++ b/meta-digi-arm/recipes-kernel/kernel-module-redpine/files/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 diff --git a/meta-digi-arm/recipes-kernel/kernel-module-redpine/kernel-module-redpine_git.bb b/meta-digi-arm/recipes-kernel/kernel-module-redpine/kernel-module-redpine_git.bb new file mode 100644 index 000000000..73a792760 --- /dev/null +++ b/meta-digi-arm/recipes-kernel/kernel-module-redpine/kernel-module-redpine_git.bb @@ -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)" diff --git a/meta-digi-del/classes/del-image.bbclass b/meta-digi-del/classes/del-image.bbclass index be97a1c4d..d849e7ba8 100644 --- a/meta-digi-del/classes/del-image.bbclass +++ b/meta-digi-del/classes/del-image.bbclass @@ -5,3 +5,4 @@ PACKAGE_GROUP_del-audio = "task-del-audio" PACKAGE_GROUP_del-gstreamer = "task-del-gstreamer" PACKAGE_GROUP_del-network = "task-del-network" +PACKAGE_GROUP_del-wireless = "task-del-wireless" diff --git a/meta-digi-del/recipes-connectivity/tasks/task-del-wireless.bb b/meta-digi-del/recipes-connectivity/tasks/task-del-wireless.bb new file mode 100644 index 000000000..103316071 --- /dev/null +++ b/meta-digi-del/recipes-connectivity/tasks/task-del-wireless.bb @@ -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}" + + diff --git a/meta-digi-del/recipes-core/images/del-image-minimal.bb b/meta-digi-del/recipes-core/images/del-image-minimal.bb index cf95f9dc7..4f84c9067 100644 --- a/meta-digi-del/recipes-core/images/del-image-minimal.bb +++ b/meta-digi-del/recipes-core/images/del-image-minimal.bb @@ -20,6 +20,7 @@ IMAGE_FEATURES = "ssh-server-dropbear" IMAGE_FEATURES += "del-audio" IMAGE_FEATURES += "del-gstreamer" 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. # This override will use the shadow file instead.