Files
eternalwrt-mt798x/package/boot/uboot-mvebu/Makefile
T
Przemek RudyandJonas Jelonek e6f5d04c52 mvebu: MikroTik: add support for RB5009UPr+S+IN
The MikroTik RB5009UPr+S+IN is a multigig router based on the Marvell
Armada 7040 SoC, sharing the same hardware base as the RB5009UG+S+IN
with added PoE-out support on all ethernet ports.

Specification:

- SoC             : Marvell Armada 7040 (88F7040), 4x Cortex-A72
- CPU frequency   : 350-1400 MHz
- RAM             : 1 GB
- Flash           : 16 MB SPI NOR + 1 GB NAND
- Switch          : Marvell MV88E6393X
- Ethernet        : 1x 2.5G (p1, QCA8081), 7x 1G (p2-p8), 1x SFP+ 10G
- PoE-in          : 802.3af/at on p1, 24-57V
- PoE-out         : 802.3af/at on p1-p8, 130 W total
- Power           : DC jack / 2-pin terminal / PoE-in, 24-57V
- USB             : 1x USB 3.0 type A, max 1.5 A
- LEDs/Keys (GPIO): 4x/1x
- UART            : MikroTik SPI/UART combo header (10-pin, 2.0mm pitch)
  - assignment    : GND Vcc Rx ? GND / CLK DO /CS Tx DI (top view)
  - settings      : 115200n8

Flash instruction using initramfs image:

RouterBOOT cannot boot the OpenWrt kernel directly. A U-Boot loader
(u-boot.elf) is installed as an intermediary: RouterBOOT loads
u-boot.elf, which then loads the OpenWrt initramfs image.

1. Rename the downloaded initramfs image, removing the version number,
   to: openwrt-mvebu-cortexa72-mikrotik_rb5009-initramfs-uImage.itb
2. Set up a BOOTP/TFTP server serving u-boot.elf, with the renamed
   initramfs image in the same directory
3. Power off the router, hold the reset button (front panel), power on
   and keep holding until the initramfs image has been served, then
   release
4. The router boots the initramfs image, reachable at 192.168.1.1
5. Log in via SSH, install U-Boot, wipe NAND and flash OpenWrt:

     . /lib/functions.sh
     yafut -d /dev/mtd$(find_mtd_index "YAFFS") -w -i /tmp/u-boot.elf -o kernel -T
     ubiformat /dev/mtd$(find_mtd_index "ubi") -y
     sysupgrade /tmp/openwrt-mvebu-cortexa72-mikrotik_rb5009upr-squashfs-sysupgrade.bin

Recovery:

Hold the reset button while U-Boot is booting to load the initramfs
image again. To return to RouterOS, use MikroTik Netinstall.

MAC Addresses:

MAC addresses are read from the RouterBOOT hard_config in NOR via the
macaddr_hard nvmem cell:

offset +0 p1  (2.5G, label-mac-device)
offset +1 p2
offset +2 p3
offset +3 p4
offset +4 p5
offset +5 p6
offset +6 p7
offset +7 p8
offset +8 sfp

Tested-by: Sm00shed <sm00shed@posteo.de> (RB5009UPr+S+IN, OpenWrt v25.12.4,
kernel 6.12.87, mtpoe fw 65.21)
Signed-off-by: Przemek Rudy <prudy@protonmail.com>
[carlo@common-net.org: refactor RB5009UPr+S+IN support and fix sysupgrade path]
Signed-off-by: Carlo Filippi <carlo@common-net.org>
[sm00shed@posteo.de: fix compatible indentation, remove mikrotik,rb5009, expand commit message]
Signed-off-by: Sm00shed <sm00shed@posteo.de>
Link: https://github.com/openwrt/openwrt/pull/23698
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-01 17:03:40 +02:00

109 lines
2.2 KiB
Makefile

#
# Copyright (C) 2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_VERSION:=2026.04
PKG_RELEASE:=1
PKG_HASH:=ac7c04b8b7004923b00a4e5d6699c5df4d21233bac9fda690d8cfbc209fff2fd
include $(INCLUDE_DIR)/u-boot.mk
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
define U-Boot/Default
BUILD_TARGET:=mvebu
HIDDEN:=1
endef
define U-Boot/mox
NAME:=CZ.NIC Turris Mox
BUILD_DEVICES:=cznic_turris-mox
BUILD_SUBTARGET:=cortexa53
UBOOT_CONFIG:=turris_mox
endef
define U-Boot/clearfog
NAME:=SolidRun ClearFog A1
BUILD_DEVICES:=solidrun_clearfog-base-a1 solidrun_clearfog-pro-a1
BUILD_SUBTARGET:=cortexa9
UBOOT_IMAGE:=u-boot-with-spl.kwb
endef
define U-Boot/helios4
NAME:=Kobol Helios 4
BUILD_DEVICES:=kobol_helios4
BUILD_SUBTARGET:=cortexa9
UBOOT_IMAGE:=u-boot-with-spl.kwb
endef
define U-Boot/omnia
NAME:=Turris Omnia
BUILD_DEVICES:=cznic_turris-omnia
BUILD_SUBTARGET:=cortexa9
UBOOT_CONFIG:=turris_omnia
UBOOT_IMAGE:=u-boot-with-spl.kwb
endef
define U-Boot/espressobin
NAME:=Marvell ESPRESSObin
BUILD_SUBTARGET:=cortexa53
UBOOT_CONFIG:=mvebu_espressobin-88f3720
endef
define U-Boot/uDPU
NAME:=Methode uDPU
BUILD_SUBTARGET:=cortexa53
endef
define U-Boot/eDPU
NAME:=Methode eDPU
BUILD_SUBTARGET:=cortexa53
endef
define U-Boot/rb5009
NAME:=MikroTik RB5009
BUILD_SUBTARGET:=cortexa72
BUILD_DEVICES:=mikrotik_rb5009ug mikrotik_rb5009upr
UBOOT_CONFIG:=mvebu_rb5009
UBOOT_IMAGE:=u-boot.elf
endef
define U-Boot/atlas
NAME:=RIPE Atlas Probe v5
BUILD_DEVICES:=ripe_atlas-v5
BUILD_SUBTARGET:=cortexa53
UBOOT_CONFIG:=turris_mox
endef
UBOOT_TARGETS:= \
mox \
clearfog \
helios4 \
omnia \
espressobin \
atlas \
uDPU \
eDPU \
rb5009
UBOOT_CUSTOMIZE_CONFIG := \
--disable TOOLS_MKEFICAPSULE
define Package/u-boot/install
$(if $(findstring cortexa53,$(BUILD_SUBTARGET)),,$(Package/u-boot/install/default))
endef
define Build/InstallDev
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
$(CP) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-$(UBOOT_IMAGE)
endef
$(eval $(call BuildPackage/U-Boot))