mediatek: filogic: convert GL.iNet MT-6000 to NVMEM-on-MMC
[openwrt/staging/jow.git] / target / linux / mediatek / filogic / base-files / etc / hotplug.d / firmware / 11-mt76-caldata
1 #!/bin/sh
2
3 [ -e /lib/firmware/$FIRMWARE ] && exit 0
4
5 . /lib/functions/caldata.sh
6
7 board=$(board_name)
8
9 case "$FIRMWARE" in
10 "mediatek/mt7915_eeprom.bin")
11 case "$board" in
12 smartrg,sdg-8622)
13 caldata_extract_mmc "factory" 0xa0000 0x1000
14 ;;
15 esac
16 ;;
17 "mediatek/mt7916_eeprom.bin")
18 case "$board" in
19 acer,predator-w6|\
20 smartrg,sdg-8632)
21 caldata_extract_mmc "factory" 0xa0000 0x1000
22 ;;
23 esac
24 ;;
25 "mediatek/mt7981_eeprom_mt7976_dbdc.bin")
26 case "$board" in
27 cmcc,rax3000m)
28 case "$(cmdline_get_var root)" in
29 /dev/mmc*)
30 caldata_extract_mmc "factory" 0x0 0x1000
31 ;;
32 esac
33 ;;
34 ubnt,unifi-6-plus)
35 caldata_extract_mmc "factory" 0x0 0x1000
36 ;;
37 esac
38 ;;
39 "mediatek/mt7986_eeprom_mt7975_dual.bin")
40 case "$board" in
41 mercusys,mr90x-v1)
42 ln -sf /tmp/tp_data/MT7986_EEPROM.bin \
43 /lib/firmware/$FIRMWARE
44 ;;
45 smartrg,sdg-8612|\
46 smartrg,sdg-8614|\
47 smartrg,sdg-8622|\
48 smartrg,sdg-8632)
49 caldata_extract_mmc "factory" 0x0 0x1000
50 ;;
51 esac
52 ;;
53 "mediatek/mt7986_eeprom_mt7976.bin")
54 case "$board" in
55 acer,predator-w6)
56 caldata_extract_mmc "factory" 0x0 0x1000
57 ;;
58 esac
59 ;;
60 "mediatek/mt7986_eeprom_mt7976_dbdc.bin")
61 case "$board" in
62 asus,rt-ax59u|\
63 asus,tuf-ax4200)
64 CI_UBIPART="UBI_DEV"
65 caldata_extract_ubi "Factory" 0x0 0x1000
66 ;;
67 esac
68 ;;
69 "mediatek/mt7986_eeprom_mt7976_dual.bin")
70 case "$board" in
71 asus,tuf-ax6000)
72 CI_UBIPART="UBI_DEV"
73 caldata_extract_ubi "Factory" 0x0 0x1000
74 ;;
75 jdcloud,re-cp-03)
76 caldata_extract_mmc "factory" 0x0 0x1000
77 ;;
78 esac
79 ;;
80 *)
81 exit 1
82 ;;
83 esac