2020-02-28 15:01:02 +00:00
|
|
|
# Copyright (C) 2011 OpenWrt.org
|
|
|
|
|
|
|
|
PART_NAME=firmware
|
|
|
|
|
|
|
|
REQUIRE_IMAGE_METADATA=1
|
|
|
|
platform_check_image() {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
RAMFS_COPY_BIN='fw_printenv fw_setenv nandwrite'
|
|
|
|
RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'
|
|
|
|
|
|
|
|
platform_do_upgrade_mikrotik_nand() {
|
|
|
|
CI_KERNPART=none
|
2020-02-26 14:53:30 +00:00
|
|
|
|
2020-02-28 15:01:02 +00:00
|
|
|
local fw_mtd=$(find_mtd_part kernel)
|
|
|
|
fw_mtd="${fw_mtd/block/}"
|
|
|
|
[ -n "$fw_mtd" ] || return
|
2020-02-26 14:53:30 +00:00
|
|
|
|
|
|
|
local board_dir=$(tar tf "$1" | grep -m 1 '^sysupgrade-.*/$')
|
|
|
|
board_dir=${board_dir%/}
|
|
|
|
[ -n "$board_dir" ] || return
|
|
|
|
|
2020-02-28 15:01:02 +00:00
|
|
|
mtd erase kernel
|
2020-02-26 14:53:30 +00:00
|
|
|
tar xf "$1" ${board_dir}/kernel -O | nandwrite -o "$fw_mtd" -
|
2020-02-28 15:01:02 +00:00
|
|
|
|
|
|
|
nand_do_upgrade "$1"
|
|
|
|
}
|
|
|
|
|
|
|
|
platform_do_upgrade() {
|
|
|
|
local board=$(board_name)
|
|
|
|
|
|
|
|
case "$board" in
|
2020-05-26 01:10:00 +00:00
|
|
|
mikrotik,routerboard-493g|\
|
2020-06-22 21:05:51 +00:00
|
|
|
mikrotik,routerboard-921gs-5hpacd-15s|\
|
ath79: add support for MikroTik SXT 5nD r2 (SXT Lite5)
The MikroTik SXT Lite5 (product code RBSXT5nDr2, also SXT 5nD r2) is
an outdoor 5GHz CPE with a 16 dBi integrated antenna built around the
Atheros AR9344 SoC. It is based on the "sxt5n" board platform.
Specifications:
- SoC: Atheros AR9344
- RAM: 64 MB
- Storage: 128 MB NAND
- Wireless: Atheros AR9340 (SoC) 802.11a/n 2x2:2
- Ethernet: Atheros AR8229 switch (SoC), 1x 10/100 port,
8-32 Vdc PoE in
- 6 user-controllable LEDs:
· 1x power (blue)
· 1x wlan (green)
· 4x rssi (green)
- 1 GPIO-controlled buzzer
See https://mikrotik.com/product/RBSXT5nDr2 for more details.
Notes:
The device was already supported in the ar71xx target. There, the
Ethernet port was handled by GMAC1. Here in ath79 it is handled by
GMAC0, which allows to get link information (loss, speed, duplex) on
the eth0 interface.
Flashing:
TFTP boot initramfs image and then perform sysupgrade. Follow common
MikroTik procedure as in https://openwrt.org/toh/mikrotik/common.
Acknowledgments:
Michael Pratt (@mpratt14) for helping on the network settings.
Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
[rebase, use mikrotik LED label prefix, make names consistent,
add reg for bootloader2, use led_user for boot indication etc.,
minor cosmetic changes]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-06-11 12:22:54 +00:00
|
|
|
mikrotik,routerboard-922uags-5hpacd|\
|
|
|
|
mikrotik,routerboard-sxt-5nd-r2)
|
2020-02-28 15:01:02 +00:00
|
|
|
platform_do_upgrade_mikrotik_nand "$1"
|
|
|
|
;;
|
|
|
|
*)
|
2020-08-17 10:44:13 +00:00
|
|
|
# NOR devices: erase firmware if booted from initramfs
|
|
|
|
[ -z "$(rootfs_type)" ] && mtd erase firmware
|
|
|
|
|
2020-02-28 15:01:02 +00:00
|
|
|
default_do_upgrade "$1"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|