You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openwrt/target/linux/mvebu/base-files/lib/mvebu.sh

80 lines
1.6 KiB
Bash

#!/bin/sh
#
# Copyright (C) 2013-2015 OpenWrt.org
# Copyright (C) 2016 LEDE-Project.org
#
MVEBU_BOARD_NAME=
MVEBU_MODEL=
mvebu_board_detect() {
local machine
local name
machine=$(cat /proc/device-tree/model)
case "$machine" in
*"Marvell Armada 370 Evaluation Board")
name="armada-370-db"
;;
mvebu: new subtarget cortex A53 This commit introduces new subtarget for Marvell EBU Armada Cortex A53 processor based devices. The first device is Globalscale ESPRESSObin. Some hardware specs: SoC: Marvell Armada 3700LP (88F3720) dual core ARM Cortex A53 processor up to 1.2GHz RAM: 512MB, 1GB or 2GB DDR3 Storage: SATA interface µSD card slot with footprint for an optional 4GB EMMC 4MB SPI NOR flash for bootloader Ethernet: Topaz Networking Switch (88E6341) with 3x GbE ports Connectors: USB 3.0 USB 2.0 µUSB port connected to PL2303SA (USB to serial bridge controller) for UART access Expansion: 2x 46-pin GPIO headers for accessories and shields with I2C, GPIOs, PWM, UART, SPI, MMC, etc MiniPCIe slot Misc: Reset button, JTAG interface Currently booting only from µSD card is supported. The boards depending on date of dispatch can come with various U-Boot versions. For the newest version 2017.03-armada-17.10 no manual intervention should be needed to boot OpenWrt image. For the older ones it's necessary to modify default U-Boot environment: 1. Interrupt boot process to run U-Boot command line, 2. Run following commands: (for version 2017.03-armada-17.06 and 2017.03-armada-17.08) setenv bootcmd "load mmc 0:1 0x4d00000 boot.scr; source 0x4d00000" saveenv (for version 2015.01-armada-17.02 and 2015.01-armada-17.04) setenv bootargs "console=ttyMV0,115200 root=/dev/mmcblk0p2 rw rootwait" setenv bootcmd "ext4load mmc 0:1 ${fdt_addr} armada-3720-espressobin.dtb; ext4load mmc 0:1 ${kernel_addr} Image; booti ${kernel_addr} - ${fdt_addr}" saveenv 3. Poweroff, insert SD card with OpenWrt image, boot and enjoy. Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
6 years ago
*"Globalscale Marvell ESPRESSOBin Board")
name="globalscale,espressobin"
;;
*"Globalscale Mirabox")
name="mirabox"
;;
*"Marvell Armada 370 Reference Design")
name="armada-370-rd"
;;
*"Marvell Armada XP Evaluation Board")
name="armada-xp-db"
;;
*"PlatHome OpenBlocks AX3-4 board")
name="openblocks-ax3-4"
;;
*"Marvell Armada XP GP Board")
name="armada-xp-gp"
;;
*"Linksys WRT1200AC")
name="armada-385-linksys-caiman"
;;
*"Linksys WRT1900AC")
name="armada-xp-linksys-mamba"
;;
*"Linksys WRT1900ACv2")
name="armada-385-linksys-cobra"
;;
*"Linksys WRT1900ACS")
name="armada-385-linksys-shelby"
;;
*"Linksys WRT3200ACM")
name="armada-385-linksys-rango"
;;
*"Marvell Armada 385 Access Point Development Board")
name="armada-385-db-ap"
;;
*"Marvell Armada XP Development Board DB-MV784MP-GP")
name="armada-xp-gp"
;;
*"SolidRun Clearfog Pro A1")
name="armada-388-clearfog-pro"
;;
*"SolidRun Clearfog Base A1")
name="armada-388-clearfog-base"
;;
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>
7 years ago
*"Turris Omnia")
name="armada-385-turris-omnia"
;;
esac
[ -z "$name" ] && name="unknown"
[ -z "$MVEBU_BOARD_NAME" ] && MVEBU_BOARD_NAME="$name"
[ -z "$MVEBU_MODEL" ] && MVEBU_MODEL="$machine"
[ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
echo "$MVEBU_BOARD_NAME" > /tmp/sysinfo/board_name
echo "$MVEBU_MODEL" > /tmp/sysinfo/model
}