Thanks to our friends frollic and slh I solved the problems of editing files which were not compatible with Linux/Debian LibreOffice ... And now the compilaion provides me with many firmwares which have the sysupgrade which works
I still have a problem which is that the MAC addresses of the WIFI are not correct
Indeed with the attached dts file retrieved from x-wrt I have these addresses which are identical to that of the LAN
I had a similar problem with the KuWfi Tenbay WIFI-6 AX T-MB5EU-V01 solved with the latest SnapShot by our friend blocktrron with patch in ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac so I'm looking for a solution to that without having to modify the dts file not knowing what to do
After modify in dts mac-address-increment = <(2)>; 2 to 1 i have:
Lan= Sticker
Wan = Sticker +1 ( before Sticker +2 )
Remains to be found as for the KuWfi Tenbay WIFI-6 AX T-MB5EU-V01
Wifi 2.4 GHz = Sticker +2
Wifi 5GHz = Sticker +3
Those addresses are defined as offsets, so you need to do that in the DTS if you'd like to see the code included in OpenWrt proper.
No need for the brackets by the way, just this is sufficient:
mac-address-increment = <2>;
E.g.:
&pcie1 {
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&factory 0x0000>;
mtd-mac-address = <&factory 0x4>;
nvmem-cells = <&macaddr_factory_4>;
nvmem-cell-names = "mac-address";
mac-address-increment = <2>;
};
};
I don't see a second radio definition so not sure how to tinker there. Usually there's a wmac
declaration if the other radio (often 2,4 GHz) is provided by the SoC itself and not as a separate chip.
Found solution for Wifi Mac by inspiring me KuWfi Tenbay WIFI-6 AX T-MB5EU-V01:
Lan= Sticker
Wan = Sticker +1
Wifi 2.4 GHz = Sticker +2
Wifi 5GHz = Sticker +3
/etc/hotplug.d/ieee80211/10_fix_wifi_mac
[ "$ACTION" == "add" ] || exit 0
PHYNBR=${DEVPATH##*/phy}
[ -n $PHYNBR ] || exit 0
. /lib/functions.sh
. /lib/functions/system.sh
board=$(board_name)
case "$board" in
dlink,dir-853-a3)
[ "$PHYNBR" = "0" ] && \
macaddr_setbit_la "$(mtd_get_mac_binary factory 0xe000)" \
> /sys${DEVPATH}/macaddress
;;
dlink,dir-853-r1)
if [ "$PHYNBR" = "0" ]; then
base_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x4)" -1)
macaddr_setbit_la "$base_mac" > /sys${DEVPATH}/macaddress
fi
;;
glinet,gl-mt1300)
[ "$PHYNBR" = "1" ] && \
macaddr_add "$(mtd_get_mac_binary factory 0x4)" 1 > /sys${DEVPATH}/macaddress
;;
jcg,q20)
[ "$PHYNBR" = "1" ] && \
macaddr_setbit_la "$(mtd_get_mac_binary Factory 0x4)" > /sys${DEVPATH}/macaddress
;;
linksys,e5600|\
linksys,ea6350-v4|\
linksys,ea7300-v1|\
linksys,ea7300-v2|\
linksys,ea7500-v2|\
linksys,ea8100-v1|\
linksys,ea8100-v2)
hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
[ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 1 > /sys${DEVPATH}/macaddress
[ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress
;;
raisecom,msg1500-x-00)
[ "$PHYNBR" = "0" ] && \
macaddr_setbit_la "$(mtd_get_mac_ascii Config protest_lan_mac)" \
> /sys${DEVPATH}/macaddress
;;
tenbay,t-mb5eu-v01)
hw_mac_addr="$(mtd_get_mac_binary factory 0x4)"
[ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr "1" > /sys${DEVPATH}/macaddress
[ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr "-1" > /sys${DEVPATH}/macaddress
;;
huasifei,wr1800k-ax-nand)
hw_mac_addr="$(mtd_get_mac_binary factory 0x4)"
[ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr "0" > /sys${DEVPATH}/macaddress
[ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr "1" > /sys${DEVPATH}/macaddress
;;
esac
New dts content file:
/dts-v1/;
#include "mt7621.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
compatible = "huasifei,wr1800k-ax-nand", "mediatek,mt7621-soc";
model = "WR1800K-AX-NAND";
aliases {
led-status = &led_ether;
label-mac-device = &gmac0;
};
chosen {
bootargs = "console=ttyS0,115200";
};
leds {
compatible = "gpio-leds";
wlan {
label = "wlan:green";
gpios = <&gpio 8 GPIO_ACTIVE_HIGH>;
default-state = "off";
};
led_ether: ether {
label = "ether:blue";
gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;
default-state = "on";
};
status {
label = "status:red";
gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
default-state = "off";
};
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
gpios = <&gpio 18 GPIO_ACTIVE_HIGH>;
linux,code = <KEY_RESTART>;
};
wps {
label = "wps";
gpios = <&gpio 4 GPIO_ACTIVE_HIGH>;
linux,code = <KEY_WPS_BUTTON>;
};
};
};
&nand {
status = "okay";
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "Bootloader";
reg = <0x0 0x80000>;
};
partition@80000 {
label = "Config";
reg = <0x80000 0x80000>;
};
factory: partition@100000 {
label = "factory";
reg = <0x100000 0x80000>;
read-only;
};
partition@600000 {
label = "kernel";
reg = <0x180000 0x400000>;
};
partition@a00000 {
label = "ubi";
reg = <0x580000 0x7180000>;
};
};
};
&pcie {
status = "okay";
};
&pcie1 {
wifi@0,0 {
reg = <0x0 0 0 0 0>;
mediatek,mtd-eeprom = <&factory 0x0>;
};
};
ðernet {
pinctrl-names = "default";
pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
};
&gmac0 {
nvmem-cells = <&macaddr_factory_28>;
nvmem-cell-names = "mac-address";
};
&gmac1 {
status = "okay";
label = "wan";
nvmem-cells = <&macaddr_factory_28>;
nvmem-cell-names = "mac-address";
mac-address-increment = <(1)>;
phy-mode = "rgmii-txid";
phy-handle = <&phy4>;
};
&mdio {
phy4: ethernet-phy@4 {
reg = <4>;
};
};
&switch0 {
ports {
port@1 {
status = "okay";
label = "lan1";
};
port@2 {
status = "okay";
label = "lan2";
};
port@3 {
status = "okay";
label = "lan3";
};
};
};
&pinctrl {
state_default: pinctrl0 {
gpio {
groups = "i2c", "uart2", "uart3";
function = "gpio";
};
};
};
&factory {
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;
macaddr_factory_4: macaddr@4 {
reg = <0x4 0x6>;
};
macaddr_factory_28: macaddr@28 {
reg = <0x28 0x6>;
};
};
1 Like
If anyone knows how to pass this information to add it to the snapshots
add-on to mt7621.mk
define Device/huasifei_wr1800k-ax-nand
$(Device/dsa-migration)
$(Device/uimage-lzma-loader)
BLOCKSIZE := 128k
PAGESIZE := 2048
KERNEL_SIZE := 4096k
IMAGE_SIZE := 129408k
UBINIZE_OPTS := -E 5
IMAGES += factory.bin
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | check-size
DEVICE_VENDOR := HUASIFEI
DEVICE_MODEL := WR1800K-AX
DEVICE_VARIANT := NAND
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7615-firmware
endef
TARGET_DEVICES += huasifei_wr1800k-ax-nand
add-on to platform.sh
asus,rt-ac85p)
echo "Backing up firmware"
dd if=/dev/mtd4 bs=1024 count=4096 > /tmp/backup_firmware.bin
dd if=/dev/mtd5 bs=1024 count=52224 >> /tmp/backup_firmware.bin
mtd -e firmware2 write /tmp/backup_firmware.bin firmware2
;;
esac
case "$board" in
huasifei,wr1800k-ax-nand)
nand_do_upgrade "$1"
;;
You can create a GitHub pull request. That needs to pass review (even seemingly trivial ones). Might take you some time but will pay dividends if you can just install vanilla OpenWrt images later on.
Borompini ->
At 75, soon to be 76 , i consider that I am no longer old enough to have fun doing what you ask me to do.
I hope someone much younger will know how to use the information i give to make this router work.
Same product:
tmomas
Closed
January 27, 2022, 11:10pm
8
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.