mvebu: add initial support for Globalscale ESPRESSObin-Ultra
authorVladimir Vid <vladimir.vid@sartura.hr>
Mon, 1 Jun 2020 15:51:37 +0000 (17:51 +0200)
committerPetr Štetiar <ynezz@true.cz>
Mon, 23 Nov 2020 21:53:15 +0000 (22:53 +0100)
This patch adds support for Globalscale ESPRESSObin-Ultra. Device uses
the same Armada-3720 SoC with extended hardware support.

- SoC: Armada-3720
- RAM: 1 GB DDR4
- Flash: 4MB SPI NOR (mx25u3235f) + 8 GB eMMC
- Ethernet: Topaz 6341 88e6341 (4x GB LAN + 1x WAN with 30W PoE)
- WiFI: 2x2 802.11ac Wi-Fi marvell (88w8997 PCIe+USB)
- 1x USB 2.0 port
- 1x USB 3.0 port
- 1x microSD slot
- 1x mini-PCIe slot (USB [with nano-sim slot])
- 1x mini-USB debug UART
- 1x RTC Clock and battery
- 1x reset button
- 1x power button
- 4x LED (RGBY)
- Optional 1x M.2 2280 slot

** Installation **

Copy dtb from build_dir to bin/ and run tftpserver there:
$ cp ./build_dir/target-aarch64_cortex-a53_musl/linux-mvebu_cortexa53/
linux-5.4.65/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dtb
bin/targets/mvebu/cortexa53/
$ in.tftpd -L -s bin/targets/mvebu/cortexa53/

Connect to the device UART via microUSB port on the back side and power on the device.

Power on the device and hit any key to stop the autoboot.

Set serverip (host IP) and ipaddr (any free IP address on the same subnet), e.g:
$ setenv serverip 192.168.1.10 # Host
$ setenv ipaddr 192.168.1.15 # Device

Ping server to confirm network is working:
$ ping $serverip
Using neta@30000 device
host 192.168.1.15 is alive

Tftpboot the firmware:
$ tftpboot $kernel_addr_r openwrt-mvebu-cortexa53-globalscale_espressobin-ultra-initramfs-kernel.bin
$ tftpboot $fdt_addr_r armada-3720-espressobin-ultra.dtb

Set the console and boot the image:
$ setenv bootargs $console
$ booti $kernel_addr_r - $fdt_addr_r

Once the initramfs is booted, transfer openwrt-mvebu-cortexa53-globalscale_espressobin-ultra-squashfs-sdcard.img.gz
to /tmp dir on the device.

Gunzip and dd the image:
$ gunzip /tmp/openwrt-mvebu-cortexa53-globalscale_espressobin-ultra-squashfs-sdcard.img.gz
$ dd if=/tmp/openwrt-mvebu-cortexa53-globalscale_espressobin-ultra-squashfs-sdcard.img of=/dev/mmcblk0 && sync

Reboot the device.

Signed-off-by: Vladimir Vid <vladimir.vid@sartura.hr>
package/boot/uboot-envtools/Makefile
package/boot/uboot-envtools/files/mvebu
target/linux/mvebu/cortexa53/base-files/etc/board.d/02_network
target/linux/mvebu/cortexa53/base-files/lib/upgrade/platform.sh
target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts [new file with mode: 0644]
target/linux/mvebu/image/cortexa53.mk

index 73cd083d0a5ec64527a5b0fb47040bcfa4365d3c..4a86376f7ceb1f817c5c03311d6cb57ace56fcb6 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=uboot-envtools
 PKG_DISTNAME:=u-boot
 PKG_VERSION:=2020.04
-PKG_RELEASE:=5
+PKG_RELEASE:=6
 
 PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:= \
index 85101cf35be2a7195c76ac5fe8ad3783f7970c27..afa058a39f71162cf4ac520363aa19a4340d93ae 100644 (file)
@@ -26,6 +26,7 @@ glinet,gl-mv1000)
        ;;
 globalscale,espressobin|\
 globalscale,espressobin-emmc|\
+globalscale,espressobin-ultra|\
 globalscale,espressobin-v7|\
 globalscale,espressobin-v7-emmc)
        idx="$(find_mtd_index u-boot-env)"
index 0a2a2b144cbd2a1cad75d05f4501abb6efe829a6..c945251e4ead93cebea438c5f31ed77e786e8c10 100755 (executable)
@@ -18,6 +18,9 @@ globalscale,espressobin-v7|\
 globalscale,espressobin-v7-emmc)
        ucidef_set_interfaces_lan_wan "lan0 lan1" "wan"
        ;;
+globalscale,espressobin-ultra)
+       ucidef_set_interfaces_lan_wan "lan0 lan1 lan2 lan3" "wan"
+       ;;
 marvell,armada-3720-db|\
 methode,udpu)
        ucidef_set_interfaces_lan_wan "eth1" "eth0"
index cdf59332726920f59bc573c09fc73eabba48f517..1153fd8f38af5e7c08f2aaf27d605c9498d5f6e1 100755 (executable)
@@ -11,6 +11,7 @@ platform_check_image() {
        case "$(board_name)" in
        globalscale,espressobin|\
        globalscale,espressobin-emmc|\
+       globalscale,espressobin-ultra|\
        globalscale,espressobin-v7|\
        globalscale,espressobin-v7-emmc)
                platform_check_image_sdcard "$1"
@@ -25,6 +26,7 @@ platform_do_upgrade() {
        case "$(board_name)" in
        globalscale,espressobin|\
        globalscale,espressobin-emmc|\
+       globalscale,espressobin-ultra|\
        globalscale,espressobin-v7|\
        globalscale,espressobin-v7-emmc)
                platform_do_upgrade_sdcard "$1"
@@ -41,6 +43,7 @@ platform_copy_config() {
        case "$(board_name)" in
        globalscale,espressobin|\
        globalscale,espressobin-emmc|\
+       globalscale,espressobin-ultra|\
        globalscale,espressobin-v7|\
        globalscale,espressobin-v7-emmc)
                platform_copy_config_sdcard
diff --git a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
new file mode 100644 (file)
index 0000000..669b67e
--- /dev/null
@@ -0,0 +1,241 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Device Tree file for ESPRESSObin-Ultra
+ * Copyright (C) 2019 Globalscale technologies, Inc.
+ *
+ * Jason Hung <jhung@globalscaletechnologies.com>
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include "armada-372x.dtsi"
+
+/ {
+       model = "Globalscale Marvell ESPRESSOBin Ultra Board";
+       compatible = "globalscale,espressobin-ultra", "marvell,armada3720",
+                    "marvell,armada3710";
+
+       aliases {
+               /* for dsa slave device */
+               ethernet1 = &switch0port1;
+               ethernet2 = &switch0port2;
+               ethernet3 = &switch0port3;
+               ethernet4 = &switch0port4;
+               ethernet5 = &switch0port5;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       memory@0 {
+               device_type = "memory";
+               reg = <0x00000000 0x00000000 0x00000000 0x20000000>;
+       };
+
+       reg_usb3_vbus: usb3-vbus {
+               compatible = "regulator-fixed";
+               regulator-name = "usb3-vbus";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               enable-active-high;
+               gpio = <&gpionb 19 GPIO_ACTIVE_HIGH>;
+       };
+
+       usb3_phy: usb3-phy {
+               compatible = "usb-nop-xceiv";
+               vcc-supply = <&reg_usb3_vbus>;
+       };
+
+       leds {
+               pinctrl-names = "default";
+               compatible = "gpio-leds";
+               /* No assigned functions to the LEDs by default */
+               led1 {
+                       label = "ebin-ultra:blue:led1";
+                       gpios = <&gpionb 11 GPIO_ACTIVE_LOW>;
+               };
+               led2 {
+                       label = "ebin-ultra:green:led2";
+                       gpios = <&gpionb 12 GPIO_ACTIVE_LOW>;
+               };
+               led3 {
+                       label = "ebin-ultra:red:led3";
+                       gpios = <&gpionb 13 GPIO_ACTIVE_LOW>;
+               };
+               led4 {
+                       label = "ebin-ultra:yellow:led4";
+                       gpios = <&gpionb 14 GPIO_ACTIVE_LOW>;
+               };
+       };
+};
+
+&pcie0 {
+       status = "okay";
+};
+
+&sata {
+       status = "okay";
+};
+
+&sdhci0 {
+       status = "okay";
+       non-removable;
+       bus-width = <8>;
+       mmc-ddr-1_8v;
+       mmc-hs400-1_8v;
+       marvell,pad-type = "fixed-1-8v";
+};
+
+&spi0 {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&spi_quad_pins>;
+
+       flash@0 {
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <108000000>;
+               spi-rx-bus-width = <4>;
+               spi-tx-bus-width = <4>;
+               m25p,fast-read;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               label = "firmware";
+                               reg = <0x0 0x3e0000>;
+                       };
+                       partition@3e0000 {
+                               label = "hw-info";
+                               reg = <0x3e0000 0x10000>;
+                               read-only;
+                       };
+                       partition@3f0000 {
+                               label = "u-boot-env";
+                               reg = <0x3f0000 0x10000>;
+                       };
+               };
+       };
+};
+
+&uart0 {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart1_pins>;
+};
+
+&i2c0 {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins>;
+
+       clock-frequency = <100000>;
+
+       rtc@51 {
+               compatible = "nxp,pcf8563";
+               reg = <0x51>;
+       };
+};
+
+&usb3 {
+       status = "okay";
+       usb-phy = <&usb3_phy>;
+};
+
+&usb2 {
+       status = "okay";
+};
+
+&eth0 {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&rgmii_pins>;
+       phy-mode = "rgmii-id";
+
+       fixed-link {
+               speed = <1000>;
+               full-duplex;
+       };
+};
+
+&mdio {
+       status = "okay";
+
+       extphy: ethernet-phy@0 {
+               reg = <1>;
+       };
+
+       switch0: switch0@1 {
+               compatible = "marvell,mv88e6085";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               reg = <3>;
+
+               dsa,member = <0 0>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       switch0port0: port@0 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&eth0>;
+                       };
+
+                       switch0port1: port@1 {
+                               reg = <1>;
+                               label = "lan0";
+                               phy-handle = <&switch0phy1>;
+                       };
+
+                       switch0port2: port@2 {
+                               reg = <2>;
+                               label = "lan1";
+                               phy-handle = <&switch0phy2>;
+                       };
+
+                       switch0port3: port@3 {
+                               reg = <3>;
+                               label = "lan2";
+                               phy-handle = <&switch0phy3>;
+                       };
+
+                       switch0port4: port@4 {
+                               reg = <4>;
+                               label = "lan3";
+                               phy-handle = <&switch0phy4>;
+                       };
+
+                       switch0port5: port@5 {
+                               reg = <5>;
+                               label = "wan";
+                               phy-handle = <&extphy>;
+                               phy-mode = "sgmii";
+                       };
+               };
+
+               mdio {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       switch0phy1: switch0phy1@11 {
+                               reg = <0x11>;
+                       };
+                       switch0phy2: switch0phy2@12 {
+                               reg = <0x12>;
+                       };
+                       switch0phy3: switch0phy3@13 {
+                               reg = <0x13>;
+                       };
+                       switch0phy4: switch0phy4@14 {
+                               reg = <0x14>;
+                       };
+               };
+       };
+};
index b65f25472c007ece3aaf74614309434edcd26b6e..6a3a5686553c3be1c678bbb5fce33b0c0f1f9c45 100644 (file)
@@ -32,6 +32,17 @@ define Device/globalscale_espressobin-emmc
 endef
 TARGET_DEVICES += globalscale_espressobin-emmc
 
+define Device/globalscale_espressobin-ultra
+  $(call Device/Default-arm64)
+  DEVICE_VENDOR := Marvell
+  DEVICE_MODEL := ESPRESSObin
+  DEVICE_VARIANT := Ultra
+  DEVICE_PACKAGES += kmod-i2c-pxa kmod-rtc-pcf8563
+  SOC := armada-3720
+  BOOT_SCRIPT := espressobin
+endef
+TARGET_DEVICES += globalscale_espressobin-ultra
+
 define Device/globalscale_espressobin-v7
   $(call Device/Default-arm64)
   DEVICE_VENDOR := Marvell