openwrtv4/target/linux/mvebu/base-files/lib/mvebu.sh

89 lines
1.8 KiB
Bash
Raw Normal View History

#!/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>
2018-03-07 21:10:02 +00:00
*"Globalscale Marvell ESPRESSOBin Board")
name="globalscale,espressobin"
;;
mvebu: initial support for Marvell Armada 3720 DB board Add initial support for Marvell Armada cortex-a53 based DB-88F3720-DDR3-Modular development board. Specifications: - Dual core ARMv8 Cortex-A53 CPU (up to 1.0 GHz) - 4Gb 16-bit DDR3/3L DRAM memory - 128Mb SPI NOR flash memory - 8Gb eMMC NAND flash memory - 1 x SATA Rev 3.0 port - 1 x PCI Express (PCIe) Gen 2.0 or 1 x mini PCI Express (PCIe) Gen 2.0 - 1 x 1G Ethernet port via RGMII (RJ45) - 1 x SD card port - 1 x USB3 (USB2 backward) host\device port via type C connector - 1 x USB2 host port via type A connector - 1 x serial COM port driven by the 88F3720 UART interface and converted to USB via FTDI IC (option to connect the UART DB9 adapter) - I2C Master Interface: - 1 x EEPROM @ address 0x57 - 1 x I/O Expanders @ address 0x22 - Sample at Reset (SatR) memory device @ address 0x4C - RTC clock generator PT7C4337AWE @ address 0x68 - USB3 switch PI5USB30213XEA @ address 0x0D - ID component of PHY module @ address 0x24 - 1 x JTAG interface for CPU emulator - 1 x SETM and JTAG debug interface - 1 x power connector for HDD supply - 1 x 12V DC jack power connector - Board dimensions: 150 mm x 179 mm - LED interface for system status Booting from SD card: 1. reset U-Boot environment: env default -a saveenv 2. prepare U-Boot with boot script: setenv bootcmd "load mmc 0:1 0x4d00000 boot.scr; source 0x4d00000" saveenv or manually: setenv fdt_name armada-3720-db.dtb setenv image_name Image setenv bootcmd 'mmc dev 0; ext4load mmc 0:1 $kernel_addr $image_name;ext4load mmc 0:1 $fdt_addr $fdt_name;setenv bootargs $console root=/dev/mmcblk1p2 rw rootwait; booti $kernel_addr - $fdt_addr' saveenv Signed-off-by: Damir Samardzic <damir.samardzic@sartura.hr>
2018-05-08 11:32:21 +00:00
*"Marvell Armada 3720 Development Board DB-88F3720-DDR3")
name="marvell,armada-3720-db"
;;
*"Marvell 8040 MACHIATOBin")
name="marvell,armada8040-mcbin"
;;
*"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"
;;
*"Linksys WRT32X")
name="armada-385-linksys-venom"
;;
*"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>
2017-06-02 16:31:06 +00:00
*"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
}