Re: [LEDE-DEV] [PATCH] ar71xx: add Engenius ENH200EXT support

2017-03-31 Thread Daniel Golle
Hi Paul,

On Fri, Mar 31, 2017 at 10:38:39PM +0200, Paul Oranje wrote:
> This POE access point suited for outside usage needs an external antenna.
> According FCC documentation the ENH200EXT (needs external antenna) and the 
> ENH200 (with internal antenna) are electrically equal to the Allnet ALL0258N.
> 
> The stock image does not allow install of a LEDE factory image, but an 
> initramfs image (lede-ar71xx-generic-enh200ext-initramfs-uImage.bin) can be 
> loaded via u-boot recovery procedure (long press reset at power-on until all 
> LEDS burn). The u-boot recovery procedure boots an image named 
> vmlinux-art-ramdisk from 192.168.1.101.
> Once booted the sysupgrade image can be flashed from the booted iniramfs LEDE.
> 
> Only abnormality is that for some unknown reason the txpower cannot be set 
> higher than 16 dBm whereas the Engenius stock firmware allows a maximum of 27 
> dBm.

Yes, difference is software only. ALL0258N came with OpenWrt
pre-flashed, hence we contributed the needed bits upstream. Also went
through ODM QA with OpenWrt, so EEPROM might not be identical for
ENH200 and ALL0258N (the latter was intended to run OpenWrt with ath9k
as well as Atheros SDK's proprietary driver).

> 
> Signed-off-by: Paul Oranje 
> ---
> package/boot/uboot-envtools/files/ar71xx   |  1 +
> target/linux/ar71xx/base-files/etc/board.d/01_leds |  3 +-
> .../linux/ar71xx/base-files/etc/board.d/02_network |  1 +
> target/linux/ar71xx/base-files/lib/ar71xx.sh   |  3 +
> .../ar71xx/base-files/lib/upgrade/platform.sh  |  6 +-
> target/linux/ar71xx/config-4.4 |  1 +
> .../ar71xx/files/arch/mips/ath79/Kconfig.openwrt   |  9 +++
> target/linux/ar71xx/files/arch/mips/ath79/Makefile |  1 +
> .../ar71xx/files/arch/mips/ath79/mach-enh200ext.c  | 89 ++
^^^
Please merge this with mach-all0258n.c so we don't have tons of
redundant code. Make them share most of the setup code, maybe
parametrisize the LEDs so you can pass a string and then just have
two MIPS_MACHINE lines at the bottom of the file. Take a look at
various mach-tl-*.c files which usually are for several similar
models each.

Cheers

Daniel

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


[LEDE-DEV] [PATCH] brcm2708: include upstream bcm2835-rpi-zero DT binary in image

2017-03-31 Thread Rafał Miłecki
From: Rafał Miłecki 

This allows easier testing/developing/debugging of upstream DTS file.
Foundation's start.elf doesn't use it on its own so this won't cause any
regressions. Testing this DTB requires using U-Boot or adding
device_tree entry to the config.txt.

Signed-off-by: Rafał Miłecki 
---
 target/linux/brcm2708/image/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/brcm2708/image/Makefile 
b/target/linux/brcm2708/image/Makefile
index 7909c6d814..9c048f5e33 100644
--- a/target/linux/brcm2708/image/Makefile
+++ b/target/linux/brcm2708/image/Makefile
@@ -56,7 +56,7 @@ endef
 
 define Device/rpi
   DEVICE_TITLE := Raspberry Pi B/B+/CM/Zero/ZeroW
-  DEVICE_DTS := bcm2708-rpi-b bcm2708-rpi-b-plus bcm2708-rpi-cm bcm2708-rpi-0-w
+  DEVICE_DTS := bcm2708-rpi-b bcm2708-rpi-b-plus bcm2708-rpi-cm 
bcm2708-rpi-0-w bcm2835-rpi-zero
 endef
 ifeq ($(SUBTARGET),bcm2708)
   TARGET_DEVICES += rpi
-- 
2.11.0


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


[LEDE-DEV] [PATCH] ar71xx: add Engenius ENH200EXT support

2017-03-31 Thread Paul Oranje
This POE access point suited for outside usage needs an external antenna.
According FCC documentation the ENH200EXT (needs external antenna) and the 
ENH200 (with internal antenna) are electrically equal to the Allnet ALL0258N.

The stock image does not allow install of a LEDE factory image, but an 
initramfs image (lede-ar71xx-generic-enh200ext-initramfs-uImage.bin) can be 
loaded via u-boot recovery procedure (long press reset at power-on until all 
LEDS burn). The u-boot recovery procedure boots an image named 
vmlinux-art-ramdisk from 192.168.1.101.
Once booted the sysupgrade image can be flashed from the booted iniramfs LEDE.

Only abnormality is that for some unknown reason the txpower cannot be set 
higher than 16 dBm whereas the Engenius stock firmware allows a maximum of 27 
dBm.

Signed-off-by: Paul Oranje 
---
package/boot/uboot-envtools/files/ar71xx   |  1 +
target/linux/ar71xx/base-files/etc/board.d/01_leds |  3 +-
.../linux/ar71xx/base-files/etc/board.d/02_network |  1 +
target/linux/ar71xx/base-files/lib/ar71xx.sh   |  3 +
.../ar71xx/base-files/lib/upgrade/platform.sh  |  6 +-
target/linux/ar71xx/config-4.4 |  1 +
.../ar71xx/files/arch/mips/ath79/Kconfig.openwrt   |  9 +++
target/linux/ar71xx/files/arch/mips/ath79/Makefile |  1 +
.../ar71xx/files/arch/mips/ath79/mach-enh200ext.c  | 89 ++
.../linux/ar71xx/files/arch/mips/ath79/machtypes.h |  1 +
target/linux/ar71xx/image/legacy-devices.mk|  6 ++
target/linux/ar71xx/image/legacy.mk|  2 +
target/linux/ar71xx/mikrotik/config-default|  1 +
target/linux/ar71xx/nand/config-default|  1 +
14 files changed, 122 insertions(+), 3 deletions(-)
create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-enh200ext.c

diff --git a/package/boot/uboot-envtools/files/ar71xx 
b/package/boot/uboot-envtools/files/ar71xx
index 3a5d269..a104c3a 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -27,6 +27,7 @@ cpe870|\
cr3000|\
cr5000|\
eap300v2|\
+enh200ext|\
gl-ar300m|\
hornet-ub|\
hornet-ub-x2|\
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 686ae31..cf9c3ae 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
@@ -28,7 +28,8 @@ alfa-nx)
ucidef_set_led_netdev "lan" "LAN" "alfa:green:led_3" "eth1"
;;
all0258n|\
-all0315n)
+all0315n|\
+enh200ext)
ucidef_set_rssimon "wlan0" "20" "1"
ucidef_set_led_rssi "rssilow" "RSSILOW" "$board:red:rssilow" "wlan0" 
"1" "40" "0" "6"
ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" 
"$board:yellow:rssimedium" "wlan0" "30" "80" "-29" "5"
diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network 
b/target/linux/ar71xx/base-files/etc/board.d/02_network
index 20b34e8..014404e 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -155,6 +155,7 @@ ar71xx_setup_interfaces()
dlan-hotspot|\
dlan-pro-500-wp|\
dr344|\
+   enh200ext|\
ja76pf2|\
rocket-m-ti|\
ubnt-unifi-outdoor)
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 4951e5b..f365feb 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -619,6 +619,9 @@ ar71xx_board_detect() {
*"EmbWir-Dorin-Router")
name="ew-dorin-router"
;;
+   *"ENH200EXT")
+   name="enh200ext"
+   ;;
*"EPG5000")
name="epg5000"
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 364a32f..b4a84c2 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -332,7 +332,8 @@ platform_check_image() {
cap324|\
cap4200ag|\
cr3000|\
-   cr5000)
+   cr5000|\
+   enh200ext)
platform_check_image_allnet "$1" && return 0
return 1
;;
@@ -721,7 +722,8 @@ platform_do_upgrade() {
local board=$(ar71xx_board_name)

case "$board" in
-   all0258n)
+   all0258n|\
+   enh200ext)
platform_do_upgrade_allnet "0x9f05" "$ARGV"
;;
all0305|\
diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4
index 68b408a..3a74f8f 100644
--- a/target/linux/ar71xx/config-4.4
+++ b/target/linux/ar71xx/config-4.4
@@ -99,6 +99,7 @@ CONFIG_ATH79_MACH_EAP300V2=y
CONFIG_ATH79_MACH_EAP7660D=y
CONFIG_ATH79_MACH_EL_M150=y
CONFIG_ATH79_MACH_EL_MINI=y
+CONFIG_ATH79_MACH_ENH200EXT=y
CONFIG_ATH79_MACH_EPG5000=y

Re: [LEDE-DEV] [PATCH] ar71xx: add support for TP-Link TL-WDR5600 v1

2017-03-31 Thread Piotr Dymacz

Hello Jie,

Thank you for your patch, unfortunately it fails to apply, please rebase 
and resend it.


Also, please see my comments inline, below.

On 31.03.2017 13:06, Jie Ke wrote:

From: Soundtrack9407 


Full and real name, please.



Specifications:
- SoC: Qualcomm QCA9561 (750MHz)
- RAM: 64MB
- Storage: 8MB (Winbond w25q64)
- Wireless: Qualcomm QCA9561 + QCA9887
- Ethernet: 4+1 x 100M
http://www.tp-link.com.cn/product_415.html


The most important question here is:

How the user can install LEDE on this device?

In fact, I have this device here and I know that the vendor firmware 
(both the bootloader and the system) contains RSA signature verification 
and when I try factory image, built based on your patch, in vendor GUI 
I'm getting: "RSA signature verification failed" (translation).


Also, the U-Boot HTTP recovery mode doesn't accept the image:

CC 96 72 CA DA F7 FE 1C 67 4B A4 67 1A BC 35 57
error: RSA check failed.
check firmware failed, exit

So, why should we include support for this device if there is no 
common/normal way to use it at all (at least for now)?



Signed-off-by: Soundtrack9407 


Full and real name, please.


---
 target/linux/ar71xx/base-files/etc/board.d/01_leds |   7 +
 .../linux/ar71xx/base-files/etc/board.d/02_network |   1 +
 target/linux/ar71xx/base-files/etc/diag.sh |   1 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |   1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   6 +
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   2 +
 target/linux/ar71xx/config-4.4 |   1 +
 .../ar71xx/files/arch/mips/ath79/Kconfig.openwrt   |  10 ++
 target/linux/ar71xx/files/arch/mips/ath79/Makefile |   1 +
 .../files/arch/mips/ath79/mach-tl-wdr5600-v1.c | 143 +
 .../linux/ar71xx/files/arch/mips/ath79/machtypes.h |   1 +
 target/linux/ar71xx/image/tp-link.mk   |  13 ++
 12 files changed, 187 insertions(+)
 create mode 100644 
target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr5600-v1.c

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 32d4931..82b08f4 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
@@ -644,6 +644,13 @@ tl-wdr4900-v2)
ucidef_set_led_wlan "wlan2g" "WLAN2G" "tp-link:blue:wlan2g" "phy0tpt"
ucidef_set_led_wlan "wlan5g" "WLAN5G" "tp-link:blue:wlan5g" "phy1tpt"
;;
+tl-wdr5600-v1)
+   ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth0"
+   ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" 
"0x02"
+   ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" 
"0x04"
+   ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" 
"0x08"
+   ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" 
"0x10"
+   ;;


This one looks almost the same as for tl-wdr6500-v2 and as these boards 
seem to be very similar from h/w point of view... there is a bug 
somewhere here.


I suppose WAN LED for tl-wdr6500-v2 is assigned to a wrong interface 
(eth1 instead of eth0)... just a side note.



 tl-wdr6500-v2|\
 tl-wr741nd)
ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1"
diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network 
b/target/linux/ar71xx/base-files/etc/board.d/02_network
index a55e50a..6ea3e73 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -292,6 +292,7 @@ ar71xx_setup_interfaces()
r6100|\
smart-300|\
tl-mr3420-v2|\
+   tl-wdr5600-v1|\
tl-wdr6500-v2|\
tl-wr841n-v8|\
tl-wr940n-v4|\
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
index 461d0da..3d23502 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -409,6 +409,7 @@ get_status_led() {
tl-wr2543n)
status_led="tp-link:green:wps"
;;
+   tl-wdr5600-v1|\
tl-wdr6500-v2)
status_led="tp-link:white:system"
;;
diff --git 
a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata 
b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 4938e26..bdb1c35 100644
--- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -94,6 +94,7 @@ case "$FIRMWARE" in
;;
archer-c59-v1|\
archer-c60-v1|\
+   tl-wdr5600-v1|\
tl-wdr6500-v2)
ath10kcal_extract "art" 20480 2116
ath10kcal_patch_mac $(macaddr_add $(cat 
/sys/class/net/eth1/address) -2)
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 

Re: [LEDE-DEV] [PATCH RFC] owsd: add package for OpenWrt WebSocket Daemon

2017-03-31 Thread Denis Osvald
Hi Rafał,

On 2017-03-30 12:21, Rafał Miłecki wrote:
> Hi,
> 
> I don't know if there is any interest in this package (and if it should go to
> base or external repo), but I gave it a try and so I'm sharing my code.


owsd was written by me for Inteno. It's used in the JUCI web UI.
Our plans for inclusion were to:
- move the source and development to a GitHub Inteno Group account
- make owsd (partially or completely) compatible with LUCI for backwards
compatibility
- include owsd in the not-yet-created prplwrt feed

From my POV, it is of course good if to go in the base or any other feed
as well especially if it is made LUCI compatible.

As for the patch, we have a more complete package in the following
repository:

http://public.inteno.se/?p=feed-inteno-juci.git;a=tree;f=net/owsd;h=8b57f49368be50999e209ca8d706c3de496ace73

Next week I will send a patch for the more complete owsd package,
and I will keep you, Rafał, In the loop.


Regards,

Denis

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


[LEDE-DEV] [PATCH] base-files: use restart if no reload hook for service

2017-03-31 Thread Alexandru Ardelean
This was also working before, with a slightly
different semantic.

[ Original semantic ]
If no reload hooks was implemented, the default one would
kick in, it would return fail, and restart would happen.

This would happen also in the case where a reload hook
would be implemented, it would fail, and it would restart
the service.

[ New semantic ]
The default reload hook calls restart.
Services can implement their own reload.

If reload fails, then the '/etc/init.d/ reload'
would return a non-zero code, and the caller can choose
a way to handle this.

Signed-off-by: Alexandru Ardelean 
---
 package/base-files/files/etc/rc.common | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/package/base-files/files/etc/rc.common 
b/package/base-files/files/etc/rc.common
index 95cf956..af7bed4 100755
--- a/package/base-files/files/etc/rc.common
+++ b/package/base-files/files/etc/rc.common
@@ -17,7 +17,7 @@ stop() {
 }
 
 reload() {
-   return 1
+   restart
 }
 
 restart() {
@@ -68,7 +68,7 @@ Available commands:
start   Start the service
stopStop the service
restart Restart the service
-   reload  Reload configuration files (or restart if that fails)
+   reload  Reload configuration files (or restart if service does not 
implement reload)
enable  Enable service autostart
disable Disable service autostart
 $EXTRA_HELP
@@ -130,7 +130,7 @@ ${INIT_TRACE:+set -x}
if eval "type reload_service" 2>/dev/null >/dev/null; then
reload_service "$@"
else
-   start
+   restart
fi
}
 
@@ -141,5 +141,4 @@ ${INIT_TRACE:+set -x}
 
 ALL_COMMANDS="start stop reload restart boot shutdown enable disable enabled 
depends ${EXTRA_COMMANDS}"
 list_contains ALL_COMMANDS "$action" || action=help
-[ "$action" = "reload" ] && action='eval reload "$@" || restart "$@" && :'
 $action "$@"
-- 
2.7.4


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


[LEDE-DEV] [PATCH netifd] interface: add new "ifup-failed" hotplug event

2017-03-31 Thread Martin Schiller
This hook makes it possible to do some helper work in hotplug scripts
when a connection is not established successfully.

example: try several username/passwords from a pool to establish a
pppoe or wwan connection by replacing the configured values of the
connection in a hotplug script.

Signed-off-by: Martin Schiller 
---
 interface-event.c | 2 ++
 interface.c   | 4 
 interface.h   | 1 +
 3 files changed, 7 insertions(+)

diff --git a/interface-event.c b/interface-event.c
index 4976c2c..86e8f54 100644
--- a/interface-event.c
+++ b/interface-event.c
@@ -33,6 +33,7 @@ static struct uloop_process task = {
 static const char * const eventnames[] = {
[IFEV_DOWN] = "ifdown",
[IFEV_UP] = "ifup",
+   [IFEV_UP_FAILED] = "ifup-failed",
[IFEV_UPDATE] = "ifupdate",
[IFEV_FREE] = "free",
[IFEV_RELOAD] = "reload",
@@ -191,6 +192,7 @@ static void interface_event_cb(struct interface_user *dep, 
struct interface *ifa
switch (ev) {
case IFEV_LINK_UP:
case IFEV_UP:
+   case IFEV_UP_FAILED:
case IFEV_UPDATE:
case IFEV_DOWN:
interface_queue_event(iface, ev);
diff --git a/interface.c b/interface.c
index f150f7d..e04d477 100644
--- a/interface.c
+++ b/interface.c
@@ -241,6 +241,7 @@ interface_event(struct interface *iface, enum 
interface_event ev)
adev = iface->l3_dev.dev;
/* fall through */
case IFEV_DOWN:
+   case IFEV_UP_FAILED:
alias_notify_device(iface->name, adev);
break;
default:
@@ -268,6 +269,8 @@ mark_interface_down(struct interface *iface)
iface->state = IFS_DOWN;
if (state == IFS_UP)
interface_event(iface, IFEV_DOWN);
+   else
+   interface_event(iface, IFEV_UP_FAILED);
interface_ip_set_enabled(>config_ip, false);
interface_ip_set_enabled(>proto_ip, false);
interface_ip_flush(>proto_ip);
@@ -557,6 +560,7 @@ interface_alias_cb(struct interface_user *dep, struct 
interface *iface, enum int
interface_set_available(alias, true);
break;
case IFEV_DOWN:
+   case IFEV_UP_FAILED:
interface_set_available(alias, false);
interface_set_main_dev(alias, NULL);
break;
diff --git a/interface.h b/interface.h
index 1472324..c51705c 100644
--- a/interface.h
+++ b/interface.h
@@ -23,6 +23,7 @@ struct interface_proto_state;
 enum interface_event {
IFEV_DOWN,
IFEV_UP,
+   IFEV_UP_FAILED,
IFEV_UPDATE,
IFEV_FREE,
IFEV_RELOAD,
-- 
2.1.4


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