source: trunk/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom @ 31144

Last change on this file since 31144 was 31144, checked in by jow, 5 years ago

ramips: add support for the ARC FreeStation5 board, also fix WCR-150GN network setup while we're at it - thanks Pau Escrich <p4u@…> for the implementation

File size: 1.5 KB
Line 
1#!/bin/sh
2
3rt2x00_eeprom_die() {
4        echo "rt2x00 eeprom: " "$*"
5        exit 1
6}
7
8rt2x00_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. /lib/ramips.sh
27
28board=$(ramips_board_name)
29
30case "$FIRMWARE" in
31"RT288X.eeprom" | \
32"RT305X.eeprom" | \
33"RT3883.eeprom")
34        case $board in
35        dir-300-b1 | \
36        dir-600-b1 | \
37        dir-600-b2)
38                rt2x00_eeprom_extract "devdata" 16384 272
39                ;;
40
41        rt-n10-plus | \
42        rt-g32-b1)
43                rt2x00_eeprom_extract "devconf" 0 272
44                ;;
45
46        f5d8235-v1 | \
47        f5d8235-v2)
48                rt2x00_eeprom_extract "u-boot" 262144 272
49                ;;
50
51        all0256n | \
52        argus-atp52b | \
53        bc2 | \
54        esr-9753 | \
55        fonera20n | \
56        freestation5 | \
57        hw550-3g | \
58        mofi3500-3gn | \
59        pwh2004 | \
60        nbg-419n | \
61        nw718 | \
62        omni-emb | \
63        rt-n15 | \
64        rt-n56u | \
65        sl-r7205 | \
66        v11st-fe | \
67        v22rw-2x2 | \
68        w502u | \
69        wcr-150gn | \
70        whr-g300n | \
71        wl-330n | \
72        wl-351 | \
73        wli-tx4-ag300n | \
74        wr512-3gn | \
75        wr6202 | \
76        xdxrn502j)
77                rt2x00_eeprom_extract "factory" 0 272
78                ;;
79
80        wl341v3)
81                rt2x00_eeprom_extract "board-nvram" 64880 272
82                ;;
83
84        *)
85                rt2x00_eeprom_die "board $board is not supported yet"
86                ;;
87        esac
88        ;;
89
90"rt2x00pci_1_0.eeprom")
91        case $board in
92        rt-n56u)
93                rt2x00_eeprom_extract "factory" 32768 272
94                ;;
95        esac
96        ;;
97esac
Note: See TracBrowser for help on using the repository browser.