c535747235ceb6038916a2cf15af3a43ff8d0555
[openwrt/openwrt.git] / target / linux / omap24xx / base-files / etc / hotplug.d / firmware / 20-p54spi-eeprom
1 #!/bin/sh
2
3 p54spi_eeprom_clean() {
4 rm -f /tmp/wlan-iq-align /tmp/wlan-tx-gen2
5 }
6
7 p54spi_eeprom_die() {
8 echo "$*"
9 p54spi_eeprom_clean
10 exit 1
11 }
12
13 p54spi_eeprom_extract() {
14 [ -x /usr/bin/calvaria -a -x /usr/bin/cal2p54 ] && {
15 /usr/bin/calvaria -p -n wlan-iq-align -i last /dev/mtdblock1 >/tmp/wlan-iq-align ||\
16 p54spi_eeprom_die "p54spi EEPROM: Failed to extract wlan-iq-align"
17 /usr/bin/calvaria -p -n wlan-tx-gen2 -i last /dev/mtdblock1 >/tmp/wlan-tx-gen2 ||\
18 p54spi_eeprom_die "p54spi EEPROM: Failed to extract wlan-tx-gen2"
19 /usr/bin/cal2p54 /tmp/wlan-tx-gen2 /tmp/wlan-iq-align >/lib/firmware/3826.eeprom ||\
20 p54spi_eeprom_die "p54spi EEPROM: Failed to generate EEPROM"
21 p54spi_eeprom_clean
22 }
23 }
24
25 . /lib/functions.sh
26
27 [ "$FIRMWARE" = "3826.eeprom" ] && {
28 [ "$(board_name)" != "nokia,n810" ] || {
29 [ -e /lib/firmware/3826.eeprom ] ||\
30 p54spi_eeprom_extract
31 }
32 }