OpenWrt – Blame information for rev 4
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
4 | office | 1 | #!/bin/sh |
2 | # Based on ar71xx 11-ath10k-caldata and 10-rt2x00-eeprom |
||
3 | |||
4 | [ -e /lib/firmware/$FIRMWARE ] && exit 0 |
||
5 | |||
6 | . /lib/functions.sh |
||
7 | . /lib/functions/system.sh |
||
8 | . /lib/upgrade/nand.sh |
||
9 | |||
10 | ath10k_caldata_die() { |
||
11 | echo "ath10k caldata: " "$*" |
||
12 | exit 1 |
||
13 | } |
||
14 | |||
15 | ath10k_caldata_extract_ubi() { |
||
16 | local part=$1 |
||
17 | local offset=$2 |
||
18 | local count=$3 |
||
19 | local ubidev=$(nand_find_ubi $CI_UBIPART) |
||
20 | local ubi |
||
21 | |||
22 | ubi=$(nand_find_volume $ubidev $part) |
||
23 | [ -n "$ubi" ] || \ |
||
24 | ath10k_caldata_die "no UBI volume found for $part" |
||
25 | |||
26 | dd if=/dev/$ubi of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count 2>/dev/null || \ |
||
27 | ath10k_caldata_die "failed to extract from $ubi" |
||
28 | } |
||
29 | |||
30 | ath10k_caldata_set_macaddr() { |
||
31 | local macaddr=$1 |
||
32 | |||
33 | macaddr_2bin $macaddr | dd of=/lib/firmware/$FIRMWARE \ |
||
34 | conv=notrunc bs=1 seek=6 count=6 |
||
35 | } |
||
36 | |||
37 | case "$FIRMWARE" in |
||
38 | "ath10k/cal-pci-0000:02:00.0.bin") |
||
39 | board=$(board_name) |
||
40 | case $board in |
||
41 | bt,homehub-v5a) |
||
42 | ath10k_caldata_extract_ubi "caldata" 20480 2116 |
||
43 | ath10k_caldata_set_macaddr $(macaddr_add $(mtd_get_mac_binary_ubi caldata 4364) +3) |
||
44 | ;; |
||
45 | *) |
||
46 | ath10k_caldata_die "board $board is not supported yet" |
||
47 | ;; |
||
48 | esac |
||
49 | ;; |
||
50 | esac |