[OpenWrt-Devel] [PATCH] mvebu: add support for GL.iNet GL-MV1000

Li Zhang li.zhang at gl-inet.com
Mon Apr 13 06:26:51 EDT 2020


This patch adds supports for GL-MV1000.

Specification:
	- SOC: Marvell Armada 88F3720 (1GHz)
	- Flash: 16MB (W25Q128FWSIG)
	- RAM: 1GB DDR4
	- Ethernet: 3x GE (1 WAN + 2 LAN)
	- EMMC: 8GB EMMC (KLM8G1GETF-B041)
	- MicroSD: 1x microSD slot
	- USB: 1x USB 2.0 port(TypeA),1x USB 3.0 port(TypeC)
	- Button: 1x reset button,1x slide switch
	- LED: 3x greed LED
	- UART: 1x UART on PCB (JP1: 3.3V, RX, TX, GND)

Signed-off-by: Li Zhang <li.zhang at gl-inet.com>
---
 package/boot/uboot-envtools/files/mvebu            |  3 +
 .../cortexa53/base-files/etc/board.d/02_network    |  3 +-
 .../boot/dts/marvell/armada-gl-mv1000-emmc.dts     | 68 ++++++++++++++++++++++
 target/linux/mvebu/image/Makefile                  |  9 +++
 target/linux/mvebu/image/cortexa53.mk              |  9 +++
 target/linux/mvebu/image/gen_mvebu_sdcard_img.sh   |  6 ++
 .../mvebu/image/generic-arm64-emmc.bootscript      | 12 ++++
 7 files changed, 109 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/mvebu/files-4.19/arch/arm64/boot/dts/marvell/armada-gl-mv1000-emmc.dts
 create mode 100644 target/linux/mvebu/image/generic-arm64-emmc.bootscript

diff --git a/package/boot/uboot-envtools/files/mvebu b/package/boot/uboot-envtools/files/mvebu
index 7902384..9d23c77 100644
--- a/package/boot/uboot-envtools/files/mvebu
+++ b/package/boot/uboot-envtools/files/mvebu
@@ -24,6 +24,9 @@ globalscale,espressobin-v7-emmc|\
 marvell,armada8040-mcbin)
 	ubootenv_add_uci_config "/dev/mtd0" "0x3f0000" "0x10000" "0x10000" "1"
 	;;
+glinet,gl-mv1000-emmc)
+	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x8000" "0x8000" "1"
+	;;
 linksys,caiman|\
 linksys,cobra|\
 linksys,shelby)
diff --git a/target/linux/mvebu/cortexa53/base-files/etc/board.d/02_network b/target/linux/mvebu/cortexa53/base-files/etc/board.d/02_network
index ba4b930..e5ff667 100755
--- a/target/linux/mvebu/cortexa53/base-files/etc/board.d/02_network
+++ b/target/linux/mvebu/cortexa53/base-files/etc/board.d/02_network
@@ -14,7 +14,8 @@ case "$board" in
 globalscale,espressobin|\
 globalscale,espressobin-emmc|\
 globalscale,espressobin-v7|\
-globalscale,espressobin-v7-emmc)
+globalscale,espressobin-v7-emmc|\
+glinet,gl-mv1000-emmc)
 	ucidef_set_interfaces_lan_wan "lan0 lan1" "wan"
 	;;
 marvell,armada-3720-db|\
diff --git a/target/linux/mvebu/files-4.19/arch/arm64/boot/dts/marvell/armada-gl-mv1000-emmc.dts b/target/linux/mvebu/files-4.19/arch/arm64/boot/dts/marvell/armada-gl-mv1000-emmc.dts
new file mode 100644
index 0000000..fe01dfe
--- /dev/null
+++ b/target/linux/mvebu/files-4.19/arch/arm64/boot/dts/marvell/armada-gl-mv1000-emmc.dts
@@ -0,0 +1,68 @@
+/*
+ * Device Tree file for GL.iNet GL-MV1000
+ */
+
+#include "armada-3720-espressobin.dts"
+
+/ {
+       model = "GL.inet GL-MV1000 (Marvell)";
+       compatible = "glinet,gl-mv1000-emmc";
+};
+
+&spi0 {
+        status = "okay";
+
+        flash at 0 {
+                reg = <0>;
+                compatible = "jedec,spi-nor";
+                spi-max-frequency = <104000000>;
+                m25p,fast-read;
+                partitions {
+                        compatible = "fixed-partitions";
+                        #address-cells = <1>;
+                        #size-cells = <1>;
+
+                        partition at 0 {
+                                label = "u-boot";
+                                reg = <0 0xf0000>;
+                        };
+
+                        partition at f0000 {
+                                label = "u-boot-env";
+                                reg = <0Xf0000 0x8000>;
+                        };
+
+                        art: partition at f8000 {
+                                label = "art";
+                                reg = <0xf8000 0x8000>;
+                        };
+
+               };
+        };
+};
+
+&sdhci1 {
+        wp-inverted;
+        bus-width = <4>;
+        cd-gpios = <&gpionb 17 GPIO_ACTIVE_LOW>;
+        marvell,pad-type = "sd";
+        no-1-8-v;
+        vqmmc-supply = <&vcc_sd_reg1>;
+        status = "okay";
+};
+
+
+&sdhci0 {
+        bus-width = <8>;
+        mmc-ddr-1_8v;
+        mmc-hs400-1_8v;
+        non-removable;
+        no-sd;
+        no-sdio;
+        marvell,pad-type = "fixed-1-8v";
+        status = "okay";
+};
+
+&eth0 {
+	mtd-mac-address = <&art 0x0>;
+};
diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile
index ef92748..b848049 100644
--- a/target/linux/mvebu/image/Makefile
+++ b/target/linux/mvebu/image/Makefile
@@ -107,6 +107,15 @@ define Device/Default-arm64
   KERNEL := kernel-bin
 endef
 
+define Device/Default-arm64-emmc
+  BOOT_SCRIPT := generic-arm64-emmc
+  DEVICE_DTS_DIR := $(DTS_DIR)/marvell
+  IMAGES := emmc.img
+  IMAGE/emmc.img := boot-scr | boot-img-ext4 | sdcard-img-ext4 | append-metadata
+  KERNEL_NAME := Image
+  KERNEL := kernel-bin
+endef
+
 define Device/NAND-128K
   BLOCKSIZE := 128k
   PAGESIZE := 2048
diff --git a/target/linux/mvebu/image/cortexa53.mk b/target/linux/mvebu/image/cortexa53.mk
index 77f5c79..4dfd0b4 100644
--- a/target/linux/mvebu/image/cortexa53.mk
+++ b/target/linux/mvebu/image/cortexa53.mk
@@ -69,3 +69,12 @@ define Device/methode_udpu
   BOOT_SCRIPT := udpu
 endef
 TARGET_DEVICES += methode_udpu
+
+define Device/glinet_gl-mv1000-emmc
+  $(call Device/Default-arm64-emmc)
+  DEVICE_TITLE := GL.iNet GL-MV1000 EMMC
+  DEVICE_DTS := armada-gl-mv1000-emmc
+  SUPPORTED_DEVICES := glinet,gl-mv1000-emmc
+endef
+TARGET_DEVICES += glinet_gl-mv1000-emmc
+
diff --git a/target/linux/mvebu/image/gen_mvebu_sdcard_img.sh b/target/linux/mvebu/image/gen_mvebu_sdcard_img.sh
index 842e591..50028fe 100755
--- a/target/linux/mvebu/image/gen_mvebu_sdcard_img.sh
+++ b/target/linux/mvebu/image/gen_mvebu_sdcard_img.sh
@@ -51,6 +51,12 @@ while [ "$#" -ge 3 ]; do
 	shift; shift; shift
 done
 
+model=''
+model=$(echo $OUTFILE | grep "gl-mv1000-emmc")
+[ "$model" != "" ] && {
+	ptgen_args="$ptgen_args -t 83 -p 7093504"
+}
+
 head=16
 sect=63
 
diff --git a/target/linux/mvebu/image/generic-arm64-emmc.bootscript b/target/linux/mvebu/image/generic-arm64-emmc.bootscript
new file mode 100644
index 0000000..4de4d39
--- /dev/null
+++ b/target/linux/mvebu/image/generic-arm64-emmc.bootscript
@@ -0,0 +1,12 @@
+setenv bootargs "root=/dev/mmcblk0p2 rw rootwait"
+
+if test -n "${console}"; then
+	setenv bootargs "${bootargs} ${console}"
+fi
+
+setenv mmcdev 0
+
+load mmc ${mmcdev}:1 ${fdt_addr} @DTB at .dtb
+load mmc ${mmcdev}:1 ${kernel_addr} Image
+
+booti ${kernel_addr} - ${fdt_addr}
-- 
2.7.4




_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list