mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-22 15:02:32 +00:00
85d9fd6f0e
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>
119 lines
3.4 KiB
Makefile
119 lines
3.4 KiB
Makefile
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
|
|
|
|
define Device/globalscale_mochabin
|
|
$(call Device/Default-arm64)
|
|
DEVICE_VENDOR := Globalscale
|
|
DEVICE_MODEL := MOCHAbin
|
|
SOC := armada-7040
|
|
endef
|
|
TARGET_DEVICES += globalscale_mochabin
|
|
|
|
define Device/marvell_armada7040-db
|
|
$(call Device/Default-arm64)
|
|
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
|
|
endef
|
|
TARGET_DEVICES += marvell_armada7040-db
|
|
|
|
define Device/marvell_armada8040-db
|
|
$(call Device/Default-arm64)
|
|
DEVICE_VENDOR := Marvell
|
|
DEVICE_MODEL := Armada 8040 Development Board
|
|
DEVICE_DTS := armada-8040-db
|
|
IMAGE/sdcard.img.gz := boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata
|
|
endef
|
|
TARGET_DEVICES += marvell_armada8040-db
|
|
|
|
define Device/marvell_macchiatobin-doubleshot
|
|
$(call Device/Default-arm64)
|
|
DEVICE_VENDOR := SolidRun
|
|
DEVICE_MODEL := MACCHIATObin
|
|
DEVICE_VARIANT := Double Shot
|
|
DEVICE_ALT0_VENDOR := SolidRun
|
|
DEVICE_ALT0_MODEL := Armada 8040 Community Board
|
|
DEVICE_ALT0_VARIANT := Double Shot
|
|
DEVICE_PACKAGES += kmod-i2c-mux-pca954x
|
|
DEVICE_DTS := armada-8040-mcbin
|
|
SUPPORTED_DEVICES := marvell,armada8040-mcbin-doubleshot marvell,armada8040-mcbin
|
|
endef
|
|
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
|
|
DEVICE_PACKAGES += kmod-i2c-mux-pca954x
|
|
DEVICE_DTS := armada-8040-mcbin-singleshot
|
|
SUPPORTED_DEVICES := marvell,armada8040-mcbin-singleshot
|
|
endef
|
|
TARGET_DEVICES += marvell_macchiatobin-singleshot
|
|
|
|
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
|
|
|
|
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
|
|
|
|
define Device/iei_puzzle-m901
|
|
$(call Device/Default-arm64)
|
|
SOC := cn9131
|
|
DEVICE_VENDOR := iEi
|
|
DEVICE_MODEL := Puzzle-M901
|
|
DEVICE_PACKAGES += kmod-rtc-ds1307
|
|
endef
|
|
TARGET_DEVICES += iei_puzzle-m901
|
|
|
|
define Device/iei_puzzle-m902
|
|
$(call Device/Default-arm64)
|
|
SOC := cn9132
|
|
DEVICE_VENDOR := iEi
|
|
DEVICE_MODEL := Puzzle-M902
|
|
DEVICE_PACKAGES += kmod-rtc-ds1307
|
|
endef
|
|
TARGET_DEVICES += iei_puzzle-m902
|
|
|
|
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
|