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

Last change on this file since 29000 was 29000, checked in by blogic, 4 years ago

lantiq: adds hotplug handler for loading rt2x00 firmware

File size: 789 bytes
Line 
1#!/bin/sh
2# based on gabors ralink wisoc implementation
3
4rt2x00_eeprom_die() {
5        echo "rt2x00 eeprom: " "$*"
6        exit 1
7}
8
9rt2x00_eeprom_extract() {
10        local part=$1
11        local offset=$2
12        local count=$3
13        local mtd
14
15        . /etc/functions.sh
16
17        mtd=$(find_mtd_part $part)
18        [ -n "$mtd" ] || \
19                rt2x00_eeprom_die "no mtd device found for partition $part"
20
21        dd if=$mtd of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count || \
22                rt2x00_eeprom_die "failed to extract from $mtd"
23}
24
25[ -e /lib/firmware/$FIRMWARE ] && exit 0
26
27case "$FIRMWARE" in
28"RT2860.eeprom" )
29        local board=$(grep ^machine /proc/cpuinfo | sed "s/machine.*: \(.*\) - .*/\1/g")
30        case $board in
31        ARV7525PW)
32                rt2x00_eeprom_extract "board_config" 1040 272
33                ;;
34        *)
35                rt2x00_eeprom_die "board $board is not supported yet"
36                ;;
37        esac
38        ;;
39esac
Note: See TracBrowser for help on using the repository browser.