openwrt/target/linux/brcm63xx/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
Adrian Schmutzler 5b6a809092 treewide: move calibration data extraction function to library
This moves the almost identical calibration data extraction
functions present multiple times in several targets to a single
library file /lib/functions/caldata.sh.

Functions are renamed with more generic names to merge different
variants that only differ in their names.

Most of the targets used find_mtd_chardev, while some used
find_mtd_part inside the extraction code. To merge them, the more
abundant version with find_mtd_chardev is used in the common code.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[rebase on latest master; add mpc85xx]
Signed-off-by: David Bauer <mail@david-bauer.net>
2019-10-13 21:48:58 +02:00

26 lines
400 B
Bash

#!/bin/sh
# Based on gabors ralink wisoc implementation.
[ -e /lib/firmware/$FIRMWARE ] && exit 0
. /lib/functions/caldata.sh
board=$(board_name)
case "$FIRMWARE" in
"rt2x00.eeprom" )
case $board in
hg556a_c)
caldata_extract "cal_data" 0x1fe00 0x200
;;
hg622 |\
hg655b)
caldata_extract "cal_data" 0x0 0x200
;;
*)
caldata_die "board $board is not supported yet"
;;
esac
;;
esac