[openwrt/openwrt] ramips: add support for HiLink HLK-7621A evaluation board

LEDE Commits lede-commits at lists.infradead.org
Sun Oct 31 16:16:47 PDT 2021


adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/eb00fb8f7153535512b2dad365e76a2bc0dfb6c1

commit eb00fb8f7153535512b2dad365e76a2bc0dfb6c1
Author: Sergio Paracuellos <sergio.paracuellos at gmail.com>
AuthorDate: Sun Apr 4 08:50:26 2021 +0200

    ramips: add support for HiLink HLK-7621A evaluation board
    
    Specifications:
    - SoC: MediaTek MT7621AT
    - RAM: 256 MB (DDR3)
    - Flash: 32 MB SPI NOR 44MHz
    - Switch: 1 WAN, 4 LAN (Gigabit)
    - LEDs: 1 WAN, 4 LAN (controlled by PHY)
    - USB Ports: 1 x USB2, 1 x USB3
    - WLAN: 1 x 2.4, 5 GHz 866Mbps (MT7612E)
    - Button: 1 button (reset)
    - UART Serial: UART1 as console : 57600 baud
    - Power: 12VDC, 1A
    
    Installation:
    Update openWRT firmware using internal GNUBEE uboot:
    https://github.com/gnubee-git/GnuBee-MT7621-uboot
    
    By HTTP: Initial uboot address is http://10.10.10.123, your address
    needs to be 10.10.10.x, and mask 255.255.255.0.
    By TFTP: Uboot is in client mode, the address of the firmware must
    be tftp://10.10.10.3/uboot.bin
    
    Recovery:
    Manufacturer provides MTK OpenWrt 14.07 source code, compile then
    flash it by uboot.
    HLK-7621A is a stamp hole package module for embedded development,
    users have to design IO boards to use it.
    
    MAC addresses:
    - u-boot-env contains a placeholder address:
      > mtd_get_mac_ascii u-boot-env ethaddr
      03:17:73:ab:cd:ef
    - phy0 gets a valid-looking address:
      > cat /sys/class/ieee80211/phy0/macaddress
      f8:62:aa:**:**:a8
    - Calibration data for &pcie2 contains a valid address, however the
      zeros in the right half look like it's not real:
      8c:88:2b:00:00:1b
    - Since it's an evaluation board and there is no solid information
      about the MAC address assignment, the ethernet MAC address is left random.
    
    Signed-off-by: Chen Yijun <cyjason at bupt.edu.cn>
    [add keys and pcie nodes to properly support evaluation board]
    Signed-off-by: Sergio Paracuellos <sergio.paracuellos at gmail.com>
    [remove ethernet address, wrap lines properly]
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 .../ramips/dts/mt7621_hilink_hlk-7621a-evb.dts     | 109 +++++++++++++++++++++
 target/linux/ramips/image/mt7621.mk                |  10 ++
 2 files changed, 119 insertions(+)

diff --git a/target/linux/ramips/dts/mt7621_hilink_hlk-7621a-evb.dts b/target/linux/ramips/dts/mt7621_hilink_hlk-7621a-evb.dts
new file mode 100644
index 0000000000..4b807fcaa5
--- /dev/null
+++ b/target/linux/ramips/dts/mt7621_hilink_hlk-7621a-evb.dts
@@ -0,0 +1,109 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include "mt7621.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	compatible = "hilink,hlk-7621a-evb", "mediatek,mt7621-soc";
+	model = "HiLink HLK-7621A evaluation board";
+
+	keys {
+		compatible = "gpio-keys";
+
+		reset {
+			label = "reset";
+			gpios = <&gpio 18 GPIO_ACTIVE_HIGH>;
+			linux,code = <KEY_RESTART>;
+		};
+	};
+};
+
+&spi0 {
+	status = "okay";
+
+	flash at 0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <44000000>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "u-boot";
+				reg = <0x0 0x30000>;
+				read-only;
+			};
+
+			partition at 30000 {
+				label = "u-boot-env";
+				reg = <0x30000 0x10000>;
+				read-only;
+			};
+
+			factory: partition at 40000 {
+				label = "factory";
+				reg = <0x40000 0x10000>;
+				read-only;
+			};
+
+			partition at 50000 {
+				compatible = "denx,uimage";
+				label = "firmware";
+				reg = <0x50000 0x1fb0000>;
+			};
+		};
+	};
+};
+
+&switch0 {
+	ports {
+		port at 0 {
+			status = "okay";
+			label = "lan1";
+		};
+
+		port at 1 {
+			status = "okay";
+			label = "lan2";
+		};
+
+		port at 2 {
+			status = "okay";
+			label = "lan3";
+		};
+
+		port at 3 {
+			status = "okay";
+			label = "lan4";
+		};
+
+		port at 4 {
+			status = "okay";
+			label = "wan";
+		};
+	};
+};
+
+&pcie {
+	status = "okay";
+};
+
+&pcie2 {
+	wifi at 0,0 {
+		compatible = "mediatek,mt76";
+		reg = <0x0000 0 0 0 0>;
+		mediatek,mtd-eeprom = <&factory 0x8000>;
+	};
+};
+
+&state_default {
+	gpio {
+		groups = "wdt";
+		function = "gpio";
+	};
+};
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index a0236234d1..3b68a76b3e 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -610,6 +610,16 @@ define Device/gnubee_gb-pc2
 endef
 TARGET_DEVICES += gnubee_gb-pc2
 
+define Device/hilink_hlk-7621a-evb
+  $(Device/dsa-migration)
+  $(Device/uimage-lzma-loader)
+  DEVICE_VENDOR := HiLink
+  DEVICE_MODEL := HLK-7621A evaluation board
+  DEVICE_PACKAGES += kmod-mt76x2 kmod-usb3
+  IMAGE_SIZE := 32448k
+endef
+TARGET_DEVICES += hilink_hlk-7621a-evb
+
 define Device/hiwifi_hc5962
   $(Device/dsa-migration)
   BLOCKSIZE := 128k



More information about the lede-commits mailing list