-
Notifications
You must be signed in to change notification settings - Fork 19.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ramips: MT7620 add Support HiWiFi R33(C312B B52) (#10812)
- Loading branch information
Showing
7 changed files
with
318 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,235 @@ | ||
#include "mt7620a.dtsi" | ||
|
||
#include <dt-bindings/gpio/gpio.h> | ||
#include <dt-bindings/input/input.h> | ||
|
||
/ { | ||
compatible = "hiwifi,r33", "ralink,mt7620a-soc"; | ||
model = "HiWiFi R33"; | ||
|
||
chosen { | ||
bootargs = "console=ttyS0,115200"; | ||
}; | ||
|
||
aliases { | ||
led-boot = &led_system; | ||
led-failsafe = &led_system; | ||
led-running = &led_system; | ||
led-upgrade = &led_system; | ||
}; | ||
|
||
nand { | ||
status = "okay"; | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
compatible = "mtk,mt7620-nand"; | ||
|
||
partitions { | ||
compatible = "fixed-partitions"; | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
|
||
partition@0 { | ||
label = "u-boot"; | ||
reg = <0x0 0x80000>; | ||
read-only; | ||
}; | ||
|
||
partition@80000 { | ||
label = "debug"; | ||
reg = <0x80000 0x80000>; | ||
read-only; | ||
}; | ||
|
||
factory: partition@100000 { | ||
label = "factory"; | ||
reg = <0x100000 0x40000>; | ||
read-only; | ||
}; | ||
|
||
partition@140000 { | ||
label = "kernel"; | ||
reg = <0x140000 0x400000>; | ||
}; | ||
|
||
ubiconcat0: partition@540000 { | ||
label = "ubiconcat0"; | ||
reg = <0x540000 0x1c80000>; | ||
}; | ||
|
||
partition@21c0000 { | ||
label = "bdinfo"; | ||
reg = <0x21c0000 0x80000>; | ||
read-only; | ||
}; | ||
|
||
ubiconcat1: partition@2240000 { | ||
label = "ubiconcat1"; | ||
reg = <0x2240000 0x5d40000>; | ||
}; | ||
}; | ||
}; | ||
|
||
ubi-concat { | ||
compatible = "mtd-concat"; | ||
devices = <&ubiconcat0 &ubiconcat1>; | ||
|
||
partitions { | ||
compatible = "fixed-partitions"; | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
|
||
partition@0 { | ||
label = "ubi"; | ||
reg = <0x0 0x79c0000>; | ||
}; | ||
}; | ||
}; | ||
|
||
leds { | ||
compatible = "gpio-leds"; | ||
|
||
wlan5g { | ||
label = "blue:wlan5g"; | ||
gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; | ||
linux,default-trigger = "phy0tpt"; | ||
}; | ||
|
||
led_system: system { | ||
label = "blue:system"; | ||
gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>; | ||
}; | ||
|
||
turbo { | ||
label = "blue:turbo"; | ||
gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>; | ||
}; | ||
|
||
wlan2g { | ||
label = "blue:wlan2g"; | ||
gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; | ||
linux,default-trigger = "phy1tpt"; | ||
}; | ||
|
||
internet { | ||
label = "blue:internet"; | ||
gpios = <&gpio3 0 GPIO_ACTIVE_LOW>; | ||
}; | ||
}; | ||
|
||
keys { | ||
compatible = "gpio-keys"; | ||
|
||
reset { | ||
label = "reset"; | ||
gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; | ||
linux,code = <KEY_RESTART>; | ||
}; | ||
}; | ||
|
||
gpio_export { | ||
compatible = "gpio-export"; | ||
#size-cells = <0>; | ||
|
||
usbpower { | ||
gpio-export,name = "usbpower"; | ||
gpio-export,output = <0>; | ||
gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; | ||
}; | ||
}; | ||
|
||
rtl8367rb { | ||
compatible = "realtek,rtl8367b", "rtl8367b"; | ||
cpu_port = <6>; | ||
realtek,extif1 = <1 0 1 1 1 1 1 1 2>; | ||
mii-bus = <&mdio0>; | ||
}; | ||
}; | ||
|
||
//在最新的openwrt master分支中sysc已经被剔除,此处进行备份标记 | ||
// &sysc { | ||
// ralink,gpiomux = "i2c", "jtag"; | ||
// ralink,uartmux = "gpio"; | ||
// ralink,wdtmux = <1>; | ||
// }; | ||
|
||
&gpio3 { | ||
status = "okay"; | ||
}; | ||
|
||
&ehci { | ||
status = "okay"; | ||
}; | ||
|
||
&ohci { | ||
status = "okay"; | ||
}; | ||
|
||
&pcie { | ||
status = "okay"; | ||
}; | ||
|
||
ðernet { | ||
pinctrl-names = "default"; | ||
pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>; | ||
|
||
//mtd-mac-address = <&factory 0x4>; | ||
|
||
nvmem-cells = <&macaddr_factory_4>; | ||
nvmem-cell-names = "mac-address"; | ||
|
||
port@5 { | ||
status = "okay"; | ||
mediatek,fixed-link = <1000 1 1 1>; | ||
phy-handle = <&phy5>; | ||
phy-mode = "rgmii"; | ||
}; | ||
|
||
mdio0: mdio-bus { | ||
status = "okay"; | ||
|
||
phy5: ethernet-phy@5 { | ||
reg = <5>; | ||
phy-mode = "rgmii"; | ||
}; | ||
}; | ||
}; | ||
|
||
//5G WIFI | ||
&pcie0 { | ||
wifi@0,0 { | ||
compatible = "pci14c3,7662"; | ||
reg = <0x0000 0 0 0 0>; | ||
mediatek,mtd-eeprom = <&factory 0x8000>; | ||
ieee80211-freq-limit = <5000000 6000000>; | ||
// nvmem-cells = <&macaddr_factory_4>; | ||
// nvmem-cell-names = "mac-address"; | ||
// mac-address-increment = <2>; | ||
}; | ||
}; | ||
|
||
//2.4G WIFI | ||
&wmac { | ||
pinctrl-names = "default"; | ||
pinctrl-0 = <&pa_pins>; | ||
ralink,mtd-eeprom = <&factory 0x0>; | ||
// nvmem-cells = <&macaddr_factory_4>; | ||
// nvmem-cell-names = "mac-address"; | ||
}; | ||
|
||
&state_default { | ||
gpio { | ||
groups = "uartf", "wled"; | ||
function = "gpio"; | ||
}; | ||
}; | ||
|
||
&factory { | ||
compatible = "nvmem-cells"; | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
|
||
macaddr_factory_4: macaddr@4 { | ||
reg = <0x4 0x6>; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
target/linux/ramips/mt7620/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[ "$ACTION" == "add" ] || exit 0 | ||
|
||
PHYNBR=${DEVPATH##*/phy} | ||
|
||
[ -n $PHYNBR ] || exit 0 | ||
|
||
. /lib/functions.sh | ||
. /lib/functions/system.sh | ||
|
||
board=$(board_name) | ||
|
||
case "$board" in | ||
hiwifi,hc5661) | ||
label_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac ") | ||
[ "$PHYNBR" = "0" ] && [ -n "$label_mac" ] && \ | ||
echo -n "$label_mac" > /sys${DEVPATH}/macaddress | ||
;; | ||
hiwifi,hc5761|\ | ||
hiwifi,hc5861) | ||
label_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac ") | ||
[ "$PHYNBR" = "1" ] && [ -n "$label_mac" ] && \ | ||
echo -n "$label_mac" > /sys${DEVPATH}/macaddress | ||
[ "$PHYNBR" = "0" ] && [ -n "$label_mac" ] && \ | ||
macaddr_unsetbit "$label_mac" 6 > /sys${DEVPATH}/macaddress | ||
;; | ||
hiwifi,r33) | ||
label_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac ") | ||
[ "$PHYNBR" = "1" ] && [ -n "$label_mac" ] && \ | ||
echo -n "$label_mac" > /sys${DEVPATH}/macaddress | ||
[ "$PHYNBR" = "0" ] && [ -n "$label_mac" ] && \ | ||
macaddr_unsetbit "$label_mac" 6 > /sys${DEVPATH}/macaddress | ||
;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0c40df8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7620/7621设备在lede这个源上一但跑大流量,会有反复断线的问题,这是一个从20年甚至更早就有的问题了,相关issue到现在也没关,现在看来还是没有修复...
@zfdx123 找到病因了,就是这个倒霉的commit,改回去就好了。
加上硬件分流和闭源驱动,拨号无线跑满300M宽带是毫无压力了,峰值表现应该能再高点。
再把不稳定的2.4G WiFi禁用(mt7620 switch上的无用port最好也删掉,看上去干净点),极路由3 Pro的openwrt也算是彻底能稳定使用了,希望老哥最后再去恩山发个新版本呗。
说起来openwrt上游早在19.05,就撤销了这个只存在19.04一个小版本的提交,lede和immoralwrt却都幸运的将这个bug延续了好几年。