ramips: add support for Omnima MiniEMBWiFi board
[openwrt/svn-archive/archive.git] / target / linux / ramips / base-files / etc / hotplug.d / firmware / 10-rt2x00-eeprom
1 #!/bin/sh
2
3 rt2x00_eeprom_die() {
4 echo "rt2x00 eeprom: " "$*"
5 exit 1
6 }
7
8 rt2x00_eeprom_extract() {
9 local part=$1
10 local offset=$2
11 local count=$3
12 local mtd
13
14 . /etc/functions.sh
15
16 mtd=$(find_mtd_part $part)
17 [ -n "$mtd" ] || \
18 rt2x00_eeprom_die "no mtd device found for partition $part"
19
20 dd if=$mtd of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count || \
21 rt2x00_eeprom_die "failed to extract from $mtd"
22 }
23
24 [ -e /lib/firmware/$FIRMWARE ] && exit 0
25
26 case "$FIRMWARE" in
27 "RT288X.eeprom" | \
28 "RT305X.eeprom")
29 . /lib/ramips.sh
30
31 local board=$(ramips_board_name)
32
33 case $board in
34 dir-300-b1 | \
35 dir-600-b1 | \
36 dir-600-b2)
37 rt2x00_eeprom_extract "devdata" 16384 272
38 ;;
39
40 rt-g32-b1)
41 rt2x00_eeprom_extract "devconf" 0 272
42 ;;
43
44 f5d8235-v2)
45 rt2x00_eeprom_extract "u-boot" 262144 272
46 ;;
47
48 argus-atp52b | \
49 bc2 | \
50 fonera20n | \
51 hw550-3g | \
52 mofi3500-3gn | \
53 pwh2004 | \
54 nbg-419n | \
55 nw718 | \
56 omni-emb | \
57 rt-n15 | \
58 v22rw-2x2 | \
59 wcr-150gn | \
60 whr-g300n | \
61 wr512-3gn)
62 rt2x00_eeprom_extract "factory" 0 272
63 ;;
64
65 *)
66 rt2x00_eeprom_die "board $board is not supported yet"
67 ;;
68 esac
69 ;;
70 esac