mvebu: add support for RB5009UG+S+IN
This patch adds support for Mikrotik RB5009UG+S+IN.
Specifications:
- SoC: Marvell Armada 7040 (88F7040) - 4 cores, ARMv8 Cortex-A72, 1.4GHz, 64bit
- RAM: 1024MB DDR4
- Flash: 16MB SPI NOR flash, 1024MB NAND
- Ethernet:
* Marvell 88E6393X - Amethyst:
* one 2.5G RJ45 port via Qualcomm QCA8081 PHY
* seven 1G RJ45 ports via built-in PHY-s
* one 10G SFP+ cage
* All ports share the same 10G switch uplink to the CPU
- LED: User, SFP, Hdr1, Hdr2
- Buttons: Reset
- UART: 115200 8n1 on the MikroTik 16 pin header
- USB: One USB3 port
- Power: 24-57 V via
* DC jack
* 802.3af/at PoE on Ethernet 1
* 2-pin terminal on the side
16 Pin header pinout:
1 GND Vcc RX ? GND
#--------------------#
|.-. .-. .-. .-. .-. |
|'-' '-' '-' '-' '-' |
|.-. .-. .-. .-. .-. |
|'-' '-' '-' '-' '-' |
#--------------------#
2 CLK DO /CS TX DI
Do note that the default RouterBoot has disabled UART even when the
required hard-config bit is set to indicate UART support.
Patched RouterBoot must be used if UART is desired.
Also, since ARM64 Linux support does not support in any way appending the
DTB to the kernel image we use mainline U-Boot with added RB5009 support
in order to boot OpenWrt.
MikroTik uses YAFFS to store the boot kernel and we use YAFUT to put U-Boot
as the kernel which RouterBoot then simply boots as an ELF.
Install instructions:
NOTE: In case you are using an existing out of tree version of OpenWrt make
sure to reinstall RouterOS via Netinstall to return the expected partition
layout.
1. Prepare FAT or EXT4 formatted USB drive with OpenWrt initramfs:
* Copy bin/targets/mvebu/cortexa72/openwrt-mvebu-cortexa72-mikrotik_rb5009-initramfs-uImage.itb
to the root of FAT or EXT4 formatted USB drive.
* Plug in the drive to the RB5009 USB port
2. Boot the modified OpenWrt built U-Boot ELF:
u-boot.elf from bin/targets/mvebu/cortexa72/u-boot-rb5009/u-boot.elf
Consult OpenWrt wiki for common instructions on switching to boot from
Ethernet once as well as serving the file:
https://openwrt.org/toh/mikrotik/common
Once U-Boot is booted it will attempt to boot in the following order:
1. NAND
2. USB
3. Network
NAND is expected to fail but USB or Networking need to serve the OpenWrt
initramfs image and after booting it will be accessible from LAN ports
on the default 192.168.1.1 IP with default credentials.
3. Flash modified RouterBoot that enables UART (Optional but recommended):
https://public.robimarko.eu/RB5009/70x0-7.15-uart.fwf
* Copy the file over to the booted OpenWrt initramfs to /tmp
* Run: mtd erase RouterBOOT-primary
* Run: mtd write /tmp/70x0-7.15-uart.fwf RouterBOOT-primary
4. Install U-Boot to boot OpenWrt:
* Copy the u-boot.elf from bin/targets/mvebu/cortexa72/u-boot-rb5009/u-boot.elf
to OpenWrt initramfs to /tmp.
* Run: . /lib/functions.sh
* Run: yafut -d /dev/mtd$(find_mtd_index "YAFFS") -w -i /tmp/u-boot.elf -o kernel -T
This will use yafut to copy the U-Boot as kernel in YAFFS so that RouterBoot boots it.
5. Wipe the NAND UBI partition:
* Run: ubiformat /dev/mtd$(find_mtd_index "ubi") -y
This will prepare the existing RouterOS rootfs partition for OpenWrt.
6. Flash OpenWrt:
* Copy the bin/targets/mvebu/cortexa72/openwrt-mvebu-cortexa72-mikrotik_rb5009-squashfs-sysupgrade.bin
to OpenWrt initramfs to /tmp.
* Run: sysupgrade /tmp/openwrt-mvebu-cortexa72-mikrotik_rb5009-squashfs-sysupgrade.bin
Device will reboot, boot U-Boot and then OpenWrt.
Recovery:
In case you need to reinstall OpenWrt if it crashes after U-Boot, there is
a recovery mechanism in OpenWrt to boot the OpenWrt initramfs.
You need to hold the reset button while U-Boot is booting and then it will
boot the OpenWrt initramfs from:
1. USB
2. Networking
In recovery mode U-Boot will light all of the LED-s except for the switch
ones.
In case you want to return to RouterOS, you can simply do that via
Netinstall like on any other MikroTik board.
Credits also go to Serhii Serhieiev <adron@mstnt.com> who origininally
figured out the RouterBoot modification for UART, the missing 10G MVPP2
support in U-Boot as well as the custom aux loader to boot directly via
RouterBoot.
Link: https://github.com/openwrt/openwrt/pull/15765
Signed-off-by: Robert Marko <robimarko@gmail.com>
2022-02-09 07:45:47 +00:00
|
|
|
define Device/FitImage
|
|
|
|
KERNEL_SUFFIX := -uImage.itb
|
|
|
|
KERNEL = kernel-bin | gzip | fit gzip $$(KDIR)/image-$$(DEVICE_DTS).dtb
|
|
|
|
KERNEL_NAME := Image
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Device/UbiFit
|
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
IMAGES := factory.ubi sysupgrade.bin
|
|
|
|
IMAGE/factory.ubi := append-ubi
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
endef
|
|
|
|
|
2021-09-27 21:14:51 +00:00
|
|
|
define Device/globalscale_mochabin
|
|
|
|
$(call Device/Default-arm64)
|
|
|
|
DEVICE_VENDOR := Globalscale
|
|
|
|
DEVICE_MODEL := MOCHAbin
|
|
|
|
SOC := armada-7040
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += globalscale_mochabin
|
|
|
|
|
2020-01-31 15:46:13 +00:00
|
|
|
define Device/marvell_armada7040-db
|
2019-05-11 17:37:29 +00:00
|
|
|
$(call Device/Default-arm64)
|
2020-01-31 15:46:13 +00:00
|
|
|
DEVICE_VENDOR := Marvell
|
|
|
|
DEVICE_MODEL := Armada 7040 Development Board
|
|
|
|
DEVICE_DTS := armada-7040-db
|
|
|
|
IMAGE/sdcard.img.gz := boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata
|
2018-03-26 09:37:58 +00:00
|
|
|
endef
|
2020-01-31 15:46:13 +00:00
|
|
|
TARGET_DEVICES += marvell_armada7040-db
|
2018-03-26 09:37:58 +00:00
|
|
|
|
2019-05-11 17:37:33 +00:00
|
|
|
define Device/marvell_armada8040-db
|
2019-05-11 17:37:29 +00:00
|
|
|
$(call Device/Default-arm64)
|
2019-09-09 22:13:30 +00:00
|
|
|
DEVICE_VENDOR := Marvell
|
|
|
|
DEVICE_MODEL := Armada 8040 Development Board
|
2018-05-07 07:25:53 +00:00
|
|
|
DEVICE_DTS := armada-8040-db
|
2019-05-11 17:37:29 +00:00
|
|
|
IMAGE/sdcard.img.gz := boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata
|
2018-05-07 07:25:53 +00:00
|
|
|
endef
|
2019-05-11 17:37:33 +00:00
|
|
|
TARGET_DEVICES += marvell_armada8040-db
|
2018-05-07 07:25:53 +00:00
|
|
|
|
2020-07-10 17:35:22 +00:00
|
|
|
define Device/marvell_macchiatobin-doubleshot
|
2019-05-11 17:37:29 +00:00
|
|
|
$(call Device/Default-arm64)
|
2020-01-31 15:46:13 +00:00
|
|
|
DEVICE_VENDOR := SolidRun
|
|
|
|
DEVICE_MODEL := MACCHIATObin
|
2020-07-10 17:35:22 +00:00
|
|
|
DEVICE_VARIANT := Double Shot
|
2020-01-31 15:46:13 +00:00
|
|
|
DEVICE_ALT0_VENDOR := SolidRun
|
|
|
|
DEVICE_ALT0_MODEL := Armada 8040 Community Board
|
2020-07-10 17:35:22 +00:00
|
|
|
DEVICE_ALT0_VARIANT := Double Shot
|
2020-03-16 05:55:40 +00:00
|
|
|
DEVICE_PACKAGES += kmod-i2c-mux-pca954x
|
2020-01-31 15:46:13 +00:00
|
|
|
DEVICE_DTS := armada-8040-mcbin
|
2020-07-10 08:28:13 +00:00
|
|
|
SUPPORTED_DEVICES := marvell,armada8040-mcbin-doubleshot marvell,armada8040-mcbin
|
2018-05-07 07:25:53 +00:00
|
|
|
endef
|
2020-07-10 17:35:22 +00:00
|
|
|
TARGET_DEVICES += marvell_macchiatobin-doubleshot
|
|
|
|
|
|
|
|
define Device/marvell_macchiatobin-singleshot
|
|
|
|
$(call Device/Default-arm64)
|
|
|
|
DEVICE_VENDOR := SolidRun
|
|
|
|
DEVICE_MODEL := MACCHIATObin
|
|
|
|
DEVICE_VARIANT := Single Shot
|
|
|
|
DEVICE_ALT0_VENDOR := SolidRun
|
|
|
|
DEVICE_ALT0_MODEL := Armada 8040 Community Board
|
|
|
|
DEVICE_ALT0_VARIANT := Single Shot
|
2021-01-04 13:52:20 +00:00
|
|
|
DEVICE_PACKAGES += kmod-i2c-mux-pca954x
|
2020-07-10 17:35:22 +00:00
|
|
|
DEVICE_DTS := armada-8040-mcbin-singleshot
|
|
|
|
SUPPORTED_DEVICES := marvell,armada8040-mcbin-singleshot
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += marvell_macchiatobin-singleshot
|
2021-09-02 09:47:20 +00:00
|
|
|
|
mvebu: add support for RB5009UG+S+IN
This patch adds support for Mikrotik RB5009UG+S+IN.
Specifications:
- SoC: Marvell Armada 7040 (88F7040) - 4 cores, ARMv8 Cortex-A72, 1.4GHz, 64bit
- RAM: 1024MB DDR4
- Flash: 16MB SPI NOR flash, 1024MB NAND
- Ethernet:
* Marvell 88E6393X - Amethyst:
* one 2.5G RJ45 port via Qualcomm QCA8081 PHY
* seven 1G RJ45 ports via built-in PHY-s
* one 10G SFP+ cage
* All ports share the same 10G switch uplink to the CPU
- LED: User, SFP, Hdr1, Hdr2
- Buttons: Reset
- UART: 115200 8n1 on the MikroTik 16 pin header
- USB: One USB3 port
- Power: 24-57 V via
* DC jack
* 802.3af/at PoE on Ethernet 1
* 2-pin terminal on the side
16 Pin header pinout:
1 GND Vcc RX ? GND
#--------------------#
|.-. .-. .-. .-. .-. |
|'-' '-' '-' '-' '-' |
|.-. .-. .-. .-. .-. |
|'-' '-' '-' '-' '-' |
#--------------------#
2 CLK DO /CS TX DI
Do note that the default RouterBoot has disabled UART even when the
required hard-config bit is set to indicate UART support.
Patched RouterBoot must be used if UART is desired.
Also, since ARM64 Linux support does not support in any way appending the
DTB to the kernel image we use mainline U-Boot with added RB5009 support
in order to boot OpenWrt.
MikroTik uses YAFFS to store the boot kernel and we use YAFUT to put U-Boot
as the kernel which RouterBoot then simply boots as an ELF.
Install instructions:
NOTE: In case you are using an existing out of tree version of OpenWrt make
sure to reinstall RouterOS via Netinstall to return the expected partition
layout.
1. Prepare FAT or EXT4 formatted USB drive with OpenWrt initramfs:
* Copy bin/targets/mvebu/cortexa72/openwrt-mvebu-cortexa72-mikrotik_rb5009-initramfs-uImage.itb
to the root of FAT or EXT4 formatted USB drive.
* Plug in the drive to the RB5009 USB port
2. Boot the modified OpenWrt built U-Boot ELF:
u-boot.elf from bin/targets/mvebu/cortexa72/u-boot-rb5009/u-boot.elf
Consult OpenWrt wiki for common instructions on switching to boot from
Ethernet once as well as serving the file:
https://openwrt.org/toh/mikrotik/common
Once U-Boot is booted it will attempt to boot in the following order:
1. NAND
2. USB
3. Network
NAND is expected to fail but USB or Networking need to serve the OpenWrt
initramfs image and after booting it will be accessible from LAN ports
on the default 192.168.1.1 IP with default credentials.
3. Flash modified RouterBoot that enables UART (Optional but recommended):
https://public.robimarko.eu/RB5009/70x0-7.15-uart.fwf
* Copy the file over to the booted OpenWrt initramfs to /tmp
* Run: mtd erase RouterBOOT-primary
* Run: mtd write /tmp/70x0-7.15-uart.fwf RouterBOOT-primary
4. Install U-Boot to boot OpenWrt:
* Copy the u-boot.elf from bin/targets/mvebu/cortexa72/u-boot-rb5009/u-boot.elf
to OpenWrt initramfs to /tmp.
* Run: . /lib/functions.sh
* Run: yafut -d /dev/mtd$(find_mtd_index "YAFFS") -w -i /tmp/u-boot.elf -o kernel -T
This will use yafut to copy the U-Boot as kernel in YAFFS so that RouterBoot boots it.
5. Wipe the NAND UBI partition:
* Run: ubiformat /dev/mtd$(find_mtd_index "ubi") -y
This will prepare the existing RouterOS rootfs partition for OpenWrt.
6. Flash OpenWrt:
* Copy the bin/targets/mvebu/cortexa72/openwrt-mvebu-cortexa72-mikrotik_rb5009-squashfs-sysupgrade.bin
to OpenWrt initramfs to /tmp.
* Run: sysupgrade /tmp/openwrt-mvebu-cortexa72-mikrotik_rb5009-squashfs-sysupgrade.bin
Device will reboot, boot U-Boot and then OpenWrt.
Recovery:
In case you need to reinstall OpenWrt if it crashes after U-Boot, there is
a recovery mechanism in OpenWrt to boot the OpenWrt initramfs.
You need to hold the reset button while U-Boot is booting and then it will
boot the OpenWrt initramfs from:
1. USB
2. Networking
In recovery mode U-Boot will light all of the LED-s except for the switch
ones.
In case you want to return to RouterOS, you can simply do that via
Netinstall like on any other MikroTik board.
Credits also go to Serhii Serhieiev <adron@mstnt.com> who origininally
figured out the RouterBoot modification for UART, the missing 10G MVPP2
support in U-Boot as well as the custom aux loader to boot directly via
RouterBoot.
Link: https://github.com/openwrt/openwrt/pull/15765
Signed-off-by: Robert Marko <robimarko@gmail.com>
2022-02-09 07:45:47 +00:00
|
|
|
define Device/mikrotik_rb5009
|
|
|
|
$(call Device/Default-arm64)
|
|
|
|
$(Device/NAND-128K)
|
|
|
|
$(call Device/FitImage)
|
|
|
|
$(call Device/UbiFit)
|
|
|
|
DEVICE_VENDOR := MikroTik
|
|
|
|
DEVICE_MODEL := RB5009
|
|
|
|
SOC := armada-7040
|
|
|
|
KERNEL_LOADADDR := 0x22000000
|
|
|
|
DEVICE_PACKAGES += kmod-i2c-gpio yafut
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += mikrotik_rb5009
|
|
|
|
|
2022-06-08 01:46:22 +00:00
|
|
|
define Device/marvell_clearfog-gt-8k
|
|
|
|
$(call Device/Default-arm64)
|
|
|
|
DEVICE_VENDOR := SolidRun
|
|
|
|
DEVICE_MODEL := Clearfog
|
|
|
|
DEVICE_VARIANT := GT-8K
|
|
|
|
DEVICE_PACKAGES += kmod-i2c-mux-pca954x kmod-crypto-hw-safexcel
|
|
|
|
DEVICE_DTS := armada-8040-clearfog-gt-8k
|
|
|
|
SUPPORTED_DEVICES := marvell,armada8040-clearfog-gt-8k
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += marvell_clearfog-gt-8k
|
|
|
|
|
2021-09-02 09:47:20 +00:00
|
|
|
define Device/iei_puzzle-m901
|
|
|
|
$(call Device/Default-arm64)
|
2023-12-18 21:22:12 +00:00
|
|
|
SOC := cn9131
|
2021-09-02 09:47:20 +00:00
|
|
|
DEVICE_VENDOR := iEi
|
|
|
|
DEVICE_MODEL := Puzzle-M901
|
2023-12-18 21:22:12 +00:00
|
|
|
DEVICE_PACKAGES += kmod-rtc-ds1307
|
2021-09-02 09:47:20 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += iei_puzzle-m901
|
|
|
|
|
|
|
|
define Device/iei_puzzle-m902
|
|
|
|
$(call Device/Default-arm64)
|
2023-12-18 21:22:12 +00:00
|
|
|
SOC := cn9132
|
2021-09-02 09:47:20 +00:00
|
|
|
DEVICE_VENDOR := iEi
|
|
|
|
DEVICE_MODEL := Puzzle-M902
|
2023-12-18 21:22:12 +00:00
|
|
|
DEVICE_PACKAGES += kmod-rtc-ds1307
|
2021-09-02 09:47:20 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += iei_puzzle-m902
|
2024-02-26 11:47:29 +00:00
|
|
|
|
|
|
|
define Device/solidrun_clearfog-pro
|
|
|
|
$(call Device/Default-arm64)
|
|
|
|
SOC := cn9130
|
|
|
|
DEVICE_VENDOR := SolidRun
|
|
|
|
DEVICE_MODEL := ClearFog Pro
|
|
|
|
DEVICE_PACKAGES += kmod-i2c-mux-pca954x
|
|
|
|
BOOT_SCRIPT := clearfog-pro
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += solidrun_clearfog-pro
|