有买这个开发板的可以先刷breed-mt7621-newifi-d1的引导程序，原厂的bootload不怎么好用，而且不支持新板的lzma内核解压。--- target/linux/ramips/dts/mt7621_hilink_hlk-7621a.dts +++ target/linux/ramips/dts/mt7621_hilink_hlk-7621a.dts @@ -1,14 +1,26 @@ // SPDX-License-Identifier: GPL-2.0-or-later -/dts-v1/; #include "mt7621.dtsi" +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/input/input.h> + / { compatible = "hilink,hlk-7621a", "mediatek,mt7621-soc"; model = "HiLink HLK-7621A"; chosen { - bootargs = "console=ttyS0,57600"; + bootargs = "console=ttyS0,115200"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + linux,code = <KEY_RESTART>; + }; }; }; @@ -19,7 +31,8 @@ compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <44000000>; - + broken-flash-reset; + partitions { compatible = "fixed-partitions"; #address-cells = <1>; @@ -53,51 +66,28 @@ }; &switch0 { - ports { - port@0 { - status = "okay"; - label = "lan1"; - }; - - port@1 { - status = "okay"; - label = "lan2"; - }; - - port@2 { - status = "okay"; - label = "lan3"; - }; - - port@3 { - status = "okay"; - label = "lan4"; - }; - - port@4 { - status = "okay"; - label = "wan"; - }; - }; + /* must delete compatible property */ + /delete-property/ compatible; }; &gmac0 { - mtd-mac-address = <&factory 0x8004>; + nvmem-cells = <&macaddr_factory_e000>; + nvmem-cell-names = "mac-address"; }; &state_default { gpio { - groups = "rgmii2", "jtag"; + groups = "jtag", "uart", "wdt"; function = "gpio"; }; }; &uartlite2 { - status = "okay"; + status = "disable"; }; &uartlite3 { - status = "okay"; + status = "disable"; }; &xhci { @@ -105,9 +95,80 @@ }; &sdhci { - status = "okay"; + status = "disable"; }; &i2c { - status = "okay"; + status = "disable"; +}; + +&gmac1 { + nvmem-cells = <&macaddr_factory_e006>; + nvmem-cell-names = "mac-address"; +}; + +&hnat { + mtketh-wan = "eth1"; + mtketh-ppd = "eth0"; + mtketh-lan = "eth0"; + ext-devices = "radio0","radio1","radio2"; + mtketh-max-gmac = <2>; + status = "okay"; +}; + +&gsw { + mediatek,mdio = <&mdio>; + mediatek,portmap = "llllw"; + mediatek,mcm; + mt7530,direct-phy-access; + + resets = <&rstctrl 2>; + reset-names = "mcm"; + + port5: port@5 { + compatible = "mediatek,mt753x-port"; + reg = <5>; + phy-mode = "rgmii"; + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + + port6: port@6 { + compatible = "mediatek,mt753x-port"; + reg = <6>; + phy-mode = "rgmii"; + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + + mdio-bus { + #address-cells = <1>; + #size-cells = <0>; + }; +}; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; +}; + +&pcie { + status = "okay"; +}; + +&uartlite { + status = "okay"; }; --- target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -54,6 +54,7 @@ ucidef_add_switch "switch0" \ "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan:5" "6@eth0" ;; + hilink,hlk-7621a|\ gehua,ghl-r-001) ucidef_add_switch "switch0" \ "0:lan" "1:lan" "2:lan" "4:wan" "6u@eth0" "5u@eth1" --- target/linux/ramips/image/mt7621.mk +++ target/linux/ramips/image/mt7621.mk @@ -778,10 +778,14 @@ TARGET_DEVICES += hatlab_gateboard-one define Device/hilink_hlk-7621a + $(Device/dsa-migration) + $(Device/uimage-lzma-loader) IMAGE_SIZE := 32448k DEVICE_VENDOR := HiLink DEVICE_MODEL := HLK-7621A - DEVICE_PACKAGES := kmod-usb3 + SUPPORTED_DEVICES += hlk-7621a + DEVICE_COMPAT_VERSION := 1.1 + DEVICE_PACKAGES := kmod-usb3 endef TARGET_DEVICES += hilink_hlk-7621a --- target/linux/ramips/Makefile +++ target/linux/ramips/Makefile @@ -10,8 +10,8 @@ SUBTARGETS:=mt7620 mt7621 mt76x8 rt288x rt305x rt3883 FEATURES:=squashfs gpio boot-part rootfs-part -KERNEL_PATCHVER:=5.4 -KERNEL_TESTING_PATCHVER:=5.10 +KERNEL_PATCHVER:=5.10 +KERNEL_TESTING_PATCHVER:=5.15 define Target/Description Build firmware images for Ralink RT288x/RT3xxx based boards. 补丁文件下载：12_fix_hlk-7621.zip