Files
openwrt-R7800-nss/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
Michał Kępień 98b397d4fb ath79: add support for MikroTik RB951G-2HnD
MikroTik RB951G-2HnD is a wireless SOHO router that was previously
supported by the ar71xx target, see commit 7a709573d7 ("ar71xx: add
kernel support for the Mikrotik RB951G board").

Specifications
--------------

  - SoC: Atheros AR9344 (600 MHz)
  - RAM: 128 MB (2x 64 MB)
  - Storage: 128 MB NAND flash (various manufacturers)
  - Ethernet: Atheros AR8327 switch, 5x 10/100/1000 Mbit/s
      - 1x PoE in (port 1, 8-30 V input)
  - Wireless: Atheros AR9340 (802.11b/g/n)
  - USB: 2.0 (1A)
  - 8x LED:
      - 1x power (green, not configurable)
      - 1x user (green, not configurable)
      - 5x GE ports (green, not configurable)
      - 1x wireless (green, not configurable)
  - 1x button (restart)

Unlike on the RB951Ui-2HnD, none of the LEDs on this device seem to be
GPIO-controllable, which was also the case for older OpenWRT versions
that supported this board via a mach file.  The Ethernet port LEDs are
controlled by the switch chip.

See https://mikrotik.com/product/RB951G-2HnD for more details.

Flashing
--------

TFTP boot initramfs image and then perform sysupgrade.  Follow
common MikroTik procedures at https://openwrt.org/toh/mikrotik/common.

Signed-off-by: Michał Kępień <openwrt@kempniu.pl>
(cherry picked from commit db02cecd6a)
2023-07-12 20:45:43 +02:00

59 lines
1.6 KiB
Bash

#!/bin/sh
[ -e /lib/firmware/$FIRMWARE ] && exit 0
. /lib/functions/caldata.sh
caldata_mikrotik_ath9k() {
local offset=$(($1))
local count=$(($2))
local macaddr=$3
caldata_from_file $wlan_data $offset $count /tmp/$FIRMWARE
ath9k_patch_mac "$macaddr" /tmp/$FIRMWARE
caldata_sysfsload_from_file /tmp/$FIRMWARE 0x0 $count
rm -f /tmp/$FIRMWARE
}
wlan_data="/sys/firmware/mikrotik/hard_config/wlan_data"
mac_base="$(cat /sys/firmware/mikrotik/hard_config/mac_base)"
board=$(board_name)
case "$FIRMWARE" in
"ath9k-eeprom-ahb-18100000.wmac.bin")
case $board in
mikrotik,routerboard-911-lite|\
mikrotik,routerboard-912uag-2hpnd|\
mikrotik,routerboard-lhg-2nd|\
mikrotik,routerboard-lhg-5nd|\
mikrotik,routerboard-sxt-5nd-r2|\
mikrotik,routerboard-wap-2nd|\
mikrotik,routerboard-wapr-2nd)
caldata_mikrotik_ath9k 0x1000 0x440 $(macaddr_add "$mac_base" 1)
;;
mikrotik,routerboard-map-2nd)
caldata_mikrotik_ath9k 0x1000 0x440 $(macaddr_add "$mac_base" 3)
;;
mikrotik,routerboard-mapl-2nd|\
mikrotik,routerboard-wap-g-5hact2hnd)
caldata_mikrotik_ath9k 0x1000 0x440 $(macaddr_add "$mac_base" 2)
;;
mikrotik,routerboard-951ui-2nd|\
mikrotik,routerboard-952ui-5ac2nd)
caldata_mikrotik_ath9k 0x1000 0x440 $(macaddr_add "$mac_base" 6)
;;
mikrotik,routerboard-962uigs-5hact2hnt)
caldata_mikrotik_ath9k 0x1000 0x440 $(macaddr_add "$mac_base" 7)
;;
mikrotik,routerboard-951g-2hnd|\
mikrotik,routerboard-951ui-2hnd)
caldata_mikrotik_ath9k 0x1000 0x440 $(macaddr_add "$mac_base" +11)
;;
*)
caldata_die "board $board is not supported yet"
;;
esac
;;
esac