BOARD:=ath79
BOARDNAME:=Atheros ATH79 (DTS)
CPU_TYPE:=24kc
-SUBTARGETS:=generic nand tiny
+SUBTARGETS:=generic mikrotik nand tiny
FEATURES:=ramdisk
+++ /dev/null
-# Copyright (C) 2019 Robert Marko <robimarko@gmail.com>
-# Copyright (C) 2019 Roger Pueyo Centelles <roger.pueyo@guifi.net>
-#
-# Helper function to extract MAC addresses and calibration data for MikroTik
-#
-
-mikrotik_caldata_extract() {
- local part=$1
- local offset=$(($2))
- local count=$(($3))
- local mtd
- local erdfile="/lib/firmware/erd.bin"
-
- mtd=$(find_mtd_chardev $part)
- [ -n "$mtd" ] || caldata_die "no mtd device found for partition $part"
-
- rbextract -e $mtd $erdfile
-
- dd if=$erdfile of=/lib/firmware/$FIRMWARE iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \
- caldata_die "failed to extract calibration data from $mtd"
-}
dlink,dir-505|\
engenius,ecb1750|\
glinet,gl-ar300m-lite|\
- mikrotik,routerboard-wap-g-5hact2hnd|\
netgear,ex6400|\
netgear,ex7300|\
ocedo,koala|\
[ -e /lib/firmware/$FIRMWARE ] && exit 0
. /lib/functions/caldata.sh
-. /lib/functions/mikrotik-caldata.sh
board=$(board_name)
caldata_extract "art" 0x1000 0x440
ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env ethaddr)
;;
- mikrotik,routerboard-wap-g-5hact2hnd)
- mikrotik_caldata_extract "art" 0x1000 0x440
- ath9k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x10) +2)
- ;;
nec,wg800hp)
caldata_extract "art" 0x1000 0x440
ath9k_patch_mac $(mtd_get_mac_text board_data 0x680)
. /lib/functions/caldata.sh
. /lib/functions/k2t.sh
-. /lib/functions/mikrotik-caldata.sh
board=$(board_name)
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +2)
;;
- mikrotik,routerboard-wap-g-5hact2hnd)
- mikrotik_caldata_extract "art" 0x5000 0x844
- ;;
nec,wg800hp)
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(mtd_get_mac_text board_data 0x880)
CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-3
CONFIG_MTD_REDBOOT_PARTS=y
CONFIG_MTD_SPLIT_EVA_FW=y
-CONFIG_MTD_SPLIT_MINOR_FW=y
CONFIG_PHY_AR7100_USB=y
CONFIG_PHY_AR7200_USB=y
CONFIG_REGULATOR=y
BOARDNAME:=Generic
-FEATURES += minor squashfs
+FEATURES += squashfs
DEFAULT_PACKAGES += wpad-basic
include ./generic-tp-link.mk
include ./generic-ubnt.mk
endif
+ifeq ($(SUBTARGET),mikrotik)
+include ./mikrotik.mk
+endif
ifeq ($(SUBTARGET),nand)
include ./nand.mk
endif
include ./common-buffalo.mk
-include ./common-mikrotik.mk
include ./common-netgear.mk
include ./common-tp-link.mk
include ./common-yuncore.mk
endef
TARGET_DEVICES += librerouter_librerouter-v1
-define Device/mikrotik_routerboard-wap-g-5hact2hnd
- $(Device/mikrotik)
- SOC := qca9556
- DEVICE_MODEL := RouterBOARD wAP G-5HacT2HnD (wAP AC)
- IMAGE_SIZE := 16256k
- IMAGE/sysupgrade.bin := append-kernel | kernel2minor -s 1024 -e | \
- pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | \
- append-metadata | check-size $$$$(IMAGE_SIZE)
- DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
- SUPPORTED_DEVICES += rb-wapg-5hact2hnd
-endef
-TARGET_DEVICES += mikrotik_routerboard-wap-g-5hact2hnd
-
define Device/nec_wg1200cr
SOC := qca9563
DEVICE_VENDOR := NEC
--- /dev/null
+include ./common-mikrotik.mk
+
+define Device/mikrotik_routerboard-922uags-5hpacd
+ $(Device/mikrotik)
+ SOC := qca9558
+ DEVICE_MODEL := RouterBOARD 922UAGS-5HPacD
+ BOARD_NAME := routerboard
+ IMAGE/sysupgrade.bin = append-kernel | kernel2minor -s 2048 -e -c | \
+ sysupgrade-tar kernel=$$$$@ | append-metadata
+ DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct \
+ kmod-usb2 nand-utils
+ SUPPORTED_DEVICES += rb-922uags-5hpacd
+endef
+TARGET_DEVICES += mikrotik_routerboard-922uags-5hpacd
+
+define Device/mikrotik_routerboard-wap-g-5hact2hnd
+ $(Device/mikrotik)
+ SOC := qca9556
+ DEVICE_MODEL := RouterBOARD wAP G-5HacT2HnD (wAP AC)
+ IMAGE_SIZE := 16256k
+ IMAGE/sysupgrade.bin := append-kernel | kernel2minor -s 1024 -e | \
+ pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | \
+ append-metadata | check-size $$$$(IMAGE_SIZE)
+ DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
+ SUPPORTED_DEVICES += rb-wapg-5hact2hnd
+endef
+TARGET_DEVICES += mikrotik_routerboard-wap-g-5hact2hnd
-include ./common-mikrotik.mk
include ./common-netgear.mk # for netgear-uImage
# attention: only zlib compression is allowed for the boot fs
endef
TARGET_DEVICES += glinet_gl-ar750s-nor
-define Device/mikrotik_routerboard-922uags-5hpacd
- $(Device/mikrotik)
- SOC := qca9558
- DEVICE_MODEL := RouterBOARD 922UAGS-5HPacD
- BOARD_NAME := routerboard
- IMAGE/sysupgrade.bin = append-kernel | kernel2minor -s 2048 -e -c | \
- sysupgrade-tar kernel=$$$$@ | append-metadata
- DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct \
- kmod-usb2 nand-utils
- SUPPORTED_DEVICES += rb-922uags-5hpacd
-endef
-TARGET_DEVICES += mikrotik_routerboard-922uags-5hpacd
-
# fake rootfs is mandatory, pad-offset 129 equals (2 * uimage_header + 0xff)
define Device/netgear_ath79_nand
DEVICE_VENDOR := NETGEAR
--- /dev/null
+#!/bin/sh
+
+. /lib/functions/system.sh
+. /lib/functions/uci-defaults.sh
+
+ath79_setup_interfaces()
+{
+ local board="$1"
+
+ case "$board" in
+ mikrotik,routerboard-922uags-5hpacd|\
+ mikrotik,routerboard-wap-g-5hact2hnd)
+ ucidef_set_interface_lan "eth0"
+ ;;
+ *)
+ ucidef_set_interfaces_lan_wan "eth0" "eth1"
+ ;;
+ esac
+}
+
+ath79_setup_macs()
+{
+ local board="$1"
+
+ case "$board" in
+ esac
+
+ [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
+ [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac
+ [ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac
+}
+
+board_config_update
+board=$(board_name)
+ath79_setup_interfaces $board
+ath79_setup_macs $board
+board_config_flush
+
+exit 0
--- /dev/null
+#!/bin/sh
+
+[ -e /lib/firmware/$FIRMWARE ] && exit 0
+
+. /lib/functions/caldata.sh
+. /lib/functions/mikrotik-caldata.sh
+
+board=$(board_name)
+
+case "$FIRMWARE" in
+"ath9k-eeprom-ahb-18100000.wmac.bin")
+ case $board in
+ mikrotik,routerboard-wap-g-5hact2hnd)
+ mikrotik_caldata_extract "art" 0x1000 0x440
+ ath9k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x10) +2)
+ ;;
+ *)
+ caldata_die "board $board is not supported yet"
+ ;;
+ esac
+ ;;
+esac
--- /dev/null
+#!/bin/sh
+
+[ -e /lib/firmware/$FIRMWARE ] && exit 0
+
+. /lib/functions/caldata.sh
+. /lib/functions/mikrotik-caldata.sh
+
+board=$(board_name)
+
+case "$FIRMWARE" in
+"ath10k/cal-pci-0000:00:00.0.bin")
+ case $board in
+ mikrotik,routerboard-wap-g-5hact2hnd)
+ mikrotik_caldata_extract "art" 0x5000 0x844
+ ;;
+ esac
+ ;;
+"ath10k/cal-pci-0000:01:00.0.bin")
+ case $board in
+ mikrotik,routerboard-922uags-5hpacd)
+ mikrotik_caldata_extract "art" 0x5000 0x844
+ ;;
+ esac
+ ;;
+*)
+ exit 1
+ ;;
+esac
--- /dev/null
+#!/bin/sh
+
+. /lib/functions.sh
+. /lib/functions/migrations.sh
+
+board=$(board_name)
+boardonly="${board##*,}"
+
+case "$board" in
+mikrotik,*)
+ migrate_leds "^rb:=mikrotik:"
+ ;;
+esac
+
+migrations_apply system
+
+exit 0
--- /dev/null
+# Copyright (C) 2019 Robert Marko <robimarko@gmail.com>
+# Copyright (C) 2019 Roger Pueyo Centelles <roger.pueyo@guifi.net>
+#
+# Helper function to extract MAC addresses and calibration data for MikroTik
+#
+
+mikrotik_caldata_extract() {
+ local part=$1
+ local offset=$(($2))
+ local count=$(($3))
+ local mtd
+ local erdfile="/lib/firmware/erd.bin"
+
+ mtd=$(find_mtd_chardev $part)
+ [ -n "$mtd" ] || caldata_die "no mtd device found for partition $part"
+
+ rbextract -e $mtd $erdfile
+
+ dd if=$erdfile of=/lib/firmware/$FIRMWARE iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \
+ caldata_die "failed to extract calibration data from $mtd"
+}
--- /dev/null
+# 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
+ local fw_mtd=$(find_mtd_part kernel)
+ fw_mtd="${fw_mtd/block/}"
+ [ -n "$fw_mtd" ] || return
+ mtd erase kernel
+ tar xf "$1" sysupgrade-routerboard/kernel -O | nandwrite -o "$fw_mtd" -
+
+ nand_do_upgrade "$1"
+}
+
+platform_do_upgrade() {
+ local board=$(board_name)
+
+ case "$board" in
+ mikrotik,routerboard-922uags-5hpacd)
+ platform_do_upgrade_mikrotik_nand "$1"
+ ;;
+ *)
+ default_do_upgrade "$1"
+ ;;
+ esac
+}
--- /dev/null
+CONFIG_AT803X_PHY=y
+CONFIG_CRC16=y
+CONFIG_CRYPTO_DEFLATE=y
+CONFIG_GPIO_LATCH=y
+CONFIG_GPIO_WATCHDOG=y
+CONFIG_GPIO_WATCHDOG_ARCH_INITCALL=y
+CONFIG_LEDS_RESET=y
+CONFIG_LZO_DECOMPRESS=y
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_AR934X=y
+CONFIG_MTD_NAND_CORE=y
+CONFIG_MTD_NAND_ECC=y
+CONFIG_MTD_SPI_NAND=y
+CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
+CONFIG_MTD_SPLIT_MINOR_FW=y
+CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_BLOCK=y
+CONFIG_MTD_UBI_WL_THRESHOLD=4096
+CONFIG_MTD_UBI_BEB_LIMIT=20
+# CONFIG_MTD_UBI_FASTMAP is not set
+# CONFIG_MTD_UBI_GLUEBI is not set
+CONFIG_NET_SWITCHDEV=y
+CONFIG_PHY_AR7100_USB=y
+CONFIG_PHY_AR7200_USB=y
+CONFIG_REGULATOR=y
+CONFIG_REGULATOR_FIXED_VOLTAGE=y
+CONFIG_UBIFS_FS=y
+CONFIG_UBIFS_FS_ADVANCED_COMPR=y
+CONFIG_UBIFS_FS_LZO=y
+CONFIG_UBIFS_FS_ZLIB=y
+CONFIG_WATCHDOG_CORE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_ZLIB_INFLATE=y
--- /dev/null
+#
+# Copyright (C) 2020 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/Default
+ NAME:=Default Profile (all drivers)
+ PACKAGES:= \
+ kmod-usb-ohci kmod-usb2 nand-utils
+ PRIORITY := 1
+endef
+
+define Profile/Default/Description
+ Default package set compatible with most boards.
+endef
+$(eval $(call Profile,Default))
--- /dev/null
+BOARDNAME := MikroTik devices
+FEATURES += minor nand squashfs
+
+DEFAULT_PACKAGES += wpad-basic
+
+define Target/Description
+ Build firmware images for MikroTik devices based on Qualcomm Atheros
+ MIPS SoCs (AR71xx, AR72xx, AR91xx, AR93xx, QCA95xx).
+endef
local board="$1"
case "$board" in
- aerohive,hiveap-121|\
- mikrotik,routerboard-922uags-5hpacd)
+ aerohive,hiveap-121)
ucidef_set_interface_lan "eth0"
;;
domywifi,dw33d)
[ -e /lib/firmware/$FIRMWARE ] && exit 0
. /lib/functions/caldata.sh
-. /lib/functions/mikrotik-caldata.sh
board=$(board_name)
;;
esac
;;
-"ath10k/cal-pci-0000:01:00.0.bin")
- case $board in
- mikrotik,routerboard-922uags-5hpacd)
- mikrotik_caldata_extract "art" 0x5000 0x844
- ;;
- esac
- ;;
*)
exit 1
;;
+++ /dev/null
-#!/bin/sh
-
-. /lib/functions.sh
-. /lib/functions/migrations.sh
-
-board=$(board_name)
-boardonly="${board##*,}"
-
-case "$board" in
-mikrotik,*)
- migrate_leds "^rb:=mikrotik:"
- ;;
-esac
-
-migrations_apply system
-
-exit 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
- local fw_mtd=$(find_mtd_part kernel)
- fw_mtd="${fw_mtd/block/}"
- [ -n "$fw_mtd" ] || return
- mtd erase kernel
- tar xf "$1" sysupgrade-routerboard/kernel -O | nandwrite -o "$fw_mtd" -
-
- nand_do_upgrade "$1"
-}
-
platform_do_upgrade() {
local board=$(board_name)
case "$board" in
- mikrotik,routerboard-922uags-5hpacd)
- platform_do_upgrade_mikrotik_nand "$1"
- ;;
glinet,gl-ar300m-nand|\
glinet,gl-ar300m-nor)
glinet_nand_nor_do_upgrade "$1"
CONFIG_MTD_NAND_CORE=y
CONFIG_MTD_RAW_NAND=y
CONFIG_MTD_SPI_NAND=y
-CONFIG_MTD_SPLIT_MINOR_FW=y
CONFIG_MTD_UBI=y
CONFIG_MTD_UBI_BEB_LIMIT=20
CONFIG_MTD_UBI_BLOCK=y
BOARDNAME := Generic devices with NAND flash
-FEATURES += squashfs nand minor
+FEATURES += squashfs nand
DEFAULT_PACKAGES += wpad-basic