From eb5f07b1547fce4475b8d829d9c1ca0dc9566256 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Wed, 16 Jul 2014 12:24:56 +0200 Subject: [PATCH] kernel-module-atheros: generalize using platform family https://jira.digi.com/browse/DEL-1105 Signed-off-by: Javier Viguera --- .../kernel-module-atheros.bb | 6 +- .../{ccardimx28js => }/atheros | 0 .../Digi_6203-6233-US.bin | Bin .../kernel-module-atheros/ccimx6adpt/atheros | 102 ------------------ .../ccimx6sbc/Digi_6203-6233-US.bin | Bin 2048 -> 0 bytes .../kernel-module-atheros/ccimx6sbc/atheros | 102 ------------------ 6 files changed, 3 insertions(+), 207 deletions(-) rename meta-digi-arm/recipes-kernel/kernel-module-atheros/kernel-module-atheros/{ccardimx28js => }/atheros (100%) rename meta-digi-arm/recipes-kernel/kernel-module-atheros/kernel-module-atheros/{ccimx6adpt => ccimx6}/Digi_6203-6233-US.bin (100%) delete mode 100644 meta-digi-arm/recipes-kernel/kernel-module-atheros/kernel-module-atheros/ccimx6adpt/atheros delete mode 100644 meta-digi-arm/recipes-kernel/kernel-module-atheros/kernel-module-atheros/ccimx6sbc/Digi_6203-6233-US.bin delete mode 100644 meta-digi-arm/recipes-kernel/kernel-module-atheros/kernel-module-atheros/ccimx6sbc/atheros diff --git a/meta-digi-arm/recipes-kernel/kernel-module-atheros/kernel-module-atheros.bb b/meta-digi-arm/recipes-kernel/kernel-module-atheros/kernel-module-atheros.bb index f28604a7a..b08466143 100644 --- a/meta-digi-arm/recipes-kernel/kernel-module-atheros/kernel-module-atheros.bb +++ b/meta-digi-arm/recipes-kernel/kernel-module-atheros/kernel-module-atheros.bb @@ -27,7 +27,7 @@ SRC_URI += " \ " # MX6 wireless calibration file -SRC_URI_append_mx6 = " file://Digi_6203-6233-US.bin" +SRC_URI_append_ccimx6 = " file://Digi_6203-6233-US.bin" S = "${WORKDIR}/git" @@ -37,7 +37,7 @@ do_configure_prepend() { cp ${WORKDIR}/Makefile ${S}/ } -do_configure_prepend_mx6() { +do_configure_prepend_ccimx6() { cp ${WORKDIR}/Digi_6203-6233-US.bin ${S}/Firmware_Package/target/AR6003/hw2.1.1/ } @@ -58,4 +58,4 @@ FILES_${PN} += " \ " PACKAGE_ARCH = "${MACHINE_ARCH}" -COMPATIBLE_MACHINE = "(mxs|mx6)" +COMPATIBLE_MACHINE = "(ccardimx28|ccimx6)" diff --git a/meta-digi-arm/recipes-kernel/kernel-module-atheros/kernel-module-atheros/ccardimx28js/atheros b/meta-digi-arm/recipes-kernel/kernel-module-atheros/kernel-module-atheros/atheros similarity index 100% rename from meta-digi-arm/recipes-kernel/kernel-module-atheros/kernel-module-atheros/ccardimx28js/atheros rename to meta-digi-arm/recipes-kernel/kernel-module-atheros/kernel-module-atheros/atheros diff --git a/meta-digi-arm/recipes-kernel/kernel-module-atheros/kernel-module-atheros/ccimx6adpt/Digi_6203-6233-US.bin b/meta-digi-arm/recipes-kernel/kernel-module-atheros/kernel-module-atheros/ccimx6/Digi_6203-6233-US.bin similarity index 100% rename from meta-digi-arm/recipes-kernel/kernel-module-atheros/kernel-module-atheros/ccimx6adpt/Digi_6203-6233-US.bin rename to meta-digi-arm/recipes-kernel/kernel-module-atheros/kernel-module-atheros/ccimx6/Digi_6203-6233-US.bin diff --git a/meta-digi-arm/recipes-kernel/kernel-module-atheros/kernel-module-atheros/ccimx6adpt/atheros b/meta-digi-arm/recipes-kernel/kernel-module-atheros/kernel-module-atheros/ccimx6adpt/atheros deleted file mode 100644 index 232cc5569..000000000 --- a/meta-digi-arm/recipes-kernel/kernel-module-atheros/kernel-module-atheros/ccimx6adpt/atheros +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/sh -#=============================================================================== -# -# 10-atheros_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 Atheros' wireless driver -# -#=============================================================================== - -set -e - -[ "${IFACE}" != "wlan0" ] && exit 0 - -FIRMWARE_DIR="/lib/firmware/ath6k/AR6003/hw2.1.1" - -# -# Get the wlan MAC address from kernel command line. Use a default -# value if the address has not been set. -# -if [ -f "/proc/device-tree/wireless/mac-address" ]; then - MAC_ADDR="$(hexdump -ve '1/1 "%02X" ":"' /proc/device-tree/wireless/mac-address | sed 's/:$//g')" -else - MAC_ADDR="$(sed -ne 's,^.*ethaddr2=\([^[:blank:]]\+\)[:blank:]*.*,\1,g;T;p' /proc/cmdline)" -fi -if [ -z "${MAC_ADDR}" -o "${MAC_ADDR}" = "00:00:00:00:00:00" ]; then - MAC_ADDR="00:04:F3:4C:B1:D3" -fi - -# We need to write the WLAN MAC address to softmac in the ath6k firmware -# directory. However, we don't want to rewrite the file if it already exists -# and the address is the same because we don't want to wear out NAND flash. -# -# So create the file on the RAM DRIVE first and compare the two. Only update -# the copy on NAND if the address has changed. -# -mac1="$(echo ${MAC_ADDR} | cut -d':' -f1)" -mac2="$(echo ${MAC_ADDR} | cut -d':' -f2)" -mac3="$(echo ${MAC_ADDR} | cut -d':' -f3)" -mac4="$(echo ${MAC_ADDR} | cut -d':' -f4)" -mac5="$(echo ${MAC_ADDR} | cut -d':' -f5)" -mac6="$(echo ${MAC_ADDR} | cut -d':' -f6)" - -TMP_MACFILE="$(mktemp -t softmac.XXXXXX)" -printf "\x${mac1}\x${mac2}\x${mac3}\x${mac4}\x${mac5}\x${mac6}" > ${TMP_MACFILE} -if ! cmp -s ${TMP_MACFILE} ${FIRMWARE_DIR}/softmac; then - cp ${TMP_MACFILE} ${FIRMWARE_DIR}/softmac -fi -rm -f ${TMP_MACFILE} - -# Figure out which wireless region we are in. The US has rules for -# what channels can be used and at what power level. We use a different set of -# rules for the other regions in the world that we sell into. The mod_cert field -# in OTP will be set to 0x0 for the US. Once we know the region, make sure the -# appropriate calibration file is loaded. -# -MACHINE="$(cat /proc/device-tree/digi,machine,name 2>/dev/null || \ - cat /sys/kernel/machine/name)" -REGION_CODE="$(cat /proc/device-tree/digi,hwid,cert 2>/dev/null || \ - cat /sys/kernel/${MACHINE}/mod_cert)" -US_CODE="0x0" -BDATA_SOURCE="Digi_6203-6233-World.bin" -if [ -n "${REGION_CODE}" -a "${US_CODE}" = "${REGION_CODE}" ]; then - BDATA_SOURCE="Digi_6203-6233-US.bin" - logger -t atheros "Setting US wireless region." -else - logger -t atheros "Setting non-US (world) wireless region." -fi - -# We don't want to rewrite NAND every time we boot so only -# change the link if it is wrong. -BDATA_LINK="${FIRMWARE_DIR}/bdata.bin" -if [ ! -e "${BDATA_LINK}" ] || ! cmp -s "${BDATA_LINK}" "${FIRMWARE_DIR}/${BDATA_SOURCE}"; then - ln -sf "${BDATA_SOURCE}" "${BDATA_LINK}" -fi - -# Load 'cfg80211' and let it settle down (needed by 'ath6kl_sdio') -modprobe -q cfg80211 && sleep 0.2 - -# ath6kl_sdio.ko -if ! grep -qs ath6kl_sdio /proc/modules; then - RETRIES="5" - while [ "${RETRIES}" -gt "0" ]; do - modprobe --ignore-install -q ath6kl_sdio || true - [ -d "/sys/class/net/wlan0" ] && break - RETRIES="$((RETRIES - 1))" - rmmod ath6kl_sdio > /dev/null - echo "Retrying to load wireless" - sleep 2 - done - [ "${RETRIES}" -eq "0" ] && echo "Loading ath6kl_sdio module: [FAILED]" -fi - -# Delay required for the interface 'wlan0' to settle down before trying to configure it. -sleep 0.5 diff --git a/meta-digi-arm/recipes-kernel/kernel-module-atheros/kernel-module-atheros/ccimx6sbc/Digi_6203-6233-US.bin b/meta-digi-arm/recipes-kernel/kernel-module-atheros/kernel-module-atheros/ccimx6sbc/Digi_6203-6233-US.bin deleted file mode 100644 index fdacbe6af1ab174875c26d3155e35bf3635a14f5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2048 zcmZSJU|_J30~cI93Il4tgNsU#l8TD5k&=>5k3kEGGZAZVhe~k3nKo5)SwYSbqWe{GGZbT zFa}T)M5G7C0Ga?1*$ZO;jf04QO#>P0CkF&FQX(Q@Fh(4V(FbF!gE98Q7{_4@xH$#D zfKl23B7iJ8xlRzV21I}*WMm{HfI>=2AO=tv!oVZNARs0oC?qQG;O6M$YG7tzXk=;* zaxQ~UO+ZaXO;62&nk_YZYtGi7^ZjbVYSL=@YUb6ftJz<3yr!V0v}RGwe_-%IAR&HL zO?}Peni+5%UO@X|fHuPPqw_)Lt*O}omxu6Ss{b>9_z2Vf1KkfYjX3v%Ou=T}8n|tk z^62gd2O1v2Cu70c|9C(_-x?Iz@AWBmm;W=kxw*Q#Iy?QZOVRrEpTXVD-NW74>2F<% z=LaCq#o5)_!R}LC>ho>?8N56_y}jIA@i<{rijE=hsy@xG|38n5zrVAeW5DbBG^Q#4 zd7->Fb!ppY{1`RS diff --git a/meta-digi-arm/recipes-kernel/kernel-module-atheros/kernel-module-atheros/ccimx6sbc/atheros b/meta-digi-arm/recipes-kernel/kernel-module-atheros/kernel-module-atheros/ccimx6sbc/atheros deleted file mode 100644 index 232cc5569..000000000 --- a/meta-digi-arm/recipes-kernel/kernel-module-atheros/kernel-module-atheros/ccimx6sbc/atheros +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/sh -#=============================================================================== -# -# 10-atheros_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 Atheros' wireless driver -# -#=============================================================================== - -set -e - -[ "${IFACE}" != "wlan0" ] && exit 0 - -FIRMWARE_DIR="/lib/firmware/ath6k/AR6003/hw2.1.1" - -# -# Get the wlan MAC address from kernel command line. Use a default -# value if the address has not been set. -# -if [ -f "/proc/device-tree/wireless/mac-address" ]; then - MAC_ADDR="$(hexdump -ve '1/1 "%02X" ":"' /proc/device-tree/wireless/mac-address | sed 's/:$//g')" -else - MAC_ADDR="$(sed -ne 's,^.*ethaddr2=\([^[:blank:]]\+\)[:blank:]*.*,\1,g;T;p' /proc/cmdline)" -fi -if [ -z "${MAC_ADDR}" -o "${MAC_ADDR}" = "00:00:00:00:00:00" ]; then - MAC_ADDR="00:04:F3:4C:B1:D3" -fi - -# We need to write the WLAN MAC address to softmac in the ath6k firmware -# directory. However, we don't want to rewrite the file if it already exists -# and the address is the same because we don't want to wear out NAND flash. -# -# So create the file on the RAM DRIVE first and compare the two. Only update -# the copy on NAND if the address has changed. -# -mac1="$(echo ${MAC_ADDR} | cut -d':' -f1)" -mac2="$(echo ${MAC_ADDR} | cut -d':' -f2)" -mac3="$(echo ${MAC_ADDR} | cut -d':' -f3)" -mac4="$(echo ${MAC_ADDR} | cut -d':' -f4)" -mac5="$(echo ${MAC_ADDR} | cut -d':' -f5)" -mac6="$(echo ${MAC_ADDR} | cut -d':' -f6)" - -TMP_MACFILE="$(mktemp -t softmac.XXXXXX)" -printf "\x${mac1}\x${mac2}\x${mac3}\x${mac4}\x${mac5}\x${mac6}" > ${TMP_MACFILE} -if ! cmp -s ${TMP_MACFILE} ${FIRMWARE_DIR}/softmac; then - cp ${TMP_MACFILE} ${FIRMWARE_DIR}/softmac -fi -rm -f ${TMP_MACFILE} - -# Figure out which wireless region we are in. The US has rules for -# what channels can be used and at what power level. We use a different set of -# rules for the other regions in the world that we sell into. The mod_cert field -# in OTP will be set to 0x0 for the US. Once we know the region, make sure the -# appropriate calibration file is loaded. -# -MACHINE="$(cat /proc/device-tree/digi,machine,name 2>/dev/null || \ - cat /sys/kernel/machine/name)" -REGION_CODE="$(cat /proc/device-tree/digi,hwid,cert 2>/dev/null || \ - cat /sys/kernel/${MACHINE}/mod_cert)" -US_CODE="0x0" -BDATA_SOURCE="Digi_6203-6233-World.bin" -if [ -n "${REGION_CODE}" -a "${US_CODE}" = "${REGION_CODE}" ]; then - BDATA_SOURCE="Digi_6203-6233-US.bin" - logger -t atheros "Setting US wireless region." -else - logger -t atheros "Setting non-US (world) wireless region." -fi - -# We don't want to rewrite NAND every time we boot so only -# change the link if it is wrong. -BDATA_LINK="${FIRMWARE_DIR}/bdata.bin" -if [ ! -e "${BDATA_LINK}" ] || ! cmp -s "${BDATA_LINK}" "${FIRMWARE_DIR}/${BDATA_SOURCE}"; then - ln -sf "${BDATA_SOURCE}" "${BDATA_LINK}" -fi - -# Load 'cfg80211' and let it settle down (needed by 'ath6kl_sdio') -modprobe -q cfg80211 && sleep 0.2 - -# ath6kl_sdio.ko -if ! grep -qs ath6kl_sdio /proc/modules; then - RETRIES="5" - while [ "${RETRIES}" -gt "0" ]; do - modprobe --ignore-install -q ath6kl_sdio || true - [ -d "/sys/class/net/wlan0" ] && break - RETRIES="$((RETRIES - 1))" - rmmod ath6kl_sdio > /dev/null - echo "Retrying to load wireless" - sleep 2 - done - [ "${RETRIES}" -eq "0" ] && echo "Loading ath6kl_sdio module: [FAILED]" -fi - -# Delay required for the interface 'wlan0' to settle down before trying to configure it. -sleep 0.5