mvebu: add support for Turris Omnia

Adds support for the Turris Omnia and builds an eMMC sysupgrade image in
the same format as the SolidRun ClearFog.

An initramfs image in the simple yet Omnia-specific 'medkit' image format
is also built in order to ease the initial flashing process.

Notable hardware support omissions are support for switching between SFP
cage and copper PHY, and RGB LED control.

Due to a current limitation of DSA, only 1/2 CPU switch uplinks are used.

Specifications:
- Marvell Armada 385 1.6GHz dual-core ARMv7 CPU
- 1GB DDR3 RAM
- 8GB eMMC Flash
- 5x Gigabit LAN via Marvell 88E6176 Switch (2x RGMII CPU ports)
- 1x switchable RJ45 (88E1514 PHY) / SFP SGMII WAN
- 2x USB 3.0
- 12x dimmable RGB LEDs controlled by independent MCU
- 3x Mini PCIe slots
- Optional Compex WLE200N2 Mini PCIe AR9287 2x2 802.11b/g/n (2.4GHz)
- Optional Compex WLE900VX Mini PCIe QCA9880 3x3 802.11ac (2.4 / 5GHz)
- Optional Quectel EC20 Mini PCIe LTE modem

Flash instructions:
If the U-Boot environment has been modified previously (likely manually via
serial console), first use serial to reset the default environment.
=> env default -a
=> saveenv

Method 1 - USB 'medkit' image w/o serial
- Copy openwrt-mvebu-turris-omnia-sysupgrade.img.gz and
omnia-medkit-openwrt-mvebu-turris-omnia-initramfs.tar.gz to the root of a
USB flash drive formatted with FAT32 / ext2/3/4 / btrfs / XFS.
Note that the medkit MUST be named omnia-medkit*.tar.gz
- Disconnect other USB devices from the Omnia and connect the flash drive
to either USB port.
- Power on the Omnia and hold down the rear reset button until 4 LEDs are
illuminated, then release.
- Wait approximately 2 minutes for the Turris Omnia to flash itself with
the temporary image, during which LEDs will change multiple times.
- Connect a computer to a LAN port of the Turris Omnia with a DHCP client
- (if necessary) ssh-keygen -R 192.168.1.1
- ssh root@192.168.1.1
$ mount /dev/sda1 /mnt
$ sysupgrade /mnt/openwrt-mvebu-turris-omnia-sysupgrade.img.gz
- Wait another minute for the final OpenWrt image to be flashed. The Turris
Omnia will reboot itself and you can remove the flash drive.

Method 2 - TFTP w/ serial
- Extract omnia-medkit-openwrt-mvebu-turris-omnia-initramfs.tar.gz and copy
dtb + zImage to your TFTP server (rename if desired)
- Connect Turris Omnia WAN port to DHCP-enabled network with TFTP server
- Connect serial console and interrupt U-Boot
=> dhcp
=> setenv serverip <tftp_server_ip_here>
=> tftpboot 0x01000000 zImage
=> tftpboot 0x02000000 dtb
=> bootz 0x01000000 - 0x02000000
- OpenWrt will now boot from ramdisk
- Download openwrt-mvebu-turris-omnia-sysupgrade.img.gz to /tmp/
$ sysupgrade /tmp/openwrt-mvebu-turris-omnia-sysupgrade.img.gz
- Wait another minute for the final OpenWrt image to be flashed. The Turris
Omnia will reboot itself.

Signed-off-by: Ryan Mounce <ryan@mounce.com.au>
This commit is contained in:
Ryan Mounce 2017-06-03 02:01:06 +09:30 committed by Hauke Mehrtens
parent 657ce9231d
commit 9f3f61a0d9
7 changed files with 62 additions and 3 deletions

View file

@ -22,6 +22,9 @@ armada-385-linksys-shelby)
armada-385-linksys-rango) armada-385-linksys-rango)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000" ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
;; ;;
armada-385-turris-omnia)
ubootenv_add_uci_config "/dev/mtd0" "0xC0000" "0x10000" "0x40000"
;;
armada-xp-linksys-mamba) armada-xp-linksys-mamba)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000" ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000"
;; ;;

View file

@ -23,6 +23,10 @@ armada-xp-linksys-mamba)
ucidef_add_switch "switch0" \ ucidef_add_switch "switch0" \
"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth0" "4:wan" "6@eth1" "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth0" "4:wan" "6@eth1"
;; ;;
armada-385-turris-omnia)
ucidef_set_interface_lan "lan0 lan1 lan2 lan3 lan4"
ucidef_set_interface_wan "eth2"
;;
armada-388-clearfog-*) armada-388-clearfog-*)
# eth0 is standalone ethernet # eth0 is standalone ethernet
# eth1 is switch (-pro) or standalone ethernet (-base) # eth1 is switch (-pro) or standalone ethernet (-base)

View file

@ -59,6 +59,9 @@ mvebu_board_detect() {
*"SolidRun Clearfog Base A1") *"SolidRun Clearfog Base A1")
name="armada-388-clearfog-base" name="armada-388-clearfog-base"
;; ;;
*"Turris Omnia")
name="armada-385-turris-omnia"
;;
esac esac
[ -z "$name" ] && name="unknown" [ -z "$name" ] && name="unknown"

View file

@ -16,7 +16,7 @@ platform_do_upgrade() {
armada-385-linksys-caiman|armada-385-linksys-cobra|armada-385-linksys-rango|armada-385-linksys-shelby|armada-xp-linksys-mamba) armada-385-linksys-caiman|armada-385-linksys-cobra|armada-385-linksys-rango|armada-385-linksys-shelby|armada-xp-linksys-mamba)
platform_do_upgrade_linksys "$ARGV" platform_do_upgrade_linksys "$ARGV"
;; ;;
armada-388-clearfog-base|armada-388-clearfog-pro) armada-385-turris-omnia|armada-388-clearfog-base|armada-388-clearfog-pro)
platform_do_upgrade_sdcard "$ARGV" platform_do_upgrade_sdcard "$ARGV"
;; ;;
*) *)
@ -29,7 +29,7 @@ platform_copy_config() {
armada-385-linksys-caiman|armada-385-linksys-cobra|armada-385-linksys-rango|armada-385-linksys-shelby|armada-xp-linksys-mamba) armada-385-linksys-caiman|armada-385-linksys-cobra|armada-385-linksys-rango|armada-385-linksys-shelby|armada-xp-linksys-mamba)
platform_copy_config_linksys platform_copy_config_linksys
;; ;;
armada-388-clearfog-base|armada-388-clearfog-pro) armada-385-turris-omnia|armada-388-clearfog-base|armada-388-clearfog-pro)
platform_copy_config_sdcard "$ARGV" platform_copy_config_sdcard "$ARGV"
;; ;;
esac esac

View file

@ -18,8 +18,20 @@ platform_check_image_sdcard() {
} }
platform_do_upgrade_sdcard() { platform_do_upgrade_sdcard() {
local board=$(board_name)
sync sync
get_image "$1" | dd of=/dev/mmcblk0 bs=2M conv=fsync get_image "$1" | dd of=/dev/mmcblk0 bs=2M conv=fsync
case "$board" in
armada-385-turris-omnia)
fw_setenv openwrt_bootargs 'earlyprintk console=ttyS0,115200 root=/dev/mmcblk0p2 rootfstype=auto rootwait'
fw_setenv openwrt_mmcload 'setenv bootargs "$openwrt_bootargs cfg80211.freg=$regdomain"; fatload mmc 0 0x01000000 zImage; fatload mmc 0 0x02000000 armada-385-turris-omnia.dtb'
fw_setenv factory_mmcload 'setenv bootargs "$bootargs cfg80211.freg=$regdomain"; btrload mmc 0 0x01000000 boot/zImage @; btrload mmc 0 0x02000000 boot/dtb @'
fw_setenv mmcboot 'mw 0xf10184a0 0xfd4d4cfa; run openwrt_mmcload || run factory_mmcload; bootz 0x01000000 - 0x02000000'
;;
esac
sleep 1 sleep 1
} }

View file

@ -207,9 +207,12 @@ CONFIG_GENERIC_STRNCPY_FROM_USER=y
CONFIG_GENERIC_STRNLEN_USER=y CONFIG_GENERIC_STRNLEN_USER=y
CONFIG_GLOB=y CONFIG_GLOB=y
CONFIG_GPIOLIB=y CONFIG_GPIOLIB=y
CONFIG_GPIOLIB_IRQCHIP=y
CONFIG_GPIO_GENERIC=y
CONFIG_GPIO_GENERIC_PLATFORM=y
CONFIG_GPIO_MVEBU=y CONFIG_GPIO_MVEBU=y
CONFIG_GPIO_PCA953X=y CONFIG_GPIO_PCA953X=y
# CONFIG_GPIO_PCA953X_IRQ is not set CONFIG_GPIO_PCA953X_IRQ=y
CONFIG_GPIO_SYSFS=y CONFIG_GPIO_SYSFS=y
# CONFIG_GRO_CELLS is not set # CONFIG_GRO_CELLS is not set
CONFIG_HANDLE_DOMAIN_IRQ=y CONFIG_HANDLE_DOMAIN_IRQ=y
@ -346,7 +349,13 @@ CONFIG_MVSW61XX_PHY=y
CONFIG_MV_XOR=y CONFIG_MV_XOR=y
CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NEON=y CONFIG_NEON=y
CONFIG_NET_DSA=y
CONFIG_NET_DSA_MV88E6XXX=y
CONFIG_NET_DSA_MV88E6XXX_GLOBAL2=y
CONFIG_NET_DSA_TAG_DSA=y
CONFIG_NET_DSA_TAG_EDSA=y
CONFIG_NET_FLOW_LIMIT=y CONFIG_NET_FLOW_LIMIT=y
CONFIG_NET_SWITCHDEV=y
CONFIG_NLS=y CONFIG_NLS=y
CONFIG_NOP_USB_XCEIV=y CONFIG_NOP_USB_XCEIV=y
CONFIG_NO_BOOTMEM=y CONFIG_NO_BOOTMEM=y

View file

@ -48,6 +48,17 @@ define Build/sdcard-img
83 $$ROOTFS_SIZE $(IMAGE_ROOTFS) 83 $$ROOTFS_SIZE $(IMAGE_ROOTFS)
endef endef
define Build/omnia-medkit-initramfs
$(TAR) -c -T /dev/null -f $@
rm -rf $(dir $(IMAGE_KERNEL))boot
mkdir -p $(dir $(IMAGE_KERNEL))boot/boot/
cp $(KDIR)/zImage-initramfs $(dir $(IMAGE_KERNEL))boot/boot/zImage
cp $(DTS_DIR)/$(DEVICE_DTS).dtb $(dir $(IMAGE_KERNEL))boot/boot/dtb
$(TAR) -rp --numeric-owner --owner=0 --group=0 --sort=name \
$(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
--file=$@ -C $(dir $(IMAGE_KERNEL))boot/ .
endef
define Device/Default define Device/Default
PROFILES := Default PROFILES := Default
DEVICE_DTS := $(1) DEVICE_DTS := $(1)
@ -226,4 +237,21 @@ define Device/globalscale-mirabox
endef endef
TARGET_DEVICES += globalscale-mirabox TARGET_DEVICES += globalscale-mirabox
define Device/turris-omnia
KERNEL_INSTALL := 1
KERNEL := kernel-bin
KERNEL_INITRAMFS := kernel-bin
DEVICE_TITLE := Turris Omnia
DEVICE_PACKAGES := \
mkf2fs e2fsprogs kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 \
wpad-mini kmod-ath9k kmod-ath10k ath10k-firmware-qca988x
IMAGES := $$(IMAGE_PREFIX)-sysupgrade.img.gz omnia-medkit-$$(IMAGE_PREFIX)-initramfs.tar.gz
IMAGE/$$(IMAGE_PREFIX)-sysupgrade.img.gz := boot-img | sdcard-img | gzip | append-metadata
IMAGE/omnia-medkit-$$(IMAGE_PREFIX)-initramfs.tar.gz := omnia-medkit-initramfs | gzip
IMAGE_NAME = $$(2)
DEVICE_DTS := armada-385-turris-omnia
UBOOT :=
endef
TARGET_DEVICES += turris-omnia
$(eval $(call BuildImage)) $(eval $(call BuildImage))