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>
define U-Boot/rb5009
NAME:=MikroTik RB5009
BUILD_SUBTARGET:=cortexa72
- BUILD_DEVICES:=mikrotik_rb5009ug
+ BUILD_DEVICES:=mikrotik_rb5009ug mikrotik_rb5009upr
UBOOT_CONFIG:=mvebu_rb5009
UBOOT_IMAGE:=u-boot.elf
endef
marvell,armada8040-clearfog-gt-8k)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 eth2" "eth0 eth1"
;;
-mikrotik,rb5009ug)
+mikrotik,rb5009ug|\
+mikrotik,rb5009upr)
ucidef_set_interfaces_lan_wan "p2 p3 p4 p5 p6 p7 p8 sfp" "p1"
;;
solidrun,clearfog-pro)
solidrun,clearfog-pro)
legacy_sdcard_do_upgrade "$1"
;;
- mikrotik,rb5009ug)
+ mikrotik,rb5009ug|\
+ mikrotik,rb5009upr)
nand_do_upgrade "$1"
;;
*)
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
-/dts-v1/;
-
#include "armada-7040.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
/ {
- model = "MikroTik RB5009";
- compatible = "mikrotik,rb5009", "marvell,armada7040",
- "marvell,armada-ap806-quad", "marvell,armada-ap806";
-
chosen {
stdout-path = "serial0:115200n8";
};
--- /dev/null
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+/dts-v1/;
+
+#include "armada-7040-rb5009.dtsi"
+
+/ {
+ model = "MikroTik RB5009UPr";
+ compatible = "mikrotik,rb5009upr", "marvell,armada7040",
+ "marvell,armada-ap806-quad", "marvell,armada-ap806";
+};
+
+&cp0_gpio1 {
+ enable-poe-power {
+ gpio-hog;
+ gpios = <8 GPIO_ACTIVE_HIGH>;
+ output-high;
+ line-name = "enable PoE power";
+ };
+};
+
+&cp0_pinctrl {
+ cp0_spi1_pins: cp0-spi1-pins {
+ marvell,pins = "mpp47", "mpp48", "mpp49", "mpp50";
+ marvell,function = "spi1";
+ };
+};
+
+&cp0_spi1 {
+ status = "okay";
+
+ pinctrl-0 = <&cp0_spi1_pins>;
+ pinctrl-names = "default";
+
+ spidev@0 {
+ compatible = "mikrotik,mtpoe";
+ reg = <0>;
+ spi-max-frequency = <2000000>;
+ };
+};
endef
TARGET_DEVICES += mikrotik_rb5009ug
+define Device/mikrotik_rb5009upr
+ $(call Device/mikrotik_rb5009)
+ DEVICE_DTS := armada-7040-rb5009upr
+ DEVICE_MODEL := RB5009UPr+S+IN
+endef
+TARGET_DEVICES += mikrotik_rb5009upr
+
define Device/marvell_clearfog-gt-8k
$(call Device/Default-arm64)
DEVICE_VENDOR := SolidRun
--- /dev/null
+From 14f37a22f520f963d4fbbd0ef99c073100029ac3 Mon Sep 17 00:00:00 2001
+From: Przemek Rudy <prudy@protonmail.com>
+Date: Mon, 23 Dec 2024 17:29:32 +0100
+Subject: [PATCH] kernel: add compatible string for the mtpoe spi device
+
+Device listed in spidev allows referring it in DT.
+
+Signed-off-by: Przemek Rudy <prudy@protonmail.com>
+---
+ drivers/spi/spidev.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/spi/spidev.c
++++ b/drivers/spi/spidev.c
+@@ -695,6 +695,7 @@ static const struct spi_device_id spidev
+ { .name = /* lwn */ "bk4-spi" },
+ { .name = /* menlo */ "m53cpld" },
+ { .name = /* micron */ "spi-authenta" },
++ { .name = /* mikrotik */ "mtpoe" },
+ { .name = /* rohm */ "bh2228fv" },
+ { .name = /* rohm */ "dh2228fv" },
+ { .name = /* semtech */ "sx1301" },
+@@ -728,6 +729,7 @@ static const struct of_device_id spidev_
+ { .compatible = "lwn,bk4-spi", .data = &spidev_of_check },
+ { .compatible = "menlo,m53cpld", .data = &spidev_of_check },
+ { .compatible = "micron,spi-authenta", .data = &spidev_of_check },
++ { .compatible = "mikrotik,mtpoe", .data = &spidev_of_check },
+ { .compatible = "rohm,bh2228fv", .data = &spidev_of_check },
+ { .compatible = "rohm,dh2228fv", .data = &spidev_of_check },
+ { .compatible = "semtech,sx1301", .data = &spidev_of_check },