From cc17072c91fdc59c9bc971075edec899d91e050c Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Thu, 16 May 2013 10:48:45 +0200 Subject: [PATCH] meta-digi-arm: Update atheros init script to make it platform independent. Another option would be to split it up in machine folders, but it is similar enough in all platforms not to need this for the time being. Signed-off-by: Alex Gonzalez --- .../ccardimx28js/atheros | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/meta-digi-arm/recipes-kernel/kernel-module-atheros/ccardimx28js/atheros b/meta-digi-arm/recipes-kernel/kernel-module-atheros/ccardimx28js/atheros index d73f5ebd5..b37cd6f8c 100644 --- a/meta-digi-arm/recipes-kernel/kernel-module-atheros/ccardimx28js/atheros +++ b/meta-digi-arm/recipes-kernel/kernel-module-atheros/ccardimx28js/atheros @@ -53,18 +53,22 @@ if ! cmp -s ${RAM_DRIVE}/${MAC_FILENAME} ${FIRMWARE_DIR}/${MAC_FILENAME}; then fi rm -f ${RAM_DRIVE}/${MAC_FILENAME} -# 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. -# -US_CODE="0x0" -REGION_CODE="$(cat /sys/kernel/ccardimx28/mod_cert)" -if [ -z "${REGION_CODE}" -o "${US_CODE}" = "${REGION_CODE}" ]; then - BDATA_SOURCE=Digi_6203-6233-US.bin +BDATA_SOURCE=Digi_6203-6233-World.bin +if [ -e "/sys/kernel/machine/name" ]; then + # 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. + # + US_CODE="0x0" + MACHINE="$(cat /sys/kernel/machine/name)" + REGION_CODE="$(cat /sys/kernel/${MACHINE}/mod_cert)" + if [ -z "${REGION_CODE}" -o "${US_CODE}" = "${REGION_CODE}" ]; then + BDATA_SOURCE=Digi_6203-6233-US.bin + fi else - BDATA_SOURCE=Digi_6203-6233-World.bin + logger -t atheros "Undefined machine, defaulting to world region." fi # We don't want to rewrite NAND every time we boot so only