source: trunk/target/linux/ramips/base-files/lib/ramips.sh @ 29910

Last change on this file since 29910 was 29910, checked in by juhosg, 5 years ago

ramips: add support for Sitecom WL-341v3 and other Sercomm IP1006RRv2 boards

This patch adds support for the Sitecom WL-341 v3 and other Sercomm
IP1006RRv2 based boards for sysupgrade support and for the initial
flash through pushbutton initiated recovery mode with the special
partition table and fixes for the quirks and things required by the
modified bootloader.

There is a known bug, Wi-Fi is not working on my board probably
because of the lack of RAM (the board only has 16MiB ram -- half of
the normal amount for non rebadged versions, but there is an empty
slot for another ram chip,) but I don't know for sure. The driver
loads but hostapd fails to load so I think it's not related to the
specific device except for the lack of RAM.

Moreover, only 7 of the 11 onboard leds are confirmed working, it
seems that one of the others is always on and the remaining ones are
connected to the wireless card leds already recognized by OpenWrt

[juhosg: reordered some parts in order to keep things sorted
alphabetically]

Signed-off-by: Marco Antonio Mauro <marcus90@…>

  • Property svn:executable set to *
File size: 2.0 KB
Line 
1#!/bin/sh
2#
3# Copyright (C) 2010 OpenWrt.org
4#
5
6ramips_get_mac_binary()
7{
8        local mtdname="$1"
9        local seek="$2"
10        local part
11
12        . /lib/functions.sh
13
14        part=$(find_mtd_part "$mtdname")
15        if [ -z "$part" ]; then
16                echo "ramips_get_mac_binary: partition $mtdname not found!" >&2
17                return
18        fi
19
20        dd bs=1 skip=$seek count=6 if=$part 2>/dev/null | /usr/sbin/maccalc bin2mac
21}
22
23ramips_get_mac_nvram()
24{
25        local mtdname="$1"
26        local key="$2"
27        local part
28        local mac_dirty
29
30        . /lib/functions.sh
31
32        part=$(find_mtd_part "$mtdname")
33        if [ -z "$part" ]; then
34                echo "ramips_get_mac_nvram: partition $mtdname not found!" >&2
35                return
36        fi
37
38        mac_dirty=$(strings "$part" | sed -n 's/'"$key"'=//p')
39        # "canonicalize" mac
40        /usr/sbin/maccalc add "$mac_dirty" 0
41}
42
43ramips_board_name() {
44        local machine
45        local name
46
47        machine=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /machine/ {print $2}' /proc/cpuinfo)
48
49        case "$machine" in
50        *"Allnet ALL0256N")
51                name="all0256n"
52                ;;
53        *"Argus ATP-52B")
54                name="argus-atp52b"
55                ;;
56        *"Aztech HW550-3G")
57                name="hw550-3g"
58                ;;
59        *"DIR-300 B1")
60                name="dir-300-b1"
61                ;;
62        *"DIR-600 B1")
63                name="dir-600-b1"
64                ;;
65        *"DIR-600 B2")
66                name="dir-600-b2"
67                ;;
68        *"ESR-9753")
69                name="esr-9753"
70                ;;
71        *"F5D8235 v1")
72                name="f5d8235-v1"
73                ;;
74        *"F5D8235 v2")
75                name="f5d8235-v2"
76                ;;
77        *"La Fonera 2.0N")
78                name="fonera20n"
79                ;;
80        *"MoFi Network MOFI3500-3GN")
81                name="mofi3500-3gn"
82                ;;
83        *"NBG-419N")
84                name="nbg-419n"
85                ;;
86        *"NexAira BC2")
87                name="bc2"
88                ;;
89        *"NW718")
90                name="nw718"
91                ;;
92        *"Omnima MiniEMBWiFi")
93                name="omni-emb"
94                ;;
95        *"PWH2004")
96                name="pwh2004"
97                ;;
98        *"RT-G32 B1")
99                name="rt-g32-b1"
100                ;;
101        *"RT-N15")
102                name="rt-n15"
103                ;;
104        *"Sparklan WCR-150GN")
105                name="wcr-150gn"
106                ;;
107        *"V22RW-2X2")
108                name="v22rw-2x2"
109                ;;
110        *"W502U")
111                name="w502u"
112                ;;
113        *"WHR-G300N")
114                name="whr-g300n"
115                ;;
116        *"Sitecom WL-341 v3")
117                name="wl341v3"
118                ;;
119        *"Sitecom WL-351 v1 002")
120                name="wl-351"
121                ;;
122        *"WLI-TX4-AG300N")
123                name="wli-tx4-ag300n"
124                ;;
125        *"WZR-AGL300NH")
126                name="wzr-agl300nh"
127                ;;
128        *"WR512-3GN-like router")
129                name="wr512-3gn"
130                ;;
131        *)
132                name="generic"
133                ;;
134        esac
135
136        echo $name
137}
Note: See TracBrowser for help on using the repository browser.