Re: [LEDE-DEV] [PATCH 9/9] ar71xx: add support for Comfast E214N V2 Outdoor CPE

2017-10-24 Thread Zoltan HERPAI

Hi,

Piotr Dymacz wrote:

Hello Zoltan,

On 22.10.2017 22:21, Zoltan HERPAI wrote:

Based on Robert Budde's patch, with additional reworks.
https://github.com/openwrt/openwrt/pull/390

Signed-off-by: Zoltan HERPAI 
---
[snip]
We have some COMFAST devices already supported under ar71xx target in 
LEDE and as they are very similar, support for all of them (IIRC) is 
kept in single mach file [1]. This limits code duplication, e.g. for 
their external watchdog, network initialization, etc.


Also, after a brief review, I found some issues here:
- LED names don't follow general naming convention (color is missing)
- support for reset button is missing
- COMFAST keeps ART copy in last 64 KB mtd partition, thus we have a 
"art-backup" partition defined [2], not "nvram" as in the patch


Personally, I would prefer to include support for this model in the 
same way as we did for rest from this vendor. How would you like to 
proceed with this one then?


For the record, we've started to work on this offline with Bill and 
Piotr to add support into the common mach file.


Regards,
-w-

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


Re: [LEDE-DEV] [PATCH 9/9] ar71xx: add support for Comfast E214N V2 Outdoor CPE

2017-10-23 Thread Piotr Dymacz

Hello Zoltan,

On 22.10.2017 22:21, Zoltan HERPAI wrote:

Based on Robert Budde's patch, with additional reworks.
https://github.com/openwrt/openwrt/pull/390

Signed-off-by: Zoltan HERPAI 
---
  target/linux/ar71xx/base-files/etc/board.d/01_leds |  10 ++
  target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
  .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
  target/linux/ar71xx/config-4.4 |   1 +
  target/linux/ar71xx/config-4.9 |   1 +
  .../ar71xx/files/arch/mips/ath79/Kconfig.openwrt   |   8 ++
  target/linux/ar71xx/files/arch/mips/ath79/Makefile |   1 +
  .../files/arch/mips/ath79/mach-cf-e214n-v2.c   | 124 +
  .../linux/ar71xx/files/arch/mips/ath79/machtypes.h |   1 +
  target/linux/ar71xx/image/generic.mk   |   8 ++
  10 files changed, 158 insertions(+)
  create mode 100644 
target/linux/ar71xx/files/arch/mips/ath79/mach-cf-e214n-v2.c


We have some COMFAST devices already supported under ar71xx target in 
LEDE and as they are very similar, support for all of them (IIRC) is 
kept in single mach file [1]. This limits code duplication, e.g. for 
their external watchdog, network initialization, etc.


Also, after a brief review, I found some issues here:
- LED names don't follow general naming convention (color is missing)
- support for reset button is missing
- COMFAST keeps ART copy in last 64 KB mtd partition, thus we have a 
"art-backup" partition defined [2], not "nvram" as in the patch


Personally, I would prefer to include support for this model in the same 
way as we did for rest from this vendor. How would you like to proceed 
with this one then?


--
Cheers,
Piotr

[1] 
https://github.com/lede-project/source/blob/master/target/linux/ar71xx/files/arch/mips/ath79/mach-cf-e316n-v2.c


[2] 
https://github.com/lede-project/source/blob/master/target/linux/ar71xx/image/generic.mk#L142




diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds 
b/target/linux/ar71xx/base-files/etc/board.d/01_leds
index 27e6c8a..5707624 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
@@ -182,6 +182,16 @@ carambola2)
ucidef_set_led_netdev "wan" "WAN" "$board:orange:eth1" "eth1"
ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt"
;;
+cf-e214n-v2)
+   ucidef_set_led_netdev "lan" "LAN" "$board:lan" "eth0"
+   ucidef_set_led_netdev "wan" "WAN" "$board:wan" "eth1"
+   ucidef_set_led_wlan "wlan" "WLAN" "$board:wlan" "phy0tpt"
+   ucidef_set_rssimon "wlan" "20" "1"
+   ucidef_set_led_rssi "rssilow" "RSSILOW" "$board:link1" "wlan" "1" "100" "0" 
"13"
+   ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "$board:link2" "wlan" "26" "100" 
"-25" "13"
+   ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "$board:link3" "wlan" "51" "100" 
"-50" "13"
+   ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$board:link4" "wlan" "76" "100" "-75" 
"13"
+   ;;
  cf-e316n-v2)
ucidef_set_led_netdev "lan" "LAN" "$board:blue:lan" "eth0"
ucidef_set_led_netdev "wan" "WAN" "$board:blue:wan" "eth1"
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index bdba81b..1c1317d 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -504,6 +504,9 @@ ar71xx_board_detect() {
*"Carambola2"*)
name="carambola2"
;;
+   *"CF-E214N v2")
+   name="cf-e214n-v2"
+   ;;
*"CF-E316N v2")
name="cf-e316n-v2"
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index a60e44c..e768386 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -215,6 +215,7 @@ platform_check_image() {
bullet-m|\
c-55|\
carambola2|\
+   cf-e214n-v2|\
cf-e316n-v2|\
cf-e320n-v2|\
cf-e355ac|\
diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4
index 4793bf4..d8f94e3 100644
--- a/target/linux/ar71xx/config-4.4
+++ b/target/linux/ar71xx/config-4.4
@@ -67,6 +67,7 @@ CONFIG_ATH79_MACH_C55=y
  CONFIG_ATH79_MACH_CAP324=y
  CONFIG_ATH79_MACH_CAP4200AG=y
  CONFIG_ATH79_MACH_CARAMBOLA2=y
+CONFIG_ATH79_MACH_CF_E214N_V2=y
  CONFIG_ATH79_MACH_CF_E316N_V2=y
  CONFIG_ATH79_MACH_CF_E320N_V2=y
  CONFIG_ATH79_MACH_CF_E355AC=y
diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-4.9
index 285c638..df90b20 100644
--- a/target/linux/ar71xx/config-4.9
+++ b/target/linux/ar71xx/config-4.9
@@ -66,6 +66,7 @@ CONFIG_ATH79_MACH_C55=y
  CONFIG_ATH79_MACH_CAP324=y
  CONFIG_ATH79_MACH_CAP4200AG=y
  CONFIG_ATH79_MACH_CARAMBOLA2=y
+CONFIG_ATH79_MACH_CF_E214N_V2=y