From 612d5282b5107635e015dbbc40924509bea209fc Mon Sep 17 00:00:00 2001 From: David Bauer Date: Sat, 18 Jul 2020 22:12:19 +0200 Subject: [PATCH 1/3] ramips: don't create switch config for VIXMINI Don't create UCI switch config for the GL.iNet microuter-N300 and VIXMINI. These devices only have a single LAN port. Creating the switch config makes usage of VLANs more complicated, as they would have to be configured on the MAC as well as the "switch". Signed-off-by: David Bauer --- .../linux/ramips/mt76x8/base-files/etc/board.d/02_network | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network index e3d18b5fba..0809109c13 100755 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network @@ -11,6 +11,8 @@ ramips_setup_interfaces() case $board in alfa-network,awusfree1|\ d-team,pbr-d1|\ + glinet,microuter-n300|\ + glinet,vixmini|\ mediatek,linkit-smart-7688|\ onion,omega2p|\ onion,omega2|\ @@ -57,11 +59,6 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "1:lan" "0:wan" "6@eth0" ;; - glinet,microuter-n300|\ - glinet,vixmini) - ucidef_add_switch "switch0" \ - "0:lan" "6@eth0" - ;; hilink,hlk-7628n|\ hiwifi,hc5861b|\ skylab,skw92a|\ From 2e4626ae77fe81c45fb708a37ac1709aefa033d3 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Fri, 17 Jul 2020 11:23:16 +0200 Subject: [PATCH 2/3] ramips: remove incorrect mtd-eeprom for TP-Link TL-WR841N v14 The factory partition on this device is only 64k in size, so having mediatek,mtd-eeprom = <&factory 0x10000> would place the EEPROM data after the end of the flash. As can be verified against the TP-Link GPL sources, which contain the EEPROM data as binary blob, the actual address for the EEPROM data is 0x0. Since 0x0 is default for MT7628, the incorrect line is just removed. This error is the reason for the abysmal Wifi performance that people are complaining about for the WR841Nv14. Fixes: 3fd97c522bb7 ("ramips: add support for TP-Link TL-WR841n v14") Signed-off-by: Adrian Schmutzler --- target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v14.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v14.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v14.dts index eaac196c19..b33c2ecae8 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v14.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v14.dts @@ -103,8 +103,8 @@ &wmac { status = "okay"; + mtd-mac-address = <&factory 0xf100>; - mediatek,mtd-eeprom = <&factory 0x10000>; }; ðernet { From 1623defbdbb852a4018329d07673b4b8f66225a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20M=C3=BCller?= Date: Fri, 17 Jul 2020 18:46:19 +0200 Subject: [PATCH 3/3] ramips: fix flash layout for TP-Link TL-WR841N v14 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The config partition was missing from the flash layout of the device. Although the stock firmware resets a corrupted config partition to the default values, the TFTP flash with an image bigger than 0x3d0000 will truncate the image as the bootloader only copies 0x3d0000 bytes to flash during TFTP flashing. Fixed by adding the config partition and shrinking the firmware partition. Fixes: 3fd97c522bb7 ("ramips: add support for TP-Link TL-WR841n v14") Signed-off-by: Alexander Müller --- target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v14.dts | 8 +++++++- target/linux/ramips/image/mt76x8.mk | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v14.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v14.dts index b33c2ecae8..885e069b02 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v14.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v14.dts @@ -81,7 +81,13 @@ partition@10000 { compatible = "tplink,firmware"; label = "firmware"; - reg = <0x10000 0x3e0000>; + reg = <0x10000 0x3d0000>; + }; + + partition@3e0000 { + label = "config"; + reg = <0x3e0000 0x10000>; + read-only; }; factory: partition@3f0000 { diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index 4b2255bd6a..c9e70b7672 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -498,7 +498,7 @@ TARGET_DEVICES += tplink_tl-wr841n-v13 define Device/tplink_tl-wr841n-v14 $(Device/tplink-v2) - IMAGE_SIZE := 3968k + IMAGE_SIZE := 3904k DEVICE_MODEL := TL-WR841N DEVICE_VARIANT := v14 TPLINK_FLASHLAYOUT := 4Mmtk