Re: [LEDE-DEV] [PATCH v2 2/3] ipq806x: Add support for new device: tew827dru

2016-09-15 Thread Mathias Kresin

14.09.2016 14:17, J Mo:

On 09/11/2016 01:39 AM, Mathias Kresin wrote:

This one is quite neat. It allows me to verify my changes. Would you
please try the attached patch.

Before:

$ ./caldata -i './caldata1.bin' -v
Size: 12064
MAC: 12:34:56:78:90:12
Checksum: 0xdf10 (OK)

Patched:

$ ./caldata -v -i ./patched.bin
Size: 12064
MAC: aa:bb:cc:dd:ee:ff
Checksum: 0x184c (OK)



Just tested. firmware fails to load.


There was an endianess issue in the script which is fixed. Can we 
continue discussing my approach to patch the mac address at 
https://github.com/lede-project/source/pull/324? It is about the same 
topic and we already made some progress. The latest version of my patch 
is linked there as well.


It doesn't work yet completely, since there seams to be something in the 
caldata which triggers the replacement of parts of the mac address with 
random(?) values.


Mathias

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH v2 2/3] ipq806x: Add support for new device: tew827dru

2016-09-14 Thread J Mo



On 09/11/2016 01:39 AM, Mathias Kresin wrote:

11.09.2016 03:36, J Mo:



On 09/10/2016 10:27 AM, Mathias Kresin wrote:

10.09.2016 03:35, J Mo:

--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -168,3 +168,19 @@ define Build/sysupgrade-tar
 --rootfs $(call
param_get_default,rootfs,$(1),$(IMAGE_ROOTFS)) \
 $@
 endef
+
+define Build/cameo-sig
+{ \
+cameo_sig=$(word 1, $(1)) ;\
+align=$(if $(2),$(2),64) ;\
+oldsize=$$(stat -c %s $@) ;\
+sigsize=$$(echo -n $$cameo_sig | wc -c) ;\
+padsize=$$(( ( ( ( $$oldsize + $$sigsize ) / $$align ) + 1 )
- ( ( $$oldsize + $$sigsize ) / $$align ) )) ;\
+newsize=$$(( $$oldsize + $$padsize )) ;\
+echo "Appending Cameo signature: \"$$cameo_sig\",
oldsize=$$oldsize align=$$align sigsize=$$sigsize padsize=$$padsize
newsize=$$newsize" ;\
+dd if=$@ of=$@.new bs=$$newsize count=1 conv=sync ;\
+echo -n "$$cameo_sig" >> $@.new ; \
+}
+@mv $@.new $@
+endef




I'm not doing anything obscure here. This should be self-evident. Add a
byte-aligned signature. pad-to can't do that.


Well if it would be obvious what you are trying to do I wouldn't ask.

I still don't get what and to which boundary you are trying to align. 
After fixing the build errors I do get the following:


Appending Cameo signature: "AP148AR9880-RT-150127-00", oldsize=5901955 
align=64 sigsize=24 padsize=1 newsize=5901956


PreFooter size: 5901956
PostFooter size: 5901979

Neither the pre footer image nor the post footer image is padded to a 
multiple of 64 byte.


Do you want to add the signature to a 64 byte padded image or should 
the image + signature padded to a multiple of 64byte? Where does the 
64 byte does come from? It doesn't seam to be related to the 128k 
blocksize of the flash.




Okay, I apologize. I don't know WTF I was thinking when I did that. It 
was actually working before and then I changed it for reasons I can't 
explain properly without drugs.


padsize=$$(( ( ( ( ( ( $$oldsize + $$sigsize ) / $$align ) + 1 ) * 
$$align ) - $$oldsize ) - $$sigsize )) ;\


This works.





diff --git
a/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac 

b/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac 



index 1ae4352..a3326ab 100644
---
a/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac 



+++
b/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac 



@@ -18,6 +18,9 @@ case "$board" in
 ea8500)
 echo $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr)
$(($PHYNBR + 1)) ) > /sys${DEVPATH}/macaddress
 ;;
+tew827dru)
+echo $(macaddr_add $(mtd_get_mac_ascii APPSBLENV wan_mac)
$(($PHYNBR + 1)) ) > /sys${DEVPATH}/macaddress
+;;
 *)
 ;;
 esac


This whole file (already before your changes) looks completely wrong
to me. Would you please send me a dump of your ART partition!

I'll have a look at the checksum. I've a checksum patcher for ath9k in
place (https://git.io/vi0eK) which might work for QCA99x0 caldata as
well. This way the ath10kcal_patch_mac function in
hotplug.d/firmware/11-ath10k-caldata can be used to fix the wifi mac
address.


I have uploaded a dump of two ART partitions from two different
tew827dru here if you or anyone else wants to look at them:

http://jmomo.net/files/lede/tew827dru-ARTs/

There is some discussion about this over on the TP-Link Archer C2600
thread. I suggest you go check it out for additional background:

https://forum.openwrt.org/viewtopic.php?id=54973=13
https://forum.openwrt.org/viewtopic.php?id=54973=14
https://forum.openwrt.org/viewtopic.php?pid=317711#p317711
https://github.com/ianchi/openwrt/commit/83084c84414b44801a1ba8f323b363f0bc748e64 



This one is quite neat. It allows me to verify my changes. Would you 
please try the attached patch.


Before:

$ ./caldata -i './caldata1.bin' -v
Size: 12064
MAC: 12:34:56:78:90:12
Checksum: 0xdf10 (OK)

Patched:

$ ./caldata -v -i ./patched.bin
Size: 12064
MAC: aa:bb:cc:dd:ee:ff
Checksum: 0x184c (OK)



Just tested. firmware fails to load.

Here is some log:

[   10.439390] ath10k_pci :01:00.0: enabling device (0140 -> 0142)
[   10.439947] ath10k_pci :01:00.0: pci irq msi oper_irq_mode 2 
irq_mode 0 reset_mode 0
[   10.573751] ath10k_pci :01:00.0: Direct firmware load for 
ath10k/pre-cal-pci-:01:00.0.bin failed with error -2

[   10.573784] ath10k_pci :01:00.0: Falling back to user helper
[   10.608498] firmware ath10k!pre-cal-pci-:01:00.0.bin: 
firmware_loading_store: map pages failed
[   10.608742] ath10k_pci :01:00.0: Direct firmware load for 
ath10k/cal-pci-:01:00.0.bin failed with error -2

[   10.616430] ath10k_pci :01:00.0: Falling back to user helper
[   11.245654] ath10k_pci :01:00.0: qca99x0 hw2.0 target 0x0100 
chip_id 0x003b01ff sub 168c:0002
[   11.245691] ath10k_pci :01:00.0: kconfig debug 0 debugfs 

Re: [LEDE-DEV] [PATCH v2 2/3] ipq806x: Add support for new device: tew827dru

2016-09-11 Thread Mathias Kresin

11.09.2016 06:07, J Mo:



On 09/10/2016 06:36 PM, J Mo wrote:

diff --git
a/target/linux/ipq806x/base-files/lib/preinit/06_set_iface_mac
b/target/linux/ipq806x/base-files/lib/preinit/06_set_iface_mac
new file mode 100644
index 000..b4ed225
--- /dev/null
+++ b/target/linux/ipq806x/base-files/lib/preinit/06_set_iface_mac
@@ -0,0 +1,23 @@
+#!/bin/sh
+#
+# Copyright (c) 2014 The Linux Foundation. All rights reserved.
+#
+
+set_ether_mac() {
+. /lib/functions/uci-defaults.sh
+. /lib/ipq806x.sh
+. /lib/functions/system.sh
+
+board=$(ipq806x_board_name)
+
+case "$board" in
+tew827dru)
+# Set the correct ethernet MAC addresses per OEM intent.
+ifconfig eth0 hw ether $(mtd_get_mac_ascii APPSBLENV
wan_mac) 2>/dev/null
+ifconfig eth1 hw ether $(mtd_get_mac_ascii APPSBLENV
lan_mac) 2>/dev/null
+;;
+esac
+
+}
+
+boot_hook_add preinit_main set_ether_mac


Okay I guess I see what you are trying to do. But you doing it at the
wrong place using the wrong functions. Please have a look at
https://git.lede-project.org/?p=source.git;a=blob;f=target/linux/lantiq/base-files/etc/board.d/02_network
to see how to set the mac addresses properly.



Oh yea, that's much better.


Nevermind, your method does not address the problem. This probably has
to be done in preinit or at least before any subinterfaces are created.

Other devices are already doing this, probably for the same reasons.


Which doesn't mean that it's correct what is done with other boards. 
It's the job of netifd to set mac addresses. Bypassing netifd for the 
network configuration is a no go for me.




Right:

root@lede:/# ifconfig -a | egrep -i hwadd
br-lanLink encap:Ethernet  HWaddr D8:EB:97:30:30:03
eth0  Link encap:Ethernet  HWaddr D8:EB:97:30:30:03
eth0.1Link encap:Ethernet  HWaddr D8:EB:97:30:30:03
eth1  Link encap:Ethernet  HWaddr D8:EB:97:30:30:04
eth1.2Link encap:Ethernet  HWaddr D8:EB:97:30:30:04

Wrong:

root@lede:/# ifconfig -a | egrep -i hwadd
br-lanLink encap:Ethernet  HWaddr D8:EB:97:30:30:03
eth0  Link encap:Ethernet  HWaddr 00:03:7F:BA:DB:01
eth0.1Link encap:Ethernet  HWaddr D8:EB:97:30:30:03
eth1  Link encap:Ethernet  HWaddr 00:03:7F:BA:DB:02
eth1.2Link encap:Ethernet  HWaddr D8:EB:97:30:30:04


Well, it is perfect fine. Your configured lan (br-lan) and wan (eth1.2) 
are using the configured mac addresses. The physical interfaces are 
having a random macs, which is fine since no package is send over these 
interface.


I mean having the correct mac address for the physical interfaces looks 
nice but isn't really required. Feel free to use tcpdump/wireshark to 
confirm that outgoing packages have the correct mac address.


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH v2 2/3] ipq806x: Add support for new device: tew827dru

2016-09-11 Thread Mathias Kresin

10.09.2016 03:35, J Mo:

diff --git a/target/linux/ipq806x/patches-4.4/800-devicetree.patch 
b/target/linux/ipq806x/patches-4.4/800-devicetree.patch
index 85f2534..ae174fd 100644
--- a/target/linux/ipq806x/patches-4.4/800-devicetree.patch
+++ b/target/linux/ipq806x/patches-4.4/800-devicetree.patch
@@ -12,7 +12,7 @@ Signed-off-by: Jonas Gorski 

 --- a/arch/arm/boot/dts/Makefile
 +++ b/arch/arm/boot/dts/Makefile
-@@ -506,7 +506,13 @@ dtb-$(CONFIG_ARCH_QCOM) += \
+@@ -506,7 +506,14 @@ dtb-$(CONFIG_ARCH_QCOM) += \
qcom-apq8084-ifc6540.dtb \
qcom-apq8084-mtp.dtb \
qcom-ipq8064-ap148.dtb \
@@ -23,6 +23,7 @@ Signed-off-by: Jonas Gorski 
 +  qcom-ipq8064-r7500.dtb \
 +  qcom-ipq8064-r7500v2.dtb \
 +  qcom-ipq8065-r7800.dtb \
++  qcom-ipq8064-tew827dru.dtb \
qcom-msm8660-surf.dtb \
qcom-msm8960-cdp.dtb \
qcom-msm8974-sony-xperia-honami.dtb



After your change:

Applying patch platform/800-devicetree.patch
patching file arch/arm/boot/dts/Makefile
patch:  malformed patch at line 29: qcom-msm8974-sony-xperia-honami.dtb

If you edit the patch by hand, you should adjust the patch header as well:

-@@ -506,7 +506,13 @@ dtb-$(CONFIG_ARCH_QCOM) += \
+@@ -506,7 +506,14 @@ dtb-$(CONFIG_ARCH_QCOM) += \

But I still get a build error using the patches from patchwork:

bash: /data/build/lede/scripts/its-maker.sh: Permission denied
Makefile:223: recipe for target 
'/data/build/lede/build_dir/target-arm_cortex-a15+neon-vfpv4_musl-1.1.15_eabi/linux-ipq806x/tmp/lede-ipq806x-TEW827DRU-squashfs-factory.bin' 
failed


You have a few trailing whitespace errors in your patches. Please use 
./scripts/checkpatch.pl on your patches and fix at least the trailing 
whitespace errors!


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH v2 2/3] ipq806x: Add support for new device: tew827dru

2016-09-10 Thread J Mo



On 09/10/2016 06:36 PM, J Mo wrote:
diff --git 
a/target/linux/ipq806x/base-files/lib/preinit/06_set_iface_mac 
b/target/linux/ipq806x/base-files/lib/preinit/06_set_iface_mac

new file mode 100644
index 000..b4ed225
--- /dev/null
+++ b/target/linux/ipq806x/base-files/lib/preinit/06_set_iface_mac
@@ -0,0 +1,23 @@
+#!/bin/sh
+#
+# Copyright (c) 2014 The Linux Foundation. All rights reserved.
+#
+
+set_ether_mac() {
+. /lib/functions/uci-defaults.sh
+. /lib/ipq806x.sh
+. /lib/functions/system.sh
+
+board=$(ipq806x_board_name)
+
+case "$board" in
+tew827dru)
+# Set the correct ethernet MAC addresses per OEM intent.
+ifconfig eth0 hw ether $(mtd_get_mac_ascii APPSBLENV 
wan_mac) 2>/dev/null
+ifconfig eth1 hw ether $(mtd_get_mac_ascii APPSBLENV 
lan_mac) 2>/dev/null

+;;
+esac
+
+}
+
+boot_hook_add preinit_main set_ether_mac


Okay I guess I see what you are trying to do. But you doing it at the 
wrong place using the wrong functions. Please have a look at 
https://git.lede-project.org/?p=source.git;a=blob;f=target/linux/lantiq/base-files/etc/board.d/02_network 
to see how to set the mac addresses properly.




Oh yea, that's much better.


Nevermind, your method does not address the problem. This probably has 
to be done in preinit or at least before any subinterfaces are created.


Other devices are already doing this, probably for the same reasons.

Right:

root@lede:/# ifconfig -a | egrep -i hwadd
br-lanLink encap:Ethernet  HWaddr D8:EB:97:30:30:03
eth0  Link encap:Ethernet  HWaddr D8:EB:97:30:30:03
eth0.1Link encap:Ethernet  HWaddr D8:EB:97:30:30:03
eth1  Link encap:Ethernet  HWaddr D8:EB:97:30:30:04
eth1.2Link encap:Ethernet  HWaddr D8:EB:97:30:30:04

Wrong:

root@lede:/# ifconfig -a | egrep -i hwadd
br-lanLink encap:Ethernet  HWaddr D8:EB:97:30:30:03
eth0  Link encap:Ethernet  HWaddr 00:03:7F:BA:DB:01
eth0.1Link encap:Ethernet  HWaddr D8:EB:97:30:30:03
eth1  Link encap:Ethernet  HWaddr 00:03:7F:BA:DB:02
eth1.2Link encap:Ethernet  HWaddr D8:EB:97:30:30:04


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH v2 2/3] ipq806x: Add support for new device: tew827dru

2016-09-10 Thread J Mo



On 09/10/2016 10:27 AM, Mathias Kresin wrote:

10.09.2016 03:35, J Mo:

--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -168,3 +168,19 @@ define Build/sysupgrade-tar
 --rootfs $(call 
param_get_default,rootfs,$(1),$(IMAGE_ROOTFS)) \

 $@
 endef
+
+define Build/cameo-sig
+{ \
+cameo_sig=$(word 1, $(1)) ;\
+align=$(if $(2),$(2),64) ;\
+oldsize=$$(stat -c %s $@) ;\
+sigsize=$$(echo -n $$cameo_sig | wc -c) ;\
+padsize=$$(( ( ( ( $$oldsize + $$sigsize ) / $$align ) + 1 ) 
- ( ( $$oldsize + $$sigsize ) / $$align ) )) ;\

+newsize=$$(( $$oldsize + $$padsize )) ;\
+echo "Appending Cameo signature: \"$$cameo_sig\", 
oldsize=$$oldsize align=$$align sigsize=$$sigsize padsize=$$padsize 
newsize=$$newsize" ;\


remove the debug output



Yes.


+dd if=$@ of=$@.new bs=$$newsize count=1 conv=sync ;\
+echo -n "$$cameo_sig" >> $@.new ; \
+}
+@mv $@.new $@
+endef


Please move the build recipe to the ipq806x Makefile. The tew827dru is 
the only board which uses the recipe. It can be moved to 
image-commands.mk as soon as another board requires the recipe.


I might don't get what you are trying to do here but this looks way to 
complicated to me. It looks rather a job for pad-offset. Would you 
please explain how the footer should look like.




Cameo signatures are already used by a large number of devices. This 
should do the same thing, but in the new makefile style. The old style 
was nearly incomprehensible.


I'm not doing anything obscure here. This should be self-evident. Add a 
byte-aligned signature. pad-to can't do that.






+
diff --git a/target/linux/ipq806x/base-files/etc/board.d/01_leds 
b/target/linux/ipq806x/base-files/etc/board.d/01_leds

index 0b75b11..269dfa8 100755
--- a/target/linux/ipq806x/base-files/etc/board.d/01_leds
+++ b/target/linux/ipq806x/base-files/etc/board.d/01_leds
@@ -33,6 +33,12 @@ ea8500)
 ucidef_set_led_wlan "wifi" "WIFI" "ea8500:green:wifi" "phy0radio"
 ucidef_set_led_default "wps" "WPS" "ea8500:green:wps" "0"
 ;;
+tew827dru)
+ucidef_set_led_usbdev "usb2" "USB2" "tew827dru:blue:usb" "2-1"
+# The ledtrig_usbdev kernel module can only map 1 LED-GPIO to 1 
USB port.

+# Thus, this only works for one of the two ports, for now.
+# ucidef_set_led_usbdev "usb4" "USB4" "tew827dru:blue:usb" "4-1"


drop the comments and add the info to the commit message.



Yes.




+;;
 *)
 ;;
 esac
diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network 
b/target/linux/ipq806x/base-files/etc/board.d/02_network

index b720455..e419f9b 100755
--- a/target/linux/ipq806x/base-files/etc/board.d/02_network
+++ b/target/linux/ipq806x/base-files/etc/board.d/02_network
@@ -22,6 +22,10 @@ r7800)
 ucidef_add_switch "switch0" \
 "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
 ;;
+tew827dru)
+ucidef_add_switch "switch0" \
+"1:lan" "2:lan" "3:lan" "4:lan" "6t@eth1" "5:wan" "0t@eth0"
+;;
 db149)
 ucidef_set_interface_lan "eth1 eth2 eth3"
 ucidef_add_switch "switch0" \
diff --git a/target/linux/ipq806x/base-files/etc/diag.sh 
b/target/linux/ipq806x/base-files/etc/diag.sh

index 0bf5934..11705ee 100755
--- a/target/linux/ipq806x/base-files/etc/diag.sh
+++ b/target/linux/ipq806x/base-files/etc/diag.sh
@@ -11,6 +11,9 @@ get_status_led() {
 ea8500)
 status_led="ea8500:white:power"
 ;;
+tew827dru)
+status_led="tew827dru:blue:power"
+;;
 esac
 }

diff --git 
a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata 
b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata 


index c7977e6..a218183 100644
--- 
a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ 
b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata

@@ -60,6 +60,10 @@ case "$FIRMWARE" in
  r7800)
 ath10kcal_extract "art" 4096 12064
 ;;
+tew827dru)
+hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
+ath10kcal_extract "ART" 4096 12064
+;;
 esac
 ;;
 "ath10k/cal-pci-0001:01:00.0.bin")
@@ -76,6 +80,10 @@ case "$FIRMWARE" in
 r7800)
 ath10kcal_extract "art" 20480 12064
 ;;
+tew827dru)
+hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
+ath10kcal_extract "ART" 20480 12064
+;;


Copy/Paste leftover? As far as I can see, there isn't even an devinfo 
partition from which the mac address could be extracted.




Thanks for finding that. I am guessing it slipped in during a git rebase.




 esac
 ;;
 *)
diff --git 
a/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac 
b/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac 


index 1ae4352..a3326ab 100644
--- 
a/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
+++ 

Re: [LEDE-DEV] [PATCH v2 2/3] ipq806x: Add support for new device: tew827dru

2016-09-10 Thread Mathias Kresin

10.09.2016 03:35, J Mo:

--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -168,3 +168,19 @@ define Build/sysupgrade-tar
--rootfs $(call param_get_default,rootfs,$(1),$(IMAGE_ROOTFS)) \
$@
 endef
+
+define Build/cameo-sig
+   { \
+   cameo_sig=$(word 1, $(1)) ;\
+   align=$(if $(2),$(2),64) ;\
+   oldsize=$$(stat -c %s $@) ;\
+   sigsize=$$(echo -n $$cameo_sig | wc -c) ;\
+   padsize=$$(( ( ( ( $$oldsize + $$sigsize ) / $$align ) + 1 ) - 
( ( $$oldsize + $$sigsize ) / $$align ) )) ;\
+   newsize=$$(( $$oldsize + $$padsize )) ;\
+   echo "Appending Cameo signature: \"$$cameo_sig\", oldsize=$$oldsize 
align=$$align sigsize=$$sigsize padsize=$$padsize newsize=$$newsize" ;\


remove the debug output


+   dd if=$@ of=$@.new bs=$$newsize count=1 conv=sync ;\
+   echo -n "$$cameo_sig" >> $@.new ; \
+   }
+   @mv $@.new $@
+endef


Please move the build recipe to the ipq806x Makefile. The tew827dru is 
the only board which uses the recipe. It can be moved to 
image-commands.mk as soon as another board requires the recipe.


I might don't get what you are trying to do here but this looks way to 
complicated to me. It looks rather a job for pad-offset. Would you 
please explain how the footer should look like.



+
diff --git a/target/linux/ipq806x/base-files/etc/board.d/01_leds 
b/target/linux/ipq806x/base-files/etc/board.d/01_leds
index 0b75b11..269dfa8 100755
--- a/target/linux/ipq806x/base-files/etc/board.d/01_leds
+++ b/target/linux/ipq806x/base-files/etc/board.d/01_leds
@@ -33,6 +33,12 @@ ea8500)
ucidef_set_led_wlan "wifi" "WIFI" "ea8500:green:wifi" "phy0radio"
ucidef_set_led_default "wps" "WPS" "ea8500:green:wps" "0"
;;
+tew827dru)
+   ucidef_set_led_usbdev "usb2" "USB2" "tew827dru:blue:usb" "2-1"
+   # The ledtrig_usbdev kernel module can only map 1 LED-GPIO to 1 USB 
port.
+   # Thus, this only works for one of the two ports, for now.
+   # ucidef_set_led_usbdev "usb4" "USB4" "tew827dru:blue:usb" "4-1"


drop the comments and add the info to the commit message.


+   ;;
 *)
;;
 esac
diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network 
b/target/linux/ipq806x/base-files/etc/board.d/02_network
index b720455..e419f9b 100755
--- a/target/linux/ipq806x/base-files/etc/board.d/02_network
+++ b/target/linux/ipq806x/base-files/etc/board.d/02_network
@@ -22,6 +22,10 @@ r7800)
ucidef_add_switch "switch0" \
"1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
;;
+tew827dru)
+   ucidef_add_switch "switch0" \
+   "1:lan" "2:lan" "3:lan" "4:lan" "6t@eth1" "5:wan" "0t@eth0"
+   ;;
 db149)
ucidef_set_interface_lan "eth1 eth2 eth3"
ucidef_add_switch "switch0" \
diff --git a/target/linux/ipq806x/base-files/etc/diag.sh 
b/target/linux/ipq806x/base-files/etc/diag.sh
index 0bf5934..11705ee 100755
--- a/target/linux/ipq806x/base-files/etc/diag.sh
+++ b/target/linux/ipq806x/base-files/etc/diag.sh
@@ -11,6 +11,9 @@ get_status_led() {
ea8500)
status_led="ea8500:white:power"
;;
+   tew827dru)
+   status_led="tew827dru:blue:power"
+   ;;
esac
 }

diff --git 
a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata 
b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index c7977e6..a218183 100644
--- a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -60,6 +60,10 @@ case "$FIRMWARE" in
  r7800)
ath10kcal_extract "art" 4096 12064
;;
+   tew827dru)
+   hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
+   ath10kcal_extract "ART" 4096 12064
+   ;;
esac
;;
 "ath10k/cal-pci-0001:01:00.0.bin")
@@ -76,6 +80,10 @@ case "$FIRMWARE" in
 r7800)
ath10kcal_extract "art" 20480 12064
;;
+   tew827dru)
+   hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
+   ath10kcal_extract "ART" 20480 12064
+   ;;


Copy/Paste leftover? As far as I can see, there isn't even an devinfo 
partition from which the mac address could be extracted.



esac
;;
 *)
diff --git 
a/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac 
b/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
index 1ae4352..a3326ab 100644
--- a/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
+++ b/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
@@ -18,6 +18,9 @@ case "$board" in
ea8500)
echo $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) 
$(($PHYNBR + 1)) ) >