陈小洋的博客 - HLK
type: channel
link: http://yang1010.vicp.net/index.php/tag/HLK/
items: HLK-7621 开发板适配lean github 补丁文件

HLK-7621 开发板适配lean github 补丁文件
type: item
date: 2023-12-17T16:41:00+00:00
description: 有买这个开发板的可以先刷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>; + st…