Re: [OpenWrt-Devel] [PATCH] ramips: add support to JS7628 development board

2019-08-07 Thread Robinson Wu
Hi,
Thank you for your advices.  I will submit patch again. 


Best wishes


Robinson Wu___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 2/3] ath79: fix IMAGE_SIZE for common TP-Link definitions

2019-08-07 Thread mail
> -Original Message-
> From: Tom Psyborg [mailto:pozega.tomis...@gmail.com]
> Sent: Mittwoch, 7. August 2019 23:19
> To: Adrian Schmutzler 
> Cc: openwrt-devel@lists.openwrt.org
> Subject: Re: [OpenWrt-Devel] [PATCH 2/3] ath79: fix IMAGE_SIZE for
> common TP-Link definitions
> 
> Correct me if I'm wrong but I thought all the data beyond IMAGE_SIZE
> remain intact by OpenWrt on firstboot. Experimenting with Archer C7 v1
> recently I was able to flash OpenWrt image (ar71xx) and after reflashing
> tplink fw previous settings were still valid indicating config partition 
> hasn't
> been overwritten.
> At least TL-MR22U has config partition of 64KB and Archer C7 has 128KB
> - I've gone through GPL sources of Archer and it seems between two
> firmware versions this partition was increased from 64 to 128KB, actually I
> discovered this by hexdiff-ing u-boot versions from each firmware version

Nevertheless, addressing this with IMAGE_SIZE would still be just a hack.

If there is config data to be preserved, one should add a partition for it. 
Then IMAGE_SIZE would just shrink according to the (then correct) firmware 
partition. Now that we have DTS files with individual partition schemes, this 
would be even easier than for ar71xx.

Best

Adrian


openpgp-digital-signature.asc
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 2/3] ath79: fix IMAGE_SIZE for common TP-Link definitions

2019-08-07 Thread Tom Psyborg
Correct me if I'm wrong but I thought all the data beyond IMAGE_SIZE
remain intact by OpenWrt on firstboot. Experimenting with Archer C7 v1
recently I was able to flash OpenWrt image (ar71xx) and after
reflashing tplink fw previous settings were still valid indicating
config partition hasn't been overwritten.
At least TL-MR22U has config partition of 64KB and Archer C7 has 128KB
- I've gone through GPL sources of Archer and it seems between two
firmware versions this partition was increased from 64 to 128KB,
actually I discovered this by hexdiff-ing u-boot versions from each
firmware version

On 07/08/2019, Adrian Schmutzler  wrote:
>> -Original Message-
>> From: openwrt-devel [mailto:openwrt-devel-boun...@lists.openwrt.org] On
>> Behalf Of Tom Psyborg
>> Sent: Mittwoch, 7. August 2019 17:58
>> To: Adrian Schmutzler 
>> Cc: openwrt-devel@lists.openwrt.org
>> Subject: Re: [OpenWrt-Devel] [PATCH 2/3] ath79: fix IMAGE_SIZE for common
>> TP-Link definitions
>>
>> Hi
>>
>> Looks like there were many doubts about image size over the years.
>>
>> One thing that should be considered is use of OEM firmware, either in
>> case of just a single revert after OpenWrt flashing, or multiple
>> reverts/switching between OEM/OpenWrt firmwares.
>>
>> Relevant in this case is config partition within OEM fw, and by
>> specifying OpenWrt image size to occupy all available flash space
>> between u-boot and art partitions destroys config contents which may
>> turn up very impractical for those that do frequent switching between
>> the two.
>>
>> Further, config partition size also varies from device to device, some
>> have it 64KB others 128KB in size, at least what I observed with my
>> devices.
>>
>> So, the correct image size for Archer C7 v1 turned out to be 0x7b
>
> But wouldn't this call for introducing a config partition for the C7 v1?
> I'm not sure how your analysis is affecting the IMAGE_SIZE discussion
> (unless you say TP-Link devices generally have this config partition with
> different sizes, and thus the whole concept of including IMAGE_SIZE in
> common definitions is "wrong")...
>
> Best
>
> Adrian
>

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v6] ath79: add support of Netgear WNDR3800CH

2019-08-07 Thread Dmitry Tunin
Add support for the ar71xx supported Netgear WNDR3800CH to ath79.
The device is identical to WNDR3800 except NETGEAR_BOARD_ID.

Signed-off-by: Dmitry Tunin 
---
 .../linux/ath79/base-files/etc/board.d/02_network  |  3 +-
 .../etc/hotplug.d/firmware/10-ath9k-eeprom |  6 ++--
 .../linux/ath79/dts/ar7161_netgear_wndr3800ch.dts  | 36 ++
 target/linux/ath79/image/generic.mk| 11 +++
 4 files changed, 53 insertions(+), 3 deletions(-)
 create mode 100644 target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts

diff --git a/target/linux/ath79/base-files/etc/board.d/02_network 
b/target/linux/ath79/base-files/etc/board.d/02_network
index 9c64299..dc3018d 100755
--- a/target/linux/ath79/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/base-files/etc/board.d/02_network
@@ -177,7 +177,8 @@ ath79_setup_interfaces()
;;
netgear,wndr3700|\
netgear,wndr3700v2|\
-   netgear,wndr3800)
+   netgear,wndr3800|\
+   netgear,wndr3800ch)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
ucidef_add_switch "switch0" \
"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5u@eth0"
diff --git 
a/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom 
b/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
index a7d4825..29da5c9 100644
--- a/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
+++ b/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
@@ -206,7 +206,8 @@ case "$FIRMWARE" in
buffalo,wzr-hp-ag300h|\
netgear,wndr3700|\
netgear,wndr3700v2|\
-   netgear,wndr3800)
+   netgear,wndr3800|\
+   netgear,wndr3800ch)
ath9k_eeprom_extract "art" 4096 3768
;;
dlink,dir-825-b1)
@@ -223,7 +224,8 @@ case "$FIRMWARE" in
buffalo,wzr-hp-ag300h|\
netgear,wndr3700|\
netgear,wndr3700v2|\
-   netgear,wndr3800)
+   netgear,wndr3800|\
+   netgear,wndr3800ch)
ath9k_eeprom_extract "art" 20480 3768
;;
dlink,dir-825-b1)
diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts 
b/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts
new file mode 100644
index 000..84a859b
--- /dev/null
+++ b/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts
@@ -0,0 +1,36 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include "ar7161_netgear_wndr3700.dtsi"
+
+/ {
+   compatible = "netgear,wndr3800ch", "qca,ar7161";
+   model = "Netgear WNDR3800CH";
+};
+
+&partitions {
+   partition@0 {
+   label = "u-boot";
+   reg = <0x00 0x05>;
+   read-only;
+   };
+
+   partition@5 {
+   label = "u-boot-env";
+   reg = <0x05 0x02>;
+   read-only;
+   };
+
+   partition@7 {
+   label = "firmware";
+   reg = <0x07 0xf8>;
+   compatible = "netgear,uimage";
+   };
+
+   art: partition@ff {
+   label = "art";
+   reg = <0xff 0x01>;
+   read-only;
+   };
+};
+
diff --git a/target/linux/ath79/image/generic.mk 
b/target/linux/ath79/image/generic.mk
index 8009582..538be46 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -789,6 +789,17 @@ define Device/netgear_wndr3800
 endef
 TARGET_DEVICES += netgear_wndr3800
 
+define Device/netgear_wndr3800ch
+  $(Device/netgear_wndr3x00)
+  DEVICE_MODEL := WNDR3800CH
+  NETGEAR_KERNEL_MAGIC := 0x33373031
+  NETGEAR_BOARD_ID := WNDR3800CH
+  NETGEAR_HW_ID := 29763654+16+128
+  IMAGE_SIZE := 15872k
+  SUPPORTED_DEVICES += wndr3800ch
+endef
+TARGET_DEVICES += netgear_wndr3800ch
+
 define Device/phicomm_k2t
   ATH_SOC := qca9563
   DEVICE_VENDOR := Phicomm
-- 
2.7.4


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ath79: add support of Netgear WNR3800 (Ch)

2019-08-07 Thread Dmitry Tunin
Oops again. I didn't pull master for a while, because was playing with 19.07.

ср, 7 авг. 2019 г. в 22:58, Dmitry Tunin :
>
> > Are you using recent master?
> >
> > DEVICE_MODEL is the way to go now.
> Yes, I do.

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ath79: add support of Netgear WNR3800 (Ch)

2019-08-07 Thread Dmitry Tunin
> Are you using recent master?
>
> DEVICE_MODEL is the way to go now.
Yes, I do.

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ath79: add support of Netgear WNR3800 (Ch)

2019-08-07 Thread mail
Are you using recent master?

DEVICE_MODEL is the way to go now.

> -Original Message-
> From: Dmitry Tunin [mailto:hanipouspi...@gmail.com]
> Sent: Mittwoch, 7. August 2019 21:27
> To: Adrian Schmutzler 
> Cc: OpenWrt Development List 
> Subject: Re: [OpenWrt-Devel] [PATCH] ath79: add support of Netgear
> WNR3800 (Ch)
> 
> With VENDOR/MODEL it doesn't appear in menuconfig.
> So v1 with WNDR fix should work.
> 
> ср, 7 авг. 2019 г. в 22:11, Dmitry Tunin :
> >
> > > You still have one WNR in the commit description and you can remove
> the DEVICE_VENDOR, as it is still inherited.
> > It looks like all the file should be changed to VENDOR/MODEL, but you
> > are correct.


openpgp-digital-signature.asc
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v5] ath79: add support of Netgear WNDR3800CH

2019-08-07 Thread Dmitry Tunin
Add support for the ar71xx supported Netgear WNDR3800CH to ath79.
The device is identical to WNDR3800 except NETGEAR_BOARD_ID.

Signed-off-by: Dmitry Tunin 
---
 .../linux/ath79/base-files/etc/board.d/02_network  |  3 +-
 .../etc/hotplug.d/firmware/10-ath9k-eeprom |  6 ++--
 .../linux/ath79/dts/ar7161_netgear_wndr3800ch.dts  | 36 ++
 target/linux/ath79/image/generic.mk| 11 +++
 4 files changed, 53 insertions(+), 3 deletions(-)
 create mode 100644 target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts

diff --git a/target/linux/ath79/base-files/etc/board.d/02_network 
b/target/linux/ath79/base-files/etc/board.d/02_network
index 84c83ff..fd66602 100755
--- a/target/linux/ath79/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/base-files/etc/board.d/02_network
@@ -157,7 +157,8 @@ ath79_setup_interfaces()
;;
netgear,wndr3700|\
netgear,wndr3700v2|\
-   netgear,wndr3800)
+   netgear,wndr3800|\
+   netgear,wndr3800ch)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
ucidef_add_switch "switch0" \
"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5u@eth0"
diff --git 
a/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom 
b/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
index e6b6d2f..2e5f455 100644
--- a/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
+++ b/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
@@ -200,7 +200,8 @@ case "$FIRMWARE" in
buffalo,wzr-hp-ag300h|\
netgear,wndr3700|\
netgear,wndr3700v2|\
-   netgear,wndr3800)
+   netgear,wndr3800|\
+   netgear,wndr3800ch)
ath9k_eeprom_extract "art" 4096 3768
;;
dlink,dir-825-b1)
@@ -217,7 +218,8 @@ case "$FIRMWARE" in
buffalo,wzr-hp-ag300h|\
netgear,wndr3700|\
netgear,wndr3700v2|\
-   netgear,wndr3800)
+   netgear,wndr3800|\
+   netgear,wndr3800ch)
ath9k_eeprom_extract "art" 20480 3768
;;
dlink,dir-825-b1)
diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts 
b/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts
new file mode 100644
index 000..84a859b
--- /dev/null
+++ b/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts
@@ -0,0 +1,36 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include "ar7161_netgear_wndr3700.dtsi"
+
+/ {
+   compatible = "netgear,wndr3800ch", "qca,ar7161";
+   model = "Netgear WNDR3800CH";
+};
+
+&partitions {
+   partition@0 {
+   label = "u-boot";
+   reg = <0x00 0x05>;
+   read-only;
+   };
+
+   partition@5 {
+   label = "u-boot-env";
+   reg = <0x05 0x02>;
+   read-only;
+   };
+
+   partition@7 {
+   label = "firmware";
+   reg = <0x07 0xf8>;
+   compatible = "netgear,uimage";
+   };
+
+   art: partition@ff {
+   label = "art";
+   reg = <0xff 0x01>;
+   read-only;
+   };
+};
+
diff --git a/target/linux/ath79/image/generic.mk 
b/target/linux/ath79/image/generic.mk
index d5f67b8..665770d 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -647,6 +647,17 @@ define Device/netgear_wndr3800
 endef
 TARGET_DEVICES += netgear_wndr3800
 
+define Device/netgear_wndr3800ch
+  $(Device/netgear_wndr3x00)
+  DEVICE_TITLE := NETGEAR WNDR3800CH
+  NETGEAR_KERNEL_MAGIC := 0x33373031
+  NETGEAR_BOARD_ID := WNDR3800CH
+  NETGEAR_HW_ID := 29763654+16+128
+  IMAGE_SIZE := 15872k
+  SUPPORTED_DEVICES += wndr3800ch
+endef
+TARGET_DEVICES += netgear_wndr3800ch
+
 define Device/phicomm_k2t
   ATH_SOC := qca9563
   DEVICE_TITLE := Phicomm K2T
-- 
2.7.4


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v4] ath79: add support of Netgear WNDR3800CH

2019-08-07 Thread Dmitry Tunin
Add support for the ar71xx supported Netgear WNDR3800CH to ath79.
The device is identical to WNDR3800 except NETGEAR_BOARD_ID.

Signed-off-by: Dmitry Tunin 
---
 .../linux/ath79/base-files/etc/board.d/02_network  |  3 +-
 .../etc/hotplug.d/firmware/10-ath9k-eeprom |  6 ++--
 .../linux/ath79/dts/ar7161_netgear_wndr3800ch.dts  | 36 ++
 target/linux/ath79/image/generic.mk| 11 +++
 4 files changed, 53 insertions(+), 3 deletions(-)
 create mode 100644 target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts

diff --git a/target/linux/ath79/base-files/etc/board.d/02_network 
b/target/linux/ath79/base-files/etc/board.d/02_network
index 84c83ff..fd66602 100755
--- a/target/linux/ath79/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/base-files/etc/board.d/02_network
@@ -157,7 +157,8 @@ ath79_setup_interfaces()
;;
netgear,wndr3700|\
netgear,wndr3700v2|\
-   netgear,wndr3800)
+   netgear,wndr3800|\
+   netgear,wndr3800ch)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
ucidef_add_switch "switch0" \
"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5u@eth0"
diff --git 
a/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom 
b/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
index e6b6d2f..2e5f455 100644
--- a/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
+++ b/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
@@ -200,7 +200,8 @@ case "$FIRMWARE" in
buffalo,wzr-hp-ag300h|\
netgear,wndr3700|\
netgear,wndr3700v2|\
-   netgear,wndr3800)
+   netgear,wndr3800|\
+   netgear,wndr3800ch)
ath9k_eeprom_extract "art" 4096 3768
;;
dlink,dir-825-b1)
@@ -217,7 +218,8 @@ case "$FIRMWARE" in
buffalo,wzr-hp-ag300h|\
netgear,wndr3700|\
netgear,wndr3700v2|\
-   netgear,wndr3800)
+   netgear,wndr3800|\
+   netgear,wndr3800ch)
ath9k_eeprom_extract "art" 20480 3768
;;
dlink,dir-825-b1)
diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts 
b/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts
new file mode 100644
index 000..84a859b
--- /dev/null
+++ b/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts
@@ -0,0 +1,36 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include "ar7161_netgear_wndr3700.dtsi"
+
+/ {
+   compatible = "netgear,wndr3800ch", "qca,ar7161";
+   model = "Netgear WNDR3800CH";
+};
+
+&partitions {
+   partition@0 {
+   label = "u-boot";
+   reg = <0x00 0x05>;
+   read-only;
+   };
+
+   partition@5 {
+   label = "u-boot-env";
+   reg = <0x05 0x02>;
+   read-only;
+   };
+
+   partition@7 {
+   label = "firmware";
+   reg = <0x07 0xf8>;
+   compatible = "netgear,uimage";
+   };
+
+   art: partition@ff {
+   label = "art";
+   reg = <0xff 0x01>;
+   read-only;
+   };
+};
+
diff --git a/target/linux/ath79/image/generic.mk 
b/target/linux/ath79/image/generic.mk
index d5f67b8..608cb2e 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -647,6 +647,17 @@ define Device/netgear_wndr3800
 endef
 TARGET_DEVICES += netgear_wndr3800
 
+define Device/netgear_wndr3800ch
+  $(Device/netgear_wndr3x00)
+  DEVICE_MODEL := WNDR3800CH
+  NETGEAR_KERNEL_MAGIC := 0x33373031
+  NETGEAR_BOARD_ID := WNDR3800CH
+  NETGEAR_HW_ID := 29763654+16+128
+  IMAGE_SIZE := 15872k
+  SUPPORTED_DEVICES += wndr3800ch
+endef
+TARGET_DEVICES += netgear_wndr3800ch
+
 define Device/phicomm_k2t
   ATH_SOC := qca9563
   DEVICE_TITLE := Phicomm K2T
-- 
2.7.4


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ath79: add support of Netgear WNR3800 (Ch)

2019-08-07 Thread Dmitry Tunin
With VENDOR/MODEL it doesn't appear in menuconfig.
So v1 with WNDR fix should work.

ср, 7 авг. 2019 г. в 22:11, Dmitry Tunin :
>
> > You still have one WNR in the commit description and you can remove the 
> > DEVICE_VENDOR, as it is still inherited.
> It looks like all the file should be changed to VENDOR/MODEL, but you
> are correct.

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v3] ath79: add support of Netgear WNDR3800CH

2019-08-07 Thread Dmitry Tunin
Add support for the ar71xx supported Netgear WNDR3800CH to ath79.
The device is identical to WNDR3800 except NETGEAR_BOARD_ID.

Signed-off-by: Dmitry Tunin 
---
 .../linux/ath79/base-files/etc/board.d/02_network  |  3 +-
 .../etc/hotplug.d/firmware/10-ath9k-eeprom |  6 ++--
 .../linux/ath79/dts/ar7161_netgear_wndr3800ch.dts  | 36 ++
 target/linux/ath79/image/generic.mk| 11 +++
 4 files changed, 53 insertions(+), 3 deletions(-)
 create mode 100644 target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts

diff --git a/target/linux/ath79/base-files/etc/board.d/02_network 
b/target/linux/ath79/base-files/etc/board.d/02_network
index 84c83ff..fd66602 100755
--- a/target/linux/ath79/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/base-files/etc/board.d/02_network
@@ -157,7 +157,8 @@ ath79_setup_interfaces()
;;
netgear,wndr3700|\
netgear,wndr3700v2|\
-   netgear,wndr3800)
+   netgear,wndr3800|\
+   netgear,wndr3800ch)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
ucidef_add_switch "switch0" \
"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5u@eth0"
diff --git 
a/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom 
b/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
index e6b6d2f..2e5f455 100644
--- a/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
+++ b/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
@@ -200,7 +200,8 @@ case "$FIRMWARE" in
buffalo,wzr-hp-ag300h|\
netgear,wndr3700|\
netgear,wndr3700v2|\
-   netgear,wndr3800)
+   netgear,wndr3800|\
+   netgear,wndr3800ch)
ath9k_eeprom_extract "art" 4096 3768
;;
dlink,dir-825-b1)
@@ -217,7 +218,8 @@ case "$FIRMWARE" in
buffalo,wzr-hp-ag300h|\
netgear,wndr3700|\
netgear,wndr3700v2|\
-   netgear,wndr3800)
+   netgear,wndr3800|\
+   netgear,wndr3800ch)
ath9k_eeprom_extract "art" 20480 3768
;;
dlink,dir-825-b1)
diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts 
b/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts
new file mode 100644
index 000..84a859b
--- /dev/null
+++ b/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts
@@ -0,0 +1,36 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include "ar7161_netgear_wndr3700.dtsi"
+
+/ {
+   compatible = "netgear,wndr3800ch", "qca,ar7161";
+   model = "Netgear WNDR3800CH";
+};
+
+&partitions {
+   partition@0 {
+   label = "u-boot";
+   reg = <0x00 0x05>;
+   read-only;
+   };
+
+   partition@5 {
+   label = "u-boot-env";
+   reg = <0x05 0x02>;
+   read-only;
+   };
+
+   partition@7 {
+   label = "firmware";
+   reg = <0x07 0xf8>;
+   compatible = "netgear,uimage";
+   };
+
+   art: partition@ff {
+   label = "art";
+   reg = <0xff 0x01>;
+   read-only;
+   };
+};
+
diff --git a/target/linux/ath79/image/generic.mk 
b/target/linux/ath79/image/generic.mk
index d5f67b8..608cb2e 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -647,6 +647,17 @@ define Device/netgear_wndr3800
 endef
 TARGET_DEVICES += netgear_wndr3800
 
+define Device/netgear_wndr3800ch
+  $(Device/netgear_wndr3x00)
+  DEVICE_MODEL := WNDR3800CH
+  NETGEAR_KERNEL_MAGIC := 0x33373031
+  NETGEAR_BOARD_ID := WNDR3800CH
+  NETGEAR_HW_ID := 29763654+16+128
+  IMAGE_SIZE := 15872k
+  SUPPORTED_DEVICES += wndr3800ch
+endef
+TARGET_DEVICES += netgear_wndr3800ch
+
 define Device/phicomm_k2t
   ATH_SOC := qca9563
   DEVICE_TITLE := Phicomm K2T
-- 
2.7.4


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ath79: add support of Netgear WNR3800 (Ch)

2019-08-07 Thread Dmitry Tunin
> You still have one WNR in the commit description and you can remove the 
> DEVICE_VENDOR, as it is still inherited.
It looks like all the file should be changed to VENDOR/MODEL, but you
are correct.

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ath79: add support of Netgear WNR3800 (Ch)

2019-08-07 Thread Adrian Schmutzler
> CH is used in BOARD_ID.

Ah, I see. I'm fine with the solution in v2.

You still have one WNR in the commit description and you can remove the 
DEVICE_VENDOR, as it is still inherited.

Best

Adrian


openpgp-digital-signature.asc
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ath79: add support of Netgear WNR3800 (Ch)

2019-08-07 Thread Dmitry Tunin
> If the CH stands for China, as I've also read when googleing, I would prefer 
> having CN here. This will then very much depend upon whether the CH is used 
> officially somewhere or whether it's just an invention of previous OpenWrt 
> versions ... (Where in the latter case I'd actually change to CN as we did 
> for other devices ...).

CH is used in BOARD_ID.

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ath79: add support of Netgear WNR3800 (Ch)

2019-08-07 Thread Dmitry Tunin
Sent v2.

ср, 7 авг. 2019 г. в 21:48, Adrian Schmutzler :
>
> > > Note that you also have to update to DEVICE_VENDOR/DEVICE_MODEL syntax ...
> > I don't quite get it. Where is this syntax?
>
> Here:
>
> > +define Device/netgear_wndr3800ch
> > +  $(Device/netgear_wndr3800)
> > +  DEVICE_TITLE := NETGEAR WNDR3800 (Ch)
> > +  NETGEAR_BOARD_ID := WNDR3800CH
> > +  SUPPORTED_DEVICES += wndr3800ch
> > +endef
> > +TARGET_DEVICES += netgear_wndr3800ch
>
> Instead of DEVICE_TITLE, use DEVICE_VENDOR/DEVICE_MODEL.
> In this particular case, DEVICE_VENDOR is already inherited from a parent 
> definition, so you only need DEVICE_MODEL.
>
> However, having looked at this another time:
>
> Please do not inherit one device from another. Use common definitions to 
> inherit from.
> In this particular case, it will be easiest to just copy the definitions from 
> wndr3800 (and thus inherit from wndr3x00). I don't think it's worth creating 
> another shared definition because of the remaining 3 duplicate lines.
>
> Best
>
> Adrian

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2] ath79: add support of Netgear WNDR3800CH

2019-08-07 Thread Dmitry Tunin
Add support for the ar71xx supported Netgear WNR3800CH to ath79.
The device is identical to WNDR3800 except NETGEAR_BOARD_ID.

Signed-off-by: Dmitry Tunin 
---
 .../linux/ath79/base-files/etc/board.d/02_network  |  3 +-
 .../etc/hotplug.d/firmware/10-ath9k-eeprom |  6 ++--
 .../linux/ath79/dts/ar7161_netgear_wndr3800ch.dts  | 36 ++
 target/linux/ath79/image/generic.mk| 12 
 4 files changed, 54 insertions(+), 3 deletions(-)
 create mode 100644 target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts

diff --git a/target/linux/ath79/base-files/etc/board.d/02_network 
b/target/linux/ath79/base-files/etc/board.d/02_network
index 84c83ff..fd66602 100755
--- a/target/linux/ath79/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/base-files/etc/board.d/02_network
@@ -157,7 +157,8 @@ ath79_setup_interfaces()
;;
netgear,wndr3700|\
netgear,wndr3700v2|\
-   netgear,wndr3800)
+   netgear,wndr3800|\
+   netgear,wndr3800ch)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
ucidef_add_switch "switch0" \
"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5u@eth0"
diff --git 
a/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom 
b/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
index e6b6d2f..2e5f455 100644
--- a/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
+++ b/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
@@ -200,7 +200,8 @@ case "$FIRMWARE" in
buffalo,wzr-hp-ag300h|\
netgear,wndr3700|\
netgear,wndr3700v2|\
-   netgear,wndr3800)
+   netgear,wndr3800|\
+   netgear,wndr3800ch)
ath9k_eeprom_extract "art" 4096 3768
;;
dlink,dir-825-b1)
@@ -217,7 +218,8 @@ case "$FIRMWARE" in
buffalo,wzr-hp-ag300h|\
netgear,wndr3700|\
netgear,wndr3700v2|\
-   netgear,wndr3800)
+   netgear,wndr3800|\
+   netgear,wndr3800ch)
ath9k_eeprom_extract "art" 20480 3768
;;
dlink,dir-825-b1)
diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts 
b/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts
new file mode 100644
index 000..84a859b
--- /dev/null
+++ b/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts
@@ -0,0 +1,36 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include "ar7161_netgear_wndr3700.dtsi"
+
+/ {
+   compatible = "netgear,wndr3800ch", "qca,ar7161";
+   model = "Netgear WNDR3800CH";
+};
+
+&partitions {
+   partition@0 {
+   label = "u-boot";
+   reg = <0x00 0x05>;
+   read-only;
+   };
+
+   partition@5 {
+   label = "u-boot-env";
+   reg = <0x05 0x02>;
+   read-only;
+   };
+
+   partition@7 {
+   label = "firmware";
+   reg = <0x07 0xf8>;
+   compatible = "netgear,uimage";
+   };
+
+   art: partition@ff {
+   label = "art";
+   reg = <0xff 0x01>;
+   read-only;
+   };
+};
+
diff --git a/target/linux/ath79/image/generic.mk 
b/target/linux/ath79/image/generic.mk
index d5f67b8..b45efb1 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -647,6 +647,18 @@ define Device/netgear_wndr3800
 endef
 TARGET_DEVICES += netgear_wndr3800
 
+define Device/netgear_wndr3800ch
+  $(Device/netgear_wndr3x00)
+  DEVICE_VENDOR := NETGEAR
+  DEVICE_MODEL := WNDR3800CH
+  NETGEAR_KERNEL_MAGIC := 0x33373031
+  NETGEAR_BOARD_ID := WNDR3800CH
+  NETGEAR_HW_ID := 29763654+16+128
+  IMAGE_SIZE := 15872k
+  SUPPORTED_DEVICES += wndr3800ch
+endef
+TARGET_DEVICES += netgear_wndr3800ch
+
 define Device/phicomm_k2t
   ATH_SOC := qca9563
   DEVICE_TITLE := Phicomm K2T
-- 
2.7.4


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ath79: add support of Netgear WNR3800 (Ch)

2019-08-07 Thread Adrian Schmutzler
> Maybe DEVICE_VARIANT := CH is a better choice, since it is the same device.

Well, is it a variant? If yes, CH implies Switzerland to me, which most 
probably is wrong.
Despite, if you decide to use CH as variant, you would have to introduce 
hyphens to device definition name and compatible, i.e. "netgear,wndr3800-ch".

If the CH stands for China, as I've also read when googleing, I would prefer 
having CN here. This will then very much depend upon whether the CH is used 
officially somewhere or whether it's just an invention of previous OpenWrt 
versions ... (Where in the latter case I'd actually change to CN as we did for 
other devices ...).

Best

Adrian


openpgp-digital-signature.asc
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ath79: add support of Netgear WNR3800 (Ch)

2019-08-07 Thread Adrian Schmutzler
> > Note that you also have to update to DEVICE_VENDOR/DEVICE_MODEL syntax ...
> I don't quite get it. Where is this syntax?

Here:

> +define Device/netgear_wndr3800ch
> +  $(Device/netgear_wndr3800)
> +  DEVICE_TITLE := NETGEAR WNDR3800 (Ch)
> +  NETGEAR_BOARD_ID := WNDR3800CH
> +  SUPPORTED_DEVICES += wndr3800ch
> +endef
> +TARGET_DEVICES += netgear_wndr3800ch

Instead of DEVICE_TITLE, use DEVICE_VENDOR/DEVICE_MODEL.
In this particular case, DEVICE_VENDOR is already inherited from a parent 
definition, so you only need DEVICE_MODEL.

However, having looked at this another time:

Please do not inherit one device from another. Use common definitions to 
inherit from.
In this particular case, it will be easiest to just copy the definitions from 
wndr3800 (and thus inherit from wndr3x00). I don't think it's worth creating 
another shared definition because of the remaining 3 duplicate lines.

Best

Adrian


openpgp-digital-signature.asc
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ath79: add support of Netgear WNR3800 (Ch)

2019-08-07 Thread Dmitry Tunin
Maybe DEVICE_VARIANT := CH is a better choice, since it is the same device.

ср, 7 авг. 2019 г. в 21:40, Dmitry Tunin :
>
> > in commit title/description, you are using "WNR" instead of "WNDR" ...
> Oops.
>
> > Despite, from a quick research, it looks like the device is called 
> > "WNDR3800CH" most frequently.
> > I would update the name accordingly.
> I copied the ar71xx name, but I agree.
>
> > Note that you also have to update to DEVICE_VENDOR/DEVICE_MODEL syntax ...
> I don't quite get it. Where is this syntax?

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ath79: add support of Netgear WNR3800 (Ch)

2019-08-07 Thread Dmitry Tunin
> in commit title/description, you are using "WNR" instead of "WNDR" ...
Oops.

> Despite, from a quick research, it looks like the device is called 
> "WNDR3800CH" most frequently.
> I would update the name accordingly.
I copied the ar71xx name, but I agree.

> Note that you also have to update to DEVICE_VENDOR/DEVICE_MODEL syntax ...
I don't quite get it. Where is this syntax?

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ath79: add support of Netgear WNR3800 (Ch)

2019-08-07 Thread Adrian Schmutzler
Hi,

> -Original Message-
> From: openwrt-devel [mailto:openwrt-devel-boun...@lists.openwrt.org] On 
> Behalf Of Dmitry Tunin
> Sent: Mittwoch, 7. August 2019 19:55
> To: openwrt-devel@lists.openwrt.org
> Cc: Dmitry Tunin 
> Subject: [OpenWrt-Devel] [PATCH] ath79: add support of Netgear WNR3800 (Ch)
> 
> Add support for the ar71xx supported Netgear WNR3800 (Ch) to ath79.
> The device is identical to WNR3800 except NETGEAR_BOARD_ID.

in commit title/description, you are using "WNR" instead of "WNDR" ...

Despite, from a quick research, it looks like the device is called "WNDR3800CH" 
most frequently.
I would update the name accordingly.

Note that you also have to update to DEVICE_VENDOR/DEVICE_MODEL syntax ...

Best

Adrian


openpgp-digital-signature.asc
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ath79: add support of Netgear WNR3800 (Ch)

2019-08-07 Thread Dmitry Tunin
Add support for the ar71xx supported Netgear WNR3800 (Ch) to ath79.
The device is identical to WNR3800 except NETGEAR_BOARD_ID.

Signed-off-by: Dmitry Tunin 
---
 .../linux/ath79/base-files/etc/board.d/02_network  |  3 +-
 .../etc/hotplug.d/firmware/10-ath9k-eeprom |  6 ++--
 .../linux/ath79/dts/ar7161_netgear_wndr3800ch.dts  | 36 ++
 target/linux/ath79/image/generic.mk|  8 +
 4 files changed, 50 insertions(+), 3 deletions(-)
 create mode 100644 target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts

diff --git a/target/linux/ath79/base-files/etc/board.d/02_network 
b/target/linux/ath79/base-files/etc/board.d/02_network
index 84c83ff..fd66602 100755
--- a/target/linux/ath79/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/base-files/etc/board.d/02_network
@@ -157,7 +157,8 @@ ath79_setup_interfaces()
;;
netgear,wndr3700|\
netgear,wndr3700v2|\
-   netgear,wndr3800)
+   netgear,wndr3800|\
+   netgear,wndr3800ch)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
ucidef_add_switch "switch0" \
"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5u@eth0"
diff --git 
a/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom 
b/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
index e6b6d2f..2e5f455 100644
--- a/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
+++ b/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
@@ -200,7 +200,8 @@ case "$FIRMWARE" in
buffalo,wzr-hp-ag300h|\
netgear,wndr3700|\
netgear,wndr3700v2|\
-   netgear,wndr3800)
+   netgear,wndr3800|\
+   netgear,wndr3800ch)
ath9k_eeprom_extract "art" 4096 3768
;;
dlink,dir-825-b1)
@@ -217,7 +218,8 @@ case "$FIRMWARE" in
buffalo,wzr-hp-ag300h|\
netgear,wndr3700|\
netgear,wndr3700v2|\
-   netgear,wndr3800)
+   netgear,wndr3800|\
+   netgear,wndr3800ch)
ath9k_eeprom_extract "art" 20480 3768
;;
dlink,dir-825-b1)
diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts 
b/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts
new file mode 100644
index 000..693b897
--- /dev/null
+++ b/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts
@@ -0,0 +1,36 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include "ar7161_netgear_wndr3700.dtsi"
+
+/ {
+   compatible = "netgear,wndr3800ch", "qca,ar7161";
+   model = "Netgear WNDR3800 (Ch)";
+};
+
+&partitions {
+   partition@0 {
+   label = "u-boot";
+   reg = <0x00 0x05>;
+   read-only;
+   };
+
+   partition@5 {
+   label = "u-boot-env";
+   reg = <0x05 0x02>;
+   read-only;
+   };
+
+   partition@7 {
+   label = "firmware";
+   reg = <0x07 0xf8>;
+   compatible = "netgear,uimage";
+   };
+
+   art: partition@ff {
+   label = "art";
+   reg = <0xff 0x01>;
+   read-only;
+   };
+};
+
diff --git a/target/linux/ath79/image/generic.mk 
b/target/linux/ath79/image/generic.mk
index d5f67b8..e163151 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -647,6 +647,14 @@ define Device/netgear_wndr3800
 endef
 TARGET_DEVICES += netgear_wndr3800
 
+define Device/netgear_wndr3800ch
+  $(Device/netgear_wndr3800)
+  DEVICE_TITLE := NETGEAR WNDR3800 (Ch)
+  NETGEAR_BOARD_ID := WNDR3800CH
+  SUPPORTED_DEVICES += wndr3800ch
+endef
+TARGET_DEVICES += netgear_wndr3800ch
+
 define Device/phicomm_k2t
   ATH_SOC := qca9563
   DEVICE_TITLE := Phicomm K2T
-- 
2.7.4


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 2/3] ath79: fix IMAGE_SIZE for common TP-Link definitions

2019-08-07 Thread Adrian Schmutzler
> -Original Message-
> From: openwrt-devel [mailto:openwrt-devel-boun...@lists.openwrt.org] On 
> Behalf Of Tom Psyborg
> Sent: Mittwoch, 7. August 2019 17:58
> To: Adrian Schmutzler 
> Cc: openwrt-devel@lists.openwrt.org
> Subject: Re: [OpenWrt-Devel] [PATCH 2/3] ath79: fix IMAGE_SIZE for common 
> TP-Link definitions
> 
> Hi
> 
> Looks like there were many doubts about image size over the years.
> 
> One thing that should be considered is use of OEM firmware, either in
> case of just a single revert after OpenWrt flashing, or multiple
> reverts/switching between OEM/OpenWrt firmwares.
> 
> Relevant in this case is config partition within OEM fw, and by
> specifying OpenWrt image size to occupy all available flash space
> between u-boot and art partitions destroys config contents which may
> turn up very impractical for those that do frequent switching between
> the two.
> 
> Further, config partition size also varies from device to device, some
> have it 64KB others 128KB in size, at least what I observed with my
> devices.
> 
> So, the correct image size for Archer C7 v1 turned out to be 0x7b

But wouldn't this call for introducing a config partition for the C7 v1?
I'm not sure how your analysis is affecting the IMAGE_SIZE discussion (unless 
you say TP-Link devices generally have this config partition with different 
sizes, and thus the whole concept of including IMAGE_SIZE in common definitions 
is "wrong")...

Best

Adrian


openpgp-digital-signature.asc
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 2/3] ath79: fix IMAGE_SIZE for common TP-Link definitions

2019-08-07 Thread Tom Psyborg
Hi

Looks like there were many doubts about image size over the years.

One thing that should be considered is use of OEM firmware, either in
case of just a single revert after OpenWrt flashing, or multiple
reverts/switching between OEM/OpenWrt firmwares.

Relevant in this case is config partition within OEM fw, and by
specifying OpenWrt image size to occupy all available flash space
between u-boot and art partitions destroys config contents which may
turn up very impractical for those that do frequent switching between
the two.

Further, config partition size also varies from device to device, some
have it 64KB others 128KB in size, at least what I observed with my
devices.

So, the correct image size for Archer C7 v1 turned out to be 0x7b

On 06/08/2019, Adrian Schmutzler  wrote:
> So far, IMAGE_SIZE is set as follows:
> tplink-4m*   3904k  0x3d
> tplink-8m*   7936k  0x7c
> tplink-16m* 15872k  0xf8
>
> However, based on the size of firmware partitions in DTS it should
> be:
> tplink-4m*   3904k  0x3d
> tplink-8m*   8000k  0x7d
> tplink-16m* 16192k  0xfd
>
> All (!) 8m*/16m* devices actually follow the latter scheme, which
> is also consistent in terms of left free space for other
> partitions. Thus, fix it.
>
> Signed-off-by: Adrian Schmutzler 
> ---
>  target/linux/ath79/image/common-tp-link.mk | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/target/linux/ath79/image/common-tp-link.mk
> b/target/linux/ath79/image/common-tp-link.mk
> index da4616482a..d05ac028c7 100644
> --- a/target/linux/ath79/image/common-tp-link.mk
> +++ b/target/linux/ath79/image/common-tp-link.mk
> @@ -83,19 +83,19 @@ endef
>  define Device/tplink-8m
>$(Device/tplink-nolzma)
>TPLINK_FLASHLAYOUT := 8M
> -  IMAGE_SIZE := 7936k
> +  IMAGE_SIZE := 8000k
>  endef
>
>  define Device/tplink-8mlzma
>$(Device/tplink)
>TPLINK_FLASHLAYOUT := 8Mlzma
> -  IMAGE_SIZE := 7936k
> +  IMAGE_SIZE := 8000k
>  endef
>
>  define Device/tplink-16mlzma
>$(Device/tplink)
>TPLINK_FLASHLAYOUT := 16Mlzma
> -  IMAGE_SIZE := 15872k
> +  IMAGE_SIZE := 16192k
>  endef
>
>  define Device/tplink-safeloader
> --
> 2.20.1
>
>
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
>

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ath79: use gpio_hog instead of gpio-export

2019-08-07 Thread Adrian Schmutzler
Hi,

> +    lna0 {

is there a scheme for proper names already?

While I do not have an opinion for lnaX, I'd prefer "usb_power"/"usb0_power" 
over just "usb"/"usb0".

> +        gpio-hog;
> +        line-name = "tp-link:ext:lna0";
> +        gpios = <18 GPIO_ACTIVE_HIGH>;

At least for lnaX, so far "0" (e.g. "gpios = <18 0>;") has been used instead of 
GPIO_ACTIVE_HIGH. Is there a preference for one of the options?

> +        output-high;
> +    };

Best

Adrian



openpgp-digital-signature.asc
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] [RFC] kernel: disable EAP local hack when using group_fwd_mask

2019-08-07 Thread Etienne Champetier
Hi Petr,

Le jeu. 1 août 2019 à 12:51, Etienne Champetier
 a écrit :
>
> Hi Petr,
>
> Le jeu. 1 août 2019 à 11:39, Petr Štetiar  a écrit :
> >
> > Etienne Champetier  [2019-08-01 07:23:18]:
> >
> > > If the fix was to workaround a client bug we might want to keep it,
> >
> > Actually we don't know if it wasnt fixed already upstream as Rafał suggested
> > in his old removal patch.
> >
> > > else maybe we could rework it and add a warn_once if this hack prevent
> > > a EAP frame from being forwarded
> >
> > This warn_once would have probably saved some time already.
> >
> > > 'disable-eap-local-hack' to enable/disable this hack, what do you
> > > prefer ?
> >
> > I would prefer to remove this patch for 4.19 kernel to find out if it's 
> > still
> > needed.
>
> you mean all versions in master (4.19/4.14/4.9) or really only 4.19 ?
>
> > And if it's needed, then it would make sense to discuss this use case
> > with upstream and make it official feature.
>
> I have a small tool/OpenWrt package
> (https://github.com/openwrt/packages/blob/master/net/phantap/Makefile)
> that I'm presenting at DEF CON in a week, and would really love to
> have a way to disable this hack,
> so I don't have to tell people that want to test it that they have to
> rebuild OpenWrt.
> So I'm willing to work on any small patch that workaround my issue and
> seems reasonable to everyone in a short time-frame ;)
>
> >
> > Let's wait for Felix's input as well.

Last email from Felix that I see is from june 12, so I sent an RFCv2
(kernel: add disable_eap_hack sysfs attribute) for consideration

>
> I'll also try to dig some more in the old repo & bug tracker to see if
> there is more info than in the patch & email
>
> Etienne
>
> >
> > -- ynezz

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH v2 5/5] ath79: add support for Netgear WNR2200

2019-08-07 Thread Adrian Schmutzler
> Hi, 
> I decided to put it here as USB is controlled by pin 4 of wireless chip 
> not CPU. If there is another better formal way to define it, please let 
> me know. I've analyzed gpio_hog patch for other dts files but all these 
> routers steer USB via GPIO pins connected to main SoC. 
> Cheers 
> Michal 

I see. I cannot advise on that, maybe someelse can give a hint on what's the 
"best" way to implement this case.

Best

Adrian


openpgp-digital-signature.asc
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] RE:RE:RE: RE:RE: [PATCH] ramips: add support to JS7628 development board

2019-08-07 Thread Adrian Schmutzler
Hi,

> I would like to know how the patch I submitted is going? Should I submit it 
> again?

I’m only a developer, too, so I cannot speak with authority and also cannot 
push this forward myself.

If you ask for my _opinion_, I’d send a v2 with the RAM-removal renames (as 
this introduces several changes), and then you will have to wait.
Typically device support patches take quite some time …

> Or will you help me to fix it?

Do you look for any specific help here or this meant as a general statement?

Best

Adrian


openpgp-digital-signature.asc
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] RE??RE??RE: RE??RE: [PATCH] ramips: add support to JS7628 development board

2019-08-07 Thread Robinson Wu
Hi Adrian,
I would like to know how the patch I submitted is going? Should I submit it 
again? Or will you help me to fix it? Please tell me what should I do.


Best wishes
Robinson Wu___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] procd: fix shutdown when running in a container

2019-08-07 Thread Hans Dedecker
On Mon, Aug 5, 2019 at 6:09 PM Paul Spooren  wrote:
>
> Applies patch from @mikma [0] to fix Docker shutdown. Added detection to
> state.c if running in a containre or not.
>
> Tested with a x86/64 Docker image.
>
> Fixes FS#2425
>
> CC: Mikael Magnusson 
> CC: Petr Štetiar 
>
> [0]: 
> https://github.com/mikma/lxd-openwrt/blob/master/patches/procd-master/0003-docker-fix-problem-stopping-container.patch
>
> Signed-off-by: Paul Spooren 
Patch applied with some style changes

Hans
> ---
>  state.c | 25 +++--
>  1 file changed, 15 insertions(+), 10 deletions(-)
>
> diff --git a/state.c b/state.c
> index ccf4104..b7cba88 100644
> --- a/state.c
> +++ b/state.c
> @@ -20,6 +20,7 @@
>  #include 
>  #include 
>
> +#include "container.h"
>  #include "procd.h"
>  #include "syslog.h"
>  #include "plug/hotplug.h"
> @@ -157,18 +158,22 @@ static void state_enter(void)
> else
> LOG("- reboot -\n");
>
> -   /* Allow time for last message to reach serial console, etc */
> -   sleep(1);
> +   if(!is_container()) {
> +   /* Allow time for last message to reach serial 
> console, etc */
> +   sleep(1);
>
> -   /* We have to fork here, since the kernel calls 
> do_exit(EXIT_SUCCESS)
> -* in linux/kernel/sys.c, which can cause the machine to 
> panic when
> -* the init process exits... */
> -   if (!vfork( )) { /* child */
> -   reboot(reboot_event);
> -   _exit(EXIT_SUCCESS);
> +   /* We have to fork here, since the kernel calls 
> do_exit(EXIT_SUCCESS)
> +* in linux/kernel/sys.c, which can cause the machine 
> to panic when
> +* the init process exits... */
> +   if (!vfork( )) { /* child */
> +   reboot(reboot_event);
> +   _exit(EXIT_SUCCESS);
> +   }
> +   while (1)
> +   sleep(1);
> +   } else {
> +   exit(0);
> }
> -   while (1)
> -   sleep(1);
>  #else
> exit(0);
>  #endif
> --
> 2.20.1
>
>
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] [RFCv2] kernel: add disable_eap_hack sysfs attribute

2019-08-07 Thread Etienne Champetier
We are not sure if 640-bridge-only-accept-EAP-locally.patch is still needed
as a first step, add disable_eap_hack sysfs config to allow to disable it

Signed-off-by: Etienne Champetier 
---
 .../640-bridge-only-accept-EAP-locally.patch  | 59 +--
 .../640-bridge-only-accept-EAP-locally.patch  | 59 +--
 .../640-bridge-only-accept-EAP-locally.patch  | 59 +--
 3 files changed, 165 insertions(+), 12 deletions(-)

diff --git 
a/target/linux/generic/hack-4.14/640-bridge-only-accept-EAP-locally.patch 
b/target/linux/generic/hack-4.14/640-bridge-only-accept-EAP-locally.patch
index 0dbb8ee3c0..7b026642a6 100644
--- a/target/linux/generic/hack-4.14/640-bridge-only-accept-EAP-locally.patch
+++ b/target/linux/generic/hack-4.14/640-bridge-only-accept-EAP-locally.patch
@@ -1,4 +1,3 @@
-From c6905cfdeb31a5c049db3da434b10fa0d3e83569 Mon Sep 17 00:00:00 2001
 From: Felix Fietkau 
 Date: Fri, 7 Jul 2017 17:18:54 +0200
 Subject: bridge: only accept EAP locally
@@ -7,9 +6,9 @@ When bridging, do not forward EAP frames to other ports, only 
deliver
 them locally, regardless of the state.
 
 Signed-off-by: Felix Fietkau 
+[add disable_eap_hack sysfs attribute]
+Signed-off-by: Etienne Champetier 
 ---
- net/bridge/br_input.c | 7 +--
- 1 file changed, 5 insertions(+), 2 deletions(-)
 
 --- a/net/bridge/br_input.c
 +++ b/net/bridge/br_input.c
@@ -19,7 +18,7 @@ Signed-off-by: Felix Fietkau 
  
 +  BR_INPUT_SKB_CB(skb)->brdev = br->dev;
 +
-+  if (skb->protocol == htons(ETH_P_PAE))
++  if (skb->protocol == htons(ETH_P_PAE) && !br->disable_eap_hack)
 +  return br_pass_frame_up(skb);
 +
if (p->state == BR_STATE_LEARNING)
@@ -29,3 +28,55 @@ Signed-off-by: Felix Fietkau 
BR_INPUT_SKB_CB(skb)->src_port_isolated = !!(p->flags & BR_ISOLATED);
  
if (IS_ENABLED(CONFIG_INET) && skb->protocol == htons(ETH_P_ARP))
+--- a/net/bridge/br_private.h
 b/net/bridge/br_private.h
+@@ -320,6 +320,8 @@ struct net_bridge {
+   u16 group_fwd_mask;
+   u16 group_fwd_mask_required;
+ 
++  booldisable_eap_hack;
++
+   /* STP */
+   bridge_id   designated_root;
+   bridge_id   bridge_id;
+--- a/net/bridge/br_sysfs_br.c
 b/net/bridge/br_sysfs_br.c
+@@ -170,6 +170,30 @@ static ssize_t group_fwd_mask_store(stru
+ }
+ static DEVICE_ATTR_RW(group_fwd_mask);
+ 
++static ssize_t disable_eap_hack_show(struct device *d,
++ struct device_attribute *attr,
++ char *buf)
++{
++  struct net_bridge *br = to_bridge(d);
++  return sprintf(buf, "%u\n", br->disable_eap_hack);
++}
++
++static int set_disable_eap_hack(struct net_bridge *br, unsigned long val)
++{
++  br->disable_eap_hack = val ? true : false;
++
++  return 0;
++}
++
++static ssize_t disable_eap_hack_store(struct device *d,
++  struct device_attribute *attr,
++  const char *buf,
++  size_t len)
++{
++  return store_bridge_parm(d, buf, len, set_disable_eap_hack);
++}
++static DEVICE_ATTR_RW(disable_eap_hack);
++
+ static ssize_t priority_show(struct device *d, struct device_attribute *attr,
+char *buf)
+ {
+@@ -817,6 +841,7 @@ static struct attribute *bridge_attrs[]
+   &dev_attr_ageing_time.attr,
+   &dev_attr_stp_state.attr,
+   &dev_attr_group_fwd_mask.attr,
++  &dev_attr_disable_eap_hack.attr,
+   &dev_attr_priority.attr,
+   &dev_attr_bridge_id.attr,
+   &dev_attr_root_id.attr,
diff --git 
a/target/linux/generic/hack-4.19/640-bridge-only-accept-EAP-locally.patch 
b/target/linux/generic/hack-4.19/640-bridge-only-accept-EAP-locally.patch
index 3de4048074..dfe64cb5af 100644
--- a/target/linux/generic/hack-4.19/640-bridge-only-accept-EAP-locally.patch
+++ b/target/linux/generic/hack-4.19/640-bridge-only-accept-EAP-locally.patch
@@ -1,4 +1,3 @@
-From c6905cfdeb31a5c049db3da434b10fa0d3e83569 Mon Sep 17 00:00:00 2001
 From: Felix Fietkau 
 Date: Fri, 7 Jul 2017 17:18:54 +0200
 Subject: bridge: only accept EAP locally
@@ -7,9 +6,9 @@ When bridging, do not forward EAP frames to other ports, only 
deliver
 them locally, regardless of the state.
 
 Signed-off-by: Felix Fietkau 
+[add disable_eap_hack sysfs attribute]
+Signed-off-by: Etienne Champetier 
 ---
- net/bridge/br_input.c | 7 +--
- 1 file changed, 5 insertions(+), 2 deletions(-)
 
 --- a/net/bridge/br_input.c
 +++ b/net/bridge/br_input.c
@@ -19,7 +18,7 @@ Signed-off-by: Felix Fietkau 
  
 +  BR_INPUT_SKB_CB(skb)->brdev = br->dev;
 +
-+  if (skb->protocol == htons(ETH_P_PAE))
++  if (skb->protocol == htons(ETH_P_PAE) && !br->disable_eap_hack)
 +  return br_pass_frame_up(skb);
 +
if (p->state == BR_STATE_LEARNING)
@@ -29,3 +28,55 @@ Signed-off-by: F

Re: [OpenWrt-Devel] [PATCH 1/2] mvebu: add kernel 4.19 support

2019-08-07 Thread Bjørn Mork
Please ignore this.  I was terribly wrong.  There is a regression, but
it is related to the specific USB device and not to the Mamba system or
the EJ168 xhci controller. The USB3 port on Mamba is working fine with
other USB devices.

Sorry for the noise.  I was confused by all the reports of failing USB
with v4.19 on Mamba, and made a wrong assumption.  Like most
assumptions are...

I'll debug the real issue on x86 and mainline, and make sure it ends up
in OpenWrt via the usual stable fixes.

Thanks for all your great work!



Bjørn

Bjørn Mork  writes:

> Just to make this absolutely clear:
>
>   kernel v4.19 is currently broken on Linksys WRT1900AC (Mamba)
>
> I'm a bit disappointed that v4.19 was made default for the mvebu target
> without any followup or comment on the reported problems.  What's the
> point of testing and reporting then? The USB3 port has worked fine on
> v4.14 and earlier OpenWrt kernels with Mamba support, so this is a
> serious regression. It's a showstopper if you need USB support.
>
> AFAICT the v4.19 kernel has not been tested successfully on all
> supported mvebu platforms.  Please revert commit
> f342ffd300da48aa352c51bd65afebf6419b2228 until this issue is resolved.
>
> FWIW, I am prepared to debug this issue further but I do not know where
> to go from here.  I will bisect it if anyone can provide a bisectable
> repo between OpenWrt v4.14 and OpenWrt v4.19.  But I guess that is
> impossible for the same reason I can't create such a repo myself...
>
>
>
> Bjørn
>
>
> Bjørn Mork  writes:
>
>> Bjørn Mork  writes:
>>
>>> Like I believe others have reported before:  There is something fishy
>>> with the USB support on Mamba.  The xhci pci driver is loaded and have
>>> bound to the USB3 controller:
>>>
>>> root@wrt1900ac-1:/# lspci -vvvnns 1:
>>> 01:00.0 USB controller [0c03]: Etron Technology, Inc. EJ168 USB 3.0 Host 
>>> Controller [1b6f:7023] (rev 01) (prog-if 30 [XHCI])
>>> Subsystem: Etron Technology, Inc. EJ168 USB 3.0 Host Controller 
>>> [1b6f:7023]
>>> Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr+ 
>>> Stepping- SERR+ FastB2B- DisINTx+
>>> Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- 
>>> SERR- >> Latency: 0, Cache Line Size: 64 bytes
>>> Interrupt: pin A routed to IRQ 43
>>> Region 0: Memory at f800 (64-bit, non-prefetchable) [size=32K]
>>> Capabilities: [50] Power Management version 3
>>> Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA 
>>> PME(D0+,D1+,D2+,D3hot+,D3cold-)
>>> Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
>>> Capabilities: [70] MSI: Enable+ Count=1/4 Maskable+ 64bit+
>>> Address: f1020a04  Data: 0f10
>>> Masking: 000e  Pending: 
>>> Capabilities: [a0] Express (v2) Endpoint, MSI 00
>>> DevCap: MaxPayload 1024 bytes, PhantFunc 0, Latency L0s 
>>> <64ns, L1 <1us
>>> ExtTag+ AttnBtn- AttnInd- PwrInd- RBE+ FLReset+ 
>>> SlotPowerLimit 0.000W
>>> DevCtl: CorrErr- NonFatalErr- FatalErr- UnsupReq-
>>> RlxdOrd+ ExtTag+ PhantFunc- AuxPwr- NoSnoop+ 
>>> FLReset-
>>> MaxPayload 128 bytes, MaxReadReq 512 bytes
>>> DevSta: CorrErr- NonFatalErr- FatalErr- UnsupReq- AuxPwr- 
>>> TransPend-
>>> LnkCap: Port #0, Speed 5GT/s, Width x1, ASPM L0s L1, Exit 
>>> Latency L0s <1us, L1 <64us
>>> ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp-
>>> LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- CommClk-
>>> ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
>>> LnkSta: Speed 5GT/s (ok), Width x1 (ok)
>>> TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
>>> DevCap2: Completion Timeout: Not Supported, TimeoutDis-, 
>>> LTR-, OBFF Not Supported
>>>  AtomicOpsCap: 32bit- 64bit- 128bitCAS-
>>> DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, 
>>> LTR-, OBFF Disabled
>>>  AtomicOpsCtl: ReqEn-
>>> LnkCtl2: Target Link Speed: 5GT/s, EnterCompliance- 
>>> SpeedDis-
>>>  Transmit Margin: Normal Operating Range, 
>>> EnterModifiedCompliance- ComplianceSOS-
>>>  Compliance De-emphasis: -6dB
>>> LnkSta2: Current De-emphasis Level: -6dB, 
>>> EqualizationComplete-, EqualizationPhase1-
>>>  EqualizationPhase2-, EqualizationPhase3-, 
>>> LinkEqualizationRequest-
>>> Capabilities: [100 v1] Advanced Error Reporting
>>> UESta:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- 
>>> RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
>>> UEMsk:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- 
>>> RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
>>>