aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/base-files
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2015-12-19 11:28:36 +0000
committerFelix Fietkau <nbd@openwrt.org>2015-12-19 11:28:36 +0000
commitdda0dc3943c67133a9dd9ae7044520a8c37c9961 (patch)
treef3979c909a21e9b8b30d1e3f57c193378b739d48 /target/linux/ar71xx/base-files
parent2a7cbe0a69236c97ac0f9d370a48795944dcc341 (diff)
downloadmaster-187ad058-dda0dc3943c67133a9dd9ae7044520a8c37c9961.tar.gz
master-187ad058-dda0dc3943c67133a9dd9ae7044520a8c37c9961.tar.bz2
master-187ad058-dda0dc3943c67133a9dd9ae7044520a8c37c9961.zip
ar71xx: scan nand ubi partition for ath9k eeprom files
The MR18 stores the ath9k eeprom values on the NAND. This patch makes it possible to retrieve the images from there. Signed-off-by: Chris R Blake <chrisrblake93@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47948 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx/base-files')
-rw-r--r--target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom21
1 files changed, 21 insertions, 0 deletions
diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
index 33b1d74dc8..9d3356447a 100644
--- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
+++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
@@ -25,6 +25,21 @@ ath9k_eeprom_extract() {
ath9k_eeprom_die "failed to extract from $mtd"
}
+ath9k_ubi_eeprom_extract() {
+ local part=$1
+ local offset=$2
+ local count=$3
+ local ubidev=$(nand_find_ubi $CI_UBIPART)
+ local ubi
+
+ ubi=$(nand_find_volume $ubidev $part)
+ [ -n "$ubi" ] || \
+ ath9k_eeprom_die "no UBI volume found for $part"
+
+ dd if=/dev/$ubi of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count 2>/dev/null || \
+ ath9k_eeprom_die "failed to extract from $ubi"
+}
+
ath9k_patch_firmware_mac() {
local mac=$1
@@ -39,6 +54,8 @@ case "$FIRMWARE" in
"soc_wmac.eeprom")
case $board in
mr18)
+ . /lib/upgrade/nand.sh
+
if [ -n "$(nand_find_volume ubi0 caldata)" ]; then
ath9k_ubi_eeprom_extract "caldata" 4096 2048
else
@@ -61,6 +78,8 @@ case "$FIRMWARE" in
"pci_wmac0.eeprom")
case $board in
mr18)
+ . /lib/upgrade/nand.sh
+
if [ -n "$(nand_find_volume ubi0 caldata)" ]; then
ath9k_ubi_eeprom_extract "caldata" 20480 2048
else
@@ -82,6 +101,8 @@ case "$FIRMWARE" in
"pci_wmac1.eeprom")
case $board in
mr18)
+ . /lib/upgrade/nand.sh
+
if [ -n "$(nand_find_volume ubi0 caldata)" ]; then
ath9k_ubi_eeprom_extract "caldata" 36864 2048
else