diff --git a/package/boot/uboot-mvebu/Makefile b/package/boot/uboot-mvebu/Makefile index 34d9a21ee4b..fa9c20b8ae7 100644 --- a/package/boot/uboot-mvebu/Makefile +++ b/package/boot/uboot-mvebu/Makefile @@ -70,7 +70,7 @@ endef 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 diff --git a/target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network b/target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network index b8d1a3b41b3..9d0f6d538c4 100644 --- a/target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network +++ b/target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network @@ -38,7 +38,8 @@ marvell,armada7040-db) 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) diff --git a/target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh b/target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh index 1c1233f8268..7db50a93796 100755 --- a/target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh +++ b/target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh @@ -83,7 +83,8 @@ platform_do_upgrade() { solidrun,clearfog-pro) legacy_sdcard_do_upgrade "$1" ;; - mikrotik,rb5009ug) + mikrotik,rb5009ug|\ + mikrotik,rb5009upr) nand_do_upgrade "$1" ;; *) diff --git a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-7040-rb5009.dtsi b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-7040-rb5009.dtsi index 18b4703189c..bd0fccef827 100644 --- a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-7040-rb5009.dtsi +++ b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-7040-rb5009.dtsi @@ -1,17 +1,11 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; - #include "armada-7040.dtsi" #include #include #include / { - model = "MikroTik RB5009"; - compatible = "mikrotik,rb5009", "marvell,armada7040", - "marvell,armada-ap806-quad", "marvell,armada-ap806"; - chosen { stdout-path = "serial0:115200n8"; }; diff --git a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-7040-rb5009upr.dts b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-7040-rb5009upr.dts new file mode 100644 index 00000000000..a25c3bf27aa --- /dev/null +++ b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-7040-rb5009upr.dts @@ -0,0 +1,40 @@ +// 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>; + }; +}; diff --git a/target/linux/mvebu/image/cortexa72.mk b/target/linux/mvebu/image/cortexa72.mk index bc7ef452ab9..b6042bb60f0 100644 --- a/target/linux/mvebu/image/cortexa72.mk +++ b/target/linux/mvebu/image/cortexa72.mk @@ -119,6 +119,13 @@ define Device/mikrotik_rb5009ug 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 diff --git a/target/linux/mvebu/patches-6.18/913-drivers_spi_add_mtpoe_device_compatible.patch b/target/linux/mvebu/patches-6.18/913-drivers_spi_add_mtpoe_device_compatible.patch new file mode 100644 index 00000000000..223098691a8 --- /dev/null +++ b/target/linux/mvebu/patches-6.18/913-drivers_spi_add_mtpoe_device_compatible.patch @@ -0,0 +1,30 @@ +From 14f37a22f520f963d4fbbd0ef99c073100029ac3 Mon Sep 17 00:00:00 2001 +From: Przemek Rudy +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 +--- + 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 },