[OpenWrt-Devel] [PATCH] Enable RFKill and USB Power GPIO for tl-wdr4900v1

2015-07-07 Thread Alpha Sparc
Add dts patch to enable RFKill and USB Power GPIO Control
This patch adds the RFKill GPIO control switch and enables another
GPIO to control power supply to USB Ports by emulating an LED GPIO.

Signed-off-by: Guo Wei Lim alphasp...@gmail.com

--- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts
+++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts
@@ -198,6 +198,11 @@
 gpios = gpio0 4 1; /* active low */
 label = tp-link:green:usb2;
 };
+
+usbpower {
+gpios = gpio0 10 1; /* active low */
+label = tp-link:usb:power;
+};
 };

 buttons {
@@ -208,6 +213,12 @@
 gpios = gpio0 5 1; /* active low */
 linux,code = 0x198; /* KEY_RESTART */
 };
+
+rfkill {
+label = RFKILL switch;
+gpios = gpio0 11 1; /* active low */
+linux,code = 0xf7; /* RFKill */
+};
 };
 };
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [OpenWrt-Hackers] 15.05-rc3

2015-07-07 Thread John Crispin
oh well, wrong mailing list fat fingered that one. the images were aimed
for internal testing before we publish them :) pleas ebe patient till
friday.

John

On 07/07/2015 18:14, John Crispin wrote:
 
 
 On 07/07/2015 17:46, Imre Kaloz wrote:
 On Tue, 07 Jul 2015 07:53:58 +0200, John Crispin blo...@openwrt.org
 wrote:

 Hi John,

 long wait but rc3 is finally ready (i hope)

 the IB issue is fixed, we backported a bunch of fixes and fixed the
 feeds (par 2 still broken packages)

 - http://build2.mein.io/chaos_calmer/15.05-rc3/

 please start testing

 I can only test things after Friday. Do you already have a date for
 -final in mind?



 Thanks,

 Imre
 
 Hi Imre,
 
 I said this before and i will say it again. there is no fixed date. good
 software takes time. If you need another few days then so be it. i never
 imposed any dates or deadlines for releases. that was some one else.
 
   John
 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] ZTE MF823 Au - umbim troubles

2015-07-07 Thread Gareth Lowe
Gday All,



Bjorns on holiday so he suggested I send an email here. Been getting the
Message not long enough error when trying to connect the AU MF823 (We got
the MBIM mode going!).



Here is the output from umbim :
root@ROOter:~# umbim -d /dev/cdc-wdm0 caps

devicetype: 0003 - remote
cellularclass: 0001
voiceclass: 0001 - no-voice
simclass: 0002
dataclass: 003F
smscaps: 0003
controlcaps: 0001
maxsessions: 0001
deviceid: 866948018579584
firmwareinfo: MF823_M01
hardwareinfo: MF823
customdataclass: (null)

root@ROOter:~# umbim -d /dev/cdc-wdm0 pinstate
required pin: 3 - pin2
remaining attempts: 3
root@ROOter:~# umbim -d /dev/cdc-wdm0 unlock 
message not long enough
root@ROOter:~# umbim -v -d /dev/cdc-wdm0 unlock 
sending (16): 01 00 00 00 10 00 00 00 01 00 00 00 00 04 00 00

header_type: 0001
header_length: 0010
header_transaction: 0001

reading (16): 01 00 00 80 10 00 00 00 01 00 00 00 00 00 00 00

header_type: 8001
header_length: 0010
header_transaction: 0001

sending (80): 03 00 00 00 50 00 00 00 02 00 00 00 01 00 00 00 00 00 00 00
a2 89 cc 33 bc bb 8b 4f b6 b0 13 3e c2 aa e6 df 04 00 00 00 01 00 00 00 20
00 00 00 02 00 00 00 00 00 00 00 18 00 00 00 08 00 00 00 00 00 00 00 00 00
00 00 31 00 31 00 31 00 31 00

header_type: 0003
header_length: 0050
header_transaction: 0002

reading (64): 07 00 00 80 40 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00
4b f3 84 76 1e 6a 41 db b1 d8 be d2 89 c2 5b db 01 00 00 00 14 00 00 00 01
00 00 00 f4 01 00 00 0a 00 00 00 50 00 00 00 12 00 00 00

header_type: 8007
header_length: 0040
header_transaction: 

reading (48): 03 00 00 80 30 00 00 00 02 00 00 00 01 00 00 00 00 00 00 00
a2 89 cc 33 bc bb 8b 4f b6 b0 13 3e c2 aa e6 df 04 00 00 00 0e 00 00 00 00
00 00 00

header_type: 8003
header_length: 0030
header_transaction: 0002

message not long enough
sending (16): 02 00 00 00 10 00 00 00 03 00 00 00 01 00 00 00

header_type: 0002
header_length: 0010
header_transaction: 0003

reading (16): 02 00 00 80 10 00 00 00 03 00 00 00 00 00 00 00

header_type: 8002
header_length: 0010
header_transaction: 0003

root@ROOter:~# umbim -d /dev/cdc-wdm0 subscriber

readystate: 0001 - initialized
simiccid: 8961018000 -- censored
subscriberid: 505013430 -- censored
telenumcnt: 0

root@ROOter:~# umbim -d /dev/cdc-wdm0 registration

nwerror:  - unknown
registerstate: 0003 - home
registermode: 0001 - automatic
availabledataclasses: 0020 - lte
currentcellularclass: 0001 - gsm
provider_id: 50501
provider_name: Telstra Mobile
roamingtext: (null)

root@ROOter:~# umbim -d /dev/cdc-wdm0 attach
message not long enough
root@ROOter:~# umbim -v -d /dev/cdc-wdm0 attach
sending (16): 01 00 00 00 10 00 00 00 01 00 00 00 00 04 00 00

header_type: 0001
header_length: 0010
header_transaction: 0001

reading (16): 01 00 00 80 10 00 00 00 01 00 00 00 00 00 00 00

header_type: 8001
header_length: 0010
header_transaction: 0001

sending (52): 03 00 00 00 34 00 00 00 02 00 00 00 01 00 00 00 00 00 00 00
a2 89 cc 33 bc bb 8b 4f b6 b0 13 3e c2 aa e6 df 0a 00 00 00 01 00 00 00 04
00 00 00 00 00 00 00

header_type: 0003
header_length: 0034
header_transaction: 0002

reading (64): 07 00 00 80 40 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00
4b f3 84 76 1e 6a 41 db b1 d8 be d2 89 c2 5b db 01 00 00 00 14 00 00 00 01
00 00 00 f4 01 00 00 0a 00 00 00 50 00 00 00 12 00 00 00

header_type: 8007
header_length: 0040
header_transaction: 

reading (48): 03 00 00 80 30 00 00 00 02 00 00 00 01 00 00 00 00 00 00 00
a2 89 cc 33 bc bb 8b 4f b6 b0 13 3e c2 aa e6 df 0a 00 00 00 0e 00 00 00 00
00 00 00

header_type: 8003
header_length: 0030
header_transaction: 0002

message not long enough
sending (16): 02 00 00 00 10 00 00 00 03 00 00 00 01 00 00 00

header_type: 0002
header_length: 0010
header_transaction: 0003

reading (16): 02 00 00 80 10 00 00 00 03 00 00 00 00 00 00 00

header_type: 8002
header_length: 0010
header_transaction: 0003

root@ROOter:~# umbim -d /dev/cdc-wdm0 connect
message not long enough
root@ROOter:~# umbim -v -d /dev/cdc-wdm0 connect
sending (16): 01 00 00 00 10 00 00 00 01 00 00 00 00 04 00 00

header_type: 0001
header_length: 0010
header_transaction: 0001

reading (16): 01 00 00 80 10 00 00 00 01 00 00 00 00 00 00 00

header_type: 8001
header_length: 0010
header_transaction: 0001

sending (108): 03 00 00 00 6c 00 00 00 02 00 00 00 01 00 00 00 00 00 00 00
a2 89 cc 33 bc bb 8b 4f b6 b0 13 3e c2 aa e6 df 0c 00 00 00 01 00 00 00 3c
00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 7e 5e 2a
7e 4e 6f 72 72 73 6b 65 6e 7e 5e 2a 7e

header_type: 0003
header_length: 006C
header_transaction: 0002

reading (48): 03 00 00 80 30 00 00 00 02 00 00 00 01 00 00 00 00 00 00 00
a2 89 cc 33 bc bb 8b 4f b6 b0 13 3e c2 aa e6 df 0c 00 00 00 0e 00 00 00 00
00 00 00

header_type: 8003
header_length: 0030
header_transaction: 0002

message not long enough
sending (16): 02 00 00 00 10 00 00 00 03 00 

Re: [OpenWrt-Devel] [PATCH 1/2] dnsmasq: enable extra tracing by default when UCI parameter logqueries is set

2015-07-07 Thread Steven Barth
Applied, thanks.

Am 06.07.2015 um 18:29 schrieb Hans Dedecker:
 Signed-off-by: Hans Dedecker dedec...@gmail.com
 ---
  package/network/services/dnsmasq/files/dnsmasq.init | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/package/network/services/dnsmasq/files/dnsmasq.init 
 b/package/network/services/dnsmasq/files/dnsmasq.init
 index b0a5fbc..bbe2b56 100644
 --- a/package/network/services/dnsmasq/files/dnsmasq.init
 +++ b/package/network/services/dnsmasq/files/dnsmasq.init
 @@ -121,7 +121,7 @@ dnsmasq() {
   append_bool $cfg nohosts --no-hosts
   append_bool $cfg nonegcache --no-negcache
   append_bool $cfg strictorder --strict-order
 - append_bool $cfg logqueries --log-queries
 + append_bool $cfg logqueries --log-queries=extra
   append_bool $cfg noresolv --no-resolv
   append_bool $cfg localise_queries --localise-queries
   append_bool $cfg readethers --read-ethers
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH v2] ncm: add support to run via proto wwan

2015-07-07 Thread Aleksandr Kolesnik
Hi,

Is it OK now?

Signed-off-by: Aleksandr Kolesnik ner...@gmail.com

--- a/package/network/utils/comgt/files/ncm.sh
+++ b/package/network/utils/comgt/files/ncm.sh
@@ -27,6 +27,8 @@ proto_ncm_setup() {
  local device apn auth username password pincode delay mode
  json_get_vars device apn auth username password pincode delay mode

+ [ -n $ctl_device ]  device=$ctl_device
+
  [ -n $device ] || {
  echo No control device specified
  proto_notify_error $interface NO_DEVICE


2015-07-07 15:03 GMT+03:00 John Crispin blo...@openwrt.org:

 Hi,

 patch is generated against the wrong root folder. also your mail client
 replaced tabs with spaces. please fix and resend the patch

 John

 On 22/04/2015 15:26, Aleksandr Kolesnik wrote:
  Signed-off-by: Aleksandr Kolesnik ner...@gmail.com
  mailto:ner...@gmail.com
 
  --- package/network/utils/comgt/files/ncm.sh
  +++ package/network/utils/comgt/files/ncm.sh
  @@ -27,6 +27,8 @@ proto_ncm_setup() {
   local device apn auth username password pincode delay mode
   json_get_vars device apn auth username password pincode delay mode
 
  +[ -n $ctl_device ]  device=$ctl_device
  +
   [ -n $device ] || {
   echo No control device specified
   proto_notify_error $interface NO_DEVICE
 
 
  ___
  openwrt-devel mailing list
  openwrt-devel@lists.openwrt.org
  https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
 

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


[OpenWrt-Devel] [PATCH] [PATCH v3] ar71xx: Add support for Cisco-Linksys WAP4410N

2015-07-07 Thread Ryan A Young
This patch adds support for the Cisco WAP4410N, an access point that uses the
AR9132 SoC. Web upgrades from stock are not yet possible, UART access required
for the initial flash.

Signed-off-by: Ryan A Young rayo...@utexas.edu

---

This is an updated version of Caleb James DeLisle's patch from 27 April. It has
been rebased against trunk as of this morning and an issue related to the flash
layout that prevented OpenWrt from running without modding the stock bootloader
has been fixed.
---
 target/linux/ar71xx/base-files/etc/diag.sh |   3 +
 .../ar71xx/base-files/etc/uci-defaults/02_network  |   1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
 target/linux/ar71xx/config-3.18|   1 +
 .../ar71xx/files/arch/mips/ath79/mach-wap4410n.c   | 285 +
 target/linux/ar71xx/generic/profiles/linksys.mk|  10 +
 target/linux/ar71xx/image/Makefile |   3 +
 8 files changed, 307 insertions(+)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-wap4410n.c

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
index 0bcb273..ce2b9ba 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -328,6 +328,9 @@ get_status_led() {
wrt400n)
status_led=wrt400n:blue:wps
;;
+   wap4410n)
+   status_led=wrt4410n:green:power
+   ;;
wrt160nl)
status_led=wrt160nl:blue:wps
;;
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
index ea19de9..51095a9 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -341,6 +341,7 @@ tl-wa901nd-v3 |\
 tl-wr703n |\
 tube2h |\
 wndap360 |\
+wap4410n |\
 mynet-rext |\
 wp543)
ucidef_set_interface_lan eth0
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 9943d69..dd13948 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -880,6 +880,9 @@ ar71xx_board_detect() {
*WRT400N)
name=wrt400n
;;
+   *WAP4410N)
+   name=wap4410n
+   ;;
*WZR-450HP2)
name=wzr-450hp2
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 37a2e7b..73d8b0d 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -233,6 +233,7 @@ platform_check_image() {
nanostation-m-xw | \
rw2458n | \
wpj531 | \
+   wap4410n | \
wndap360 | \
wpj344 | \
wzr-hp-g300nh2 | \
diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18
index 0680dd0..02857d5 100644
--- a/target/linux/ar71xx/config-3.18
+++ b/target/linux/ar71xx/config-3.18
@@ -148,6 +148,7 @@ CONFIG_ATH79_MACH_WPJ531=y
 CONFIG_ATH79_MACH_WPJ558=y
 CONFIG_ATH79_MACH_WRT160NL=y
 CONFIG_ATH79_MACH_WRT400N=y
+CONFIG_ATH79_MACH_WAP4410N=y
 CONFIG_ATH79_MACH_WZR_450HP2=y
 CONFIG_ATH79_MACH_WZR_HP_AG300H=y
 CONFIG_ATH79_MACH_WZR_HP_G300NH=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-wap4410n.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-wap4410n.c
new file mode 100644
index 000..f2cf071
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-wap4410n.c
@@ -0,0 +1,285 @@
+/*
+ *  Cisco WAP4410N board support
+ *
+ *  Copyright (C) 2014 Caleb James DeLisle c...@cjdns.fr
+ *  Copyright (C) 2015 Ryan A Young rayo...@utexas.edu
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation, or (at your option) any later version.
+ */
+#include linux/platform_device.h
+#include linux/mtd/mtd.h
+#include linux/mtd/partitions.h
+#include linux/mtd/physmap.h
+#include linux/nxp_74hc153.h
+
+#include asm/mach-ath79/ath79.h
+
+#include dev-eth.h
+#include dev-gpio-buttons.h
+#include dev-leds-gpio.h
+#include dev-usb.h
+#include dev-wmac.h
+#include machtypes.h
+
+/* -- begin flash device -- */
+
+#define FLASH_BASE 0xbf00
+
+/* where the actual art data is within the art partition. */
+#define ART_DATA_OFFSET 0x1000
+
+/* If changed, make sure to change image/Makefile too! */
+#define KERN_SIZE 0x19
+
+/* Flash layout: u-boot/include/upgrade.h in cisco's GPL dump */
+#define FLASH_SIZE (0x80)
+#define BOOT_SIZE  (0x4)
+#define NVRAM_SIZE (0x1)
+#define ART_SIZE

[OpenWrt-Devel] Progress on patch - scripts/feeds: print the source of packages installed

2015-07-07 Thread Kevin Darbyshire-Bryant
Greetings OpenWrt developers,

Is there any possibility of getting
https://patchwork.ozlabs.org/patch/477022/ merged in to trunk please?

In combination with git-svn-id:
svn://svn.openwrt.org/openwrt/trunk@46120 it's a very useful patch when
dealing with packages in various feeds, especially if the feeds overlap,
as a visual confirmation that the correct package source has been
accepted.  It looks like a pretty innocent patch to me, I've had it in a
local build environment for 2+ weeks without anything exploding on me.

Many thanks,

Kevin



smime.p7s
Description: S/MIME Cryptographic Signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] fstools: fstab.init fix spelling

2015-07-07 Thread Kevin Darbyshire-Bryant
fix a very minor typo in warning message

Signed-off-by: Kevin Darbyshire-Bryant ke...@darbyshire-bryant.me.uk
---
 package/system/fstools/files/fstab.init | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/system/fstools/files/fstab.init 
b/package/system/fstools/files/fstab.init
index be49470..f995e96 100644
--- a/package/system/fstools/files/fstab.init
+++ b/package/system/fstools/files/fstab.init
@@ -4,11 +4,11 @@
 START=40
 
 start() {
-   echo this file has been obseleted. please call \/sbin/block mount\ 
directly
+   echo this file has been obsoleted. please call \/sbin/block mount\ 
directly
/sbin/block mount
 }
 
 stop() {
-   echo this file has been obseleted. please call \/sbin/block umount\ 
directly
+   echo this file has been obsoleted. please call \/sbin/block umount\ 
directly
/sbin/block umount
 }
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v3] ncm: add support to run via proto wwan

2015-07-07 Thread Aleksandr Kolesnik
Signed-off-by: Aleksandr Kolesnik ner...@gmail.com

 

--- a/package/network/utils/comgt/files/ncm.sh

+++ b/package/network/utils/comgt/files/ncm.sh

@@ -27,6 +27,8 @@ proto_ncm_setup() {

   local device apn auth username password pincode delay mode

   json_get_vars device apn auth username password pincode delay
mode

+  [ -n $ctl_device ]  device=$ctl_device

+  

   [ -n $device ] || {

   echo No control device specified

   proto_notify_error $interface NO_DEVICE

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


Re: [OpenWrt-Devel] Change Default Configuration

2015-07-07 Thread Lars Kruse
Hi John,

 I am able to change the settings in the file under overlay and settings
 will get change, but when i do factory reset from GUI, All the changes i
 have done in script file will go.

I guess that the uci-defaults mechanism could be the right approach for you:
 https://wiki.openwrt.org/doc/uci#defaults

cheers,
Lars
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] base-files: implemented basic GPIO control

2015-07-07 Thread Lars Kruse
Internal GPIO pins are used for PoE passthrough setups in multi-port
routers. This patch implemnets control over this hardware feature for
Ubiquiti Nanostations and TP-Link CPE510.

Signed-off-by: Lars Kruse li...@sumpfralle.de
---
 package/base-files/files/etc/init.d/gpio_switch| 42 ++
 .../base-files/files/lib/functions/uci-defaults.sh | 24 +
 .../base-files/etc/uci-defaults/01_gpio-switches   | 25 +
 3 files changed, 91 insertions(+)
 create mode 100755 package/base-files/files/etc/init.d/gpio_switch
 create mode 100644 
target/linux/ar71xx/base-files/etc/uci-defaults/01_gpio-switches

diff --git a/package/base-files/files/etc/init.d/gpio_switch 
b/package/base-files/files/etc/init.d/gpio_switch
new file mode 100755
index 000..1f1b44b
--- /dev/null
+++ b/package/base-files/files/etc/init.d/gpio_switch
@@ -0,0 +1,42 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2015 OpenWrt.org
+
+START=98
+STOP=10
+USE_PROCD=1
+
+
+load_gpio_switch()
+{
+   local name
+   local gpio_pin
+   local value
+
+   config_get gpio_pin $1 gpio_pin
+   config_get name $1 name
+   config_get value $1 value 0
+
+   local gpio_path=/sys/class/gpio/gpio${gpio_pin}
+   # export GPIO pin for access
+   [ -d $gpio_path ] || {
+   echo $gpio_pin /sys/class/gpio/export
+   # we need to wait a bit until the GPIO appears
+   [ -d $gpio_path ] || sleep 1
+   echo out $gpio_path/direction
+   }
+   # write 0 or 1 to the value field
+   { [ $value = 0 ]  echo 0 || echo 1; } $gpio_path/value
+}
+
+service_triggers()
+{
+   procd_add_reload_trigger system
+}
+
+start_service()
+{
+   [ -e /sys/class/gpio/ ]  {
+   config_load system
+   config_foreach load_gpio_switch gpio_switch
+   }
+}
diff --git a/package/base-files/files/lib/functions/uci-defaults.sh 
b/package/base-files/files/lib/functions/uci-defaults.sh
index 5a8809d..6577ecd 100644
--- a/package/base-files/files/lib/functions/uci-defaults.sh
+++ b/package/base-files/files/lib/functions/uci-defaults.sh
@@ -2,6 +2,7 @@
 # Copyright (C) 2011 OpenWrt.org
 
 UCIDEF_LEDS_CHANGED=0
+UCIDEF_GPIO_SWITCHES_CHANGED=0
 
 ucidef_set_led_netdev() {
local cfg=led_$1
@@ -180,6 +181,29 @@ ucidef_commit_leds()
[ $UCIDEF_LEDS_CHANGED = 1 ]  uci commit system
 }
 
+ucidef_set_gpio_switch() {
+   local cfg=gpio_switch_$1
+   local name=$2
+   local gpio_pin=$3
+   # use 0 as default value
+   local default=${4:-0}
+
+   uci -q get system.$cfg  return 0
+
+   uci batch EOF
+set system.$cfg='gpio_switch'
+set system.$cfg.name='$name'
+set system.$cfg.gpio_pin='$gpio_pin'
+set system.$cfg.value='$default'
+EOF
+   UCIDEF_GPIO_SWITCHES_CHANGED=1
+}
+
+ucidef_commit_gpio_switches()
+{
+   [ $UCIDEF_GPIO_SWITCHES_CHANGED = 1 ]  uci commit system
+}
+
 ucidef_set_interface_loopback() {
uci batch EOF
 set network.loopback='interface'
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_gpio-switches 
b/target/linux/ar71xx/base-files/etc/uci-defaults/01_gpio-switches
new file mode 100644
index 000..81d3982
--- /dev/null
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_gpio-switches
@@ -0,0 +1,25 @@
+#!/bin/sh
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+
+. /lib/functions/uci-defaults.sh
+. /lib/ar71xx.sh
+
+board=$(ar71xx_board_name)
+
+case $board in
+nanostation-m)
+   ucidef_set_gpio_switch poe_passthrough PoE Passthrough 2
+   ;;
+nanostation-m-xw)
+   ucidef_set_gpio_switch poe_passthrough PoE Passthrough 8
+   ;;
+cpe510)
+   ucidef_set_gpio_switch poe_passthrough PoE Passthrough 20
+   ;;
+esac
+
+ucidef_commit_gpio_switches
+
+exit 0
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] [RESUBMIT] Support Linksys WAP-4410N

2015-07-07 Thread John Crispin
Hi,

sorry for the delay. patch no longer applies please rebase it and send
it again

John

On 27/04/2015 09:27, Caleb James DeLisle wrote:
 I noticed the patch was not applying to the recent master so I reworked it to
 add a new patch to the patchset against the kernel rather than patching the 
 patch
 which was ugly (and proved to be brittle).
 
 This patch has a checkpatch.pl issue but it's trailing whitespace in the 
 patch which
 it adds and it's not from me.
 
 As stated before, there's no way to locate the new larger kernel where the 
 old one
 was so upgrading from factory firmware without uart is basically a 
 non-starter but
 sysupgrade works (*worked, I will write a confirmation email as soon as I have
 double-checked the rework of the patch but nothing functional was changed.)
 
 Finally I didn't send this as a reply because I'm new to mailing patches and
 paranoid about breaking an inline patch.
 
 Thanks,
 Caleb
 
 
 Signed-off-by: Caleb James DeLisle c...@cjdns.fr
 
 diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
 b/target/linux/ar71xx/base-files/etc/diag.sh
 index d702d45..f268fe4 100644
 --- a/target/linux/ar71xx/base-files/etc/diag.sh
 +++ b/target/linux/ar71xx/base-files/etc/diag.sh
 @@ -305,6 +305,9 @@ get_status_led() {
   wrt400n)
   status_led=wrt400n:blue:wps
   ;;
 + wap4410n)
 + status_led=wrt4410n:green:power
 + ;;
   wrt160nl)
   status_led=wrt160nl:blue:wps
   ;;
 diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
 b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
 index f5c6865..7f163d6 100644
 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
 +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
 @@ -338,6 +338,7 @@ tl-wa901nd-v3 |\
  tl-wr703n |\
  tube2h |\
  wndap360 |\
 +wap4410n |\
  mynet-rext |\
  wp543)
   ucidef_set_interface_lan eth0
 diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
 b/target/linux/ar71xx/base-files/lib/ar71xx.sh
 index 645c5d9..a64a3bd 100755
 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
 +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
 @@ -849,6 +849,9 @@ ar71xx_board_detect() {
   *WRT400N)
   name=wrt400n
   ;;
 + *WAP4410N)
 + name=wap4410n
 + ;;
   *WZR-450HP2)
   name=wzr-450hp2
   ;;
 diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
 b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
 index a8cec91..33d3a58 100755
 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
 +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
 @@ -228,6 +228,7 @@ platform_check_image() {
   rocket-m-xw | \
   nanostation-m-xw | \
   rw2458n | \
 + wap4410n | \
   wndap360 | \
   wzr-hp-g300nh2 | \
   wzr-hp-g300nh | \
 diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18
 index 36b8bb6..87b8162 100644
 --- a/target/linux/ar71xx/config-3.18
 +++ b/target/linux/ar71xx/config-3.18
 @@ -140,6 +140,7 @@ CONFIG_ATH79_MACH_WPJ344=y
  CONFIG_ATH79_MACH_WPJ558=y
  CONFIG_ATH79_MACH_WRT160NL=y
  CONFIG_ATH79_MACH_WRT400N=y
 +CONFIG_ATH79_MACH_WAP4410N=y
  CONFIG_ATH79_MACH_WZR_450HP2=y
  CONFIG_ATH79_MACH_WZR_HP_AG300H=y
  CONFIG_ATH79_MACH_WZR_HP_G300NH=y
 diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-wap4410n.c 
 b/target/linux/ar71xx/files/arch/mips/ath79/mach-wap4410n.c
 new file mode 100644
 index 000..15bd12b
 --- /dev/null
 +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-wap4410n.c
 @@ -0,0 +1,279 @@
 +/*
 + *  Cisco WAP4410N board support
 + *
 + *  Copyright (C) 2014 Caleb James DeLisle c...@cjdns.fr
 + *
 + *  This program is free software; you can redistribute it and/or modify it
 + *  under the terms of the GNU General Public License version 2 as published
 + *  by the Free Software Foundation, or (at your option) any later version.
 + */
 +#include linux/platform_device.h
 +#include linux/mtd/mtd.h
 +#include linux/mtd/partitions.h
 +#include linux/mtd/physmap.h
 +#include linux/nxp_74hc153.h
 +
 +#include asm/mach-ath79/ath79.h
 +
 +#include dev-eth.h
 +#include dev-gpio-buttons.h
 +#include dev-leds-gpio.h
 +#include dev-usb.h
 +#include dev-wmac.h
 +#include machtypes.h
 +
 +/* -- begin flash device -- */
 +
 +#define FLASH_BASE 0xbf00
 +
 +/* where the actual art data is within the art partition. */
 +#define ART_DATA_OFFSET 0x1000
 +
 +/* If changed, make sure to change image/Makefile too! */
 +#define KERN_SIZE 0x19
 +
 +/* Flash layout: u-boot/include/upgrade.h in cisco's GPL dump */
 +#define FLASH_SIZE   (0x80)
 +#define BOOT_SIZE(0x4)
 +#define NVRAM_SIZE   (0x1)
 +#define ART_SIZE (0x1)
 +#define ENV_SIZE (0x1)
 +
 +#define 

Re: [OpenWrt-Devel] Patch to enable RFKill and USB Power GPIO for tl-wdr4900v1

2015-07-07 Thread John Crispin
Hi,

the subject is missing the prefix and the Signed-off-by line is missing.
Please fix and resend.

John

On 28/06/2015 07:45, Alpha Sparc wrote:
 Add dts patch to enable RFKill and USB Power GPIO Control
 
 --- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts
 +++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts
 @@ -198,6 +198,11 @@
  gpios = gpio0 4 1; /* active low */
  label = tp-link:green:usb2;
  };
 +
 +usbpower {
 +gpios = gpio0 10 1; /* active low */
 +label = tp-link:usb:power;
 +};
  };
 
  buttons {
 @@ -208,6 +213,12 @@
  gpios = gpio0 5 1; /* active low */
  linux,code = 0x198; /* KEY_RESTART */
  };
 +
 +rfkill {
 +label = RFKILL switch;
 +gpios = gpio0 11 1; /* active low */
 +linux,code = 0xf7; /* RFKill */
 +};
  };
  };
 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ar71xx: Add support for The QCA AP147-010 reference board

2015-07-07 Thread John Crispin
Hi,

please split this into 1 patch for each QCA953x fix
and then a final patch for the ap147 support

John

On 29/06/2015 17:25, Sven Eckelmann wrote:
 Signed-off-by: Sven Eckelmann s...@open-mesh.com
 ---
 I got the chance to test the AP147-010 but got no software/SDK or 
 documentation.
 Still wanted to post my results because the device worked well enough for me.
 I am not sure if it originally comes with a PCIe card (I've used at QCA9880
 based one for my tests).
 
 Most of the SoC relevant code is based on the QCA955x implementation.
 
 
  target/linux/ar71xx/base-files/etc/diag.sh |   3 +
  .../ar71xx/base-files/etc/uci-defaults/01_leds |   9 ++
  .../ar71xx/base-files/etc/uci-defaults/02_network  |   7 +
  target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
  .../lib/preinit/05_set_preinit_iface_ar71xx|   1 +
  .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
  target/linux/ar71xx/config-3.18|   1 +
  .../ar71xx/files/arch/mips/ath79/mach-ap147.c  | 119 
  target/linux/ar71xx/generic/profiles/atheros.mk|  11 ++
  target/linux/ar71xx/image/Makefile |   3 +
  target/linux/ar71xx/mikrotik/config-default|   1 +
  target/linux/ar71xx/nand/config-default|   1 +
  .../740-MIPS-ath79-add-PCI-for-QCA953x-SoC.patch   | 158 
 +
  .../741-MIPS-ath79-add-USB-for-QCA953x-SoC.patch   |  56 
  .../742-MIPS-ath79-add-ap147-support.patch |  42 ++
  15 files changed, 416 insertions(+)
  create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-ap147.c
  create mode 100644 
 target/linux/ar71xx/patches-3.18/740-MIPS-ath79-add-PCI-for-QCA953x-SoC.patch
  create mode 100644 
 target/linux/ar71xx/patches-3.18/741-MIPS-ath79-add-USB-for-QCA953x-SoC.patch
  create mode 100644 
 target/linux/ar71xx/patches-3.18/742-MIPS-ath79-add-ap147-support.patch
 
 diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
 b/target/linux/ar71xx/base-files/etc/diag.sh
 index 4313f2f..169d192 100644
 --- a/target/linux/ar71xx/base-files/etc/diag.sh
 +++ b/target/linux/ar71xx/base-files/etc/diag.sh
 @@ -22,6 +22,9 @@ get_status_led() {
   ap136-020)
   status_led=ap136:green:status
   ;;
 + ap147-010)
 + status_led=ap147:green:status
 + ;;
   ap135-020)
   status_led=ap135:green:status
   ;;
 diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds 
 b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
 index 3cd17b1..1d4f88d 100644
 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
 +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
 @@ -40,6 +40,15 @@ ap113)
   ucidef_set_led_usbdev usb USB ap113:green:usb 1-1
   ;;
  
 +ap147-010)
 + ucidef_set_led_netdev wan WAN ap147:green:wan eth1
 + ucidef_set_led_switch lan1 LAN1 ap147:green:lan1 switch0 0x10
 + ucidef_set_led_switch lan2 LAN2 ap147:green:lan2 switch0 0x08
 + ucidef_set_led_switch lan3 LAN3 ap147:green:lan3 switch0 0x04
 + ucidef_set_led_switch lan4 LAN4 ap147:green:lan4 switch0 0x02
 + ucidef_set_led_wlan wlan2g WLAN 2.4 GHz ap147:green:wlan-2g 
 phy0tpt
 + ;;
 +
  bullet-m | \
  nanostation-m | \
  rocket-m | \
 diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
 b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
 index 2fab4c2..1b39d2a 100644
 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
 +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
 @@ -45,6 +45,13 @@ ap136-010)
   ucidef_add_switch_vlan switch0 2 5 6
   ;;
  
 +ap147-010)
 + ucidef_set_interfaces_lan_wan eth0 eth1
 + ucidef_add_switch switch0 1 1
 + ucidef_add_switch_vlan switch0 1 0 1 2 3 4
 + ucidef_add_switch_vlan switch0 2 5 6
 + ;;
 +
  ap136-020 |\
  ap135-020 |\
  tl-wr1043nd-v2 |\
 diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
 b/target/linux/ar71xx/base-files/lib/ar71xx.sh
 index 09c06d7..85aeda0 100755
 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
 +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
 @@ -359,6 +359,9 @@ ar71xx_board_detect() {
   *AP135-020 reference board)
   name=ap135-020
   ;;
 + *AP147-010 reference board)
 + name=ap147-010
 + ;;
   *AP81)
   name=ap81
   ;;
 diff --git 
 a/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx 
 b/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx
 index f11ea8c..d214e9b 100644
 --- a/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx
 +++ b/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx
 @@ -12,6 +12,7 @@ set_preinit_iface() {
   alfa-nx |\
   ap135-020 |\
   ap136-020 |\
 + ap147-010 |\
   ap83 |\
   archer-c5 |\
   archer-c7 |\

Re: [OpenWrt-Devel] [PATCH v2] ncm: add support to run via proto wwan

2015-07-07 Thread John Crispin
Hi,

patch is generated against the wrong root folder. also your mail client
replaced tabs with spaces. please fix and resend the patch

John

On 22/04/2015 15:26, Aleksandr Kolesnik wrote:
 Signed-off-by: Aleksandr Kolesnik ner...@gmail.com
 mailto:ner...@gmail.com
 
 --- package/network/utils/comgt/files/ncm.sh
 +++ package/network/utils/comgt/files/ncm.sh
 @@ -27,6 +27,8 @@ proto_ncm_setup() {
  local device apn auth username password pincode delay mode
  json_get_vars device apn auth username password pincode delay mode
  
 +[ -n $ctl_device ]  device=$ctl_device
 +
  [ -n $device ] || {
  echo No control device specified
  proto_notify_error $interface NO_DEVICE
 
 
 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] busybox: replace hotfix with upstream commit de5edadee2dca2896492f97ab3a56e389305e74d

2015-07-07 Thread John Crispin
when applying the patch i get

patching file
package/utils/busybox/patches/290-ash-fix-a-regression-in-handling-local-variables.patch
patching file
package/utils/busybox/patches/290-ash-fix-handling-of-duplicate-local.patch
patch:  malformed patch at line 301: --





On 23/04/2015 13:22, Bastian Bittorf wrote:
 with this patch the hotfix from r45471 is replaced.
 
 compile and runtested with ar71xx / r45568
 
 the file 'shell/ash_test/ash-heredoc/heredoc1.right' is
 not included, because it does not apply on our busybox.
 when upgrading to next busybox-release, this patch can be dropped.
 
 Signed-off-by: Bastian Bittorf bitt...@bluebottle.com
 ---
  ...-a-regression-in-handling-local-variables.patch |   75 ---
  .../290-ash-fix-handling-of-duplicate-local.patch  |  204 
 
  2 files changed, 204 insertions(+), 75 deletions(-)
  delete mode 100644 
 package/utils/busybox/patches/290-ash-fix-a-regression-in-handling-local-variables.patch
  create mode 100644 
 package/utils/busybox/patches/290-ash-fix-handling-of-duplicate-local.patch
 
 diff --git 
 a/package/utils/busybox/patches/290-ash-fix-a-regression-in-handling-local-variables.patch
  
 b/package/utils/busybox/patches/290-ash-fix-a-regression-in-handling-local-variables.patch
 deleted file mode 100644
 index 0ac1925..000
 --- 
 a/package/utils/busybox/patches/290-ash-fix-a-regression-in-handling-local-variables.patch
 +++ /dev/null
 @@ -1,75 +0,0 @@
 -From: Felix Fietkau n...@openwrt.org
 -Date: Fri, 17 Apr 2015 01:54:51 +0200
 -Subject: [PATCH] ash: fix a regression in handling local variables
 -
 -commit 109ee5d33694a03cda3424b4846584250832ba8e
 -ash: make locak VAR unset VAR (bash does that)
 -
 -This commit introduced a regression where calling local on an already
 -local variable unsets it. This does not match bash behavior.
 -
 -Update test case to check for this behavior
 -
 -Signed-off-by: Felix Fietkau n...@openwrt.org
 
 -
  a/shell/ash.c
 -+++ b/shell/ash.c
 -@@ -8961,6 +8961,21 @@ parse_command_args(char **argv, const ch
 - }
 - #endif
 - 
 -+static bool
 -+findlocal(struct var *vp)
 -+{
 -+struct localvar *lvp = localvars;
 -+
 -+while (lvp) {
 -+if (lvp-vp == vp)
 -+return true;
 -+
 -+lvp = lvp-next;
 -+}
 -+
 -+return false;
 -+}
 -+
 - /*
 -  * Make a variable a local variable.  When a variable is made local, it's
 -  * value and flags are saved in a localvar structure.  The saved values
 -@@ -9000,7 +9015,7 @@ mklocal(char *name)
 - vp-flags |= VSTRFIXED|VTEXTFIXED;
 - if (eq)
 - setvareq(name, 0);
 --else
 -+else if (!findlocal(vp))
 - /* local VAR unsets VAR: */
 - setvar(name, NULL, 0);
 - }
  a/shell/ash_test/ash-misc/local1.right
 -+++ b/shell/ash_test/ash-misc/local1.right
 -@@ -1,4 +1,5 @@
 - A1:'A'
 - A2:''
 --A3:''
 --A4:'A'
 -+A3:'B'
 -+A4:''
 -+A5:'A'
  a/shell/ash_test/ash-misc/local1.tests
 -+++ b/shell/ash_test/ash-misc/local1.tests
 -@@ -3,9 +3,12 @@ f() {
 - local a
 - # the above line unsets $a
 - echo A2:'$a'
 --unset a
 -+a=B
 -+local a
 - echo A3:'$a'
 -+unset a
 -+echo A4:'$a'
 - }
 - echo A1:'$a'
 - f
 --echo A4:'$a'
 -+echo A5:'$a'
 diff --git 
 a/package/utils/busybox/patches/290-ash-fix-handling-of-duplicate-local.patch 
 b/package/utils/busybox/patches/290-ash-fix-handling-of-duplicate-local.patch
 new file mode 100644
 index 000..71c2162
 --- /dev/null
 +++ 
 b/package/utils/busybox/patches/290-ash-fix-handling-of-duplicate-local.patch
 @@ -0,0 +1,204 @@
 +From 0a0acb55db8d7c4dec445573f1b0528d126b9e1f Mon Sep 17 00:00:00 2001
 +From: Denys Vlasenko vda.li...@googlemail.com
 +Date: Sat, 18 Apr 2015 19:36:38 +0200
 +Subject: [PATCH] ash: fix handling of duplicate local
 +
 +Signed-off-by: Denys Vlasenko vda.li...@googlemail.com
 +---
 + shell/ash.c   | 51 
 +--
 + shell/ash_test/ash-vars/var3.right|  5 +++
 + shell/ash_test/ash-vars/var3.tests|  1 +
 + 4 files changed, 42 insertions(+), 17 deletions(-)
 + create mode 100644 shell/ash_test/ash-vars/var3.right
 + create mode 100755 shell/ash_test/ash-vars/var3.tests
 +
 +diff --git a/shell/ash.c b/shell/ash.c
 +index b568013..697a64f 100644
 +--- a/shell/ash.c
  b/shell/ash.c
 +@@ -2030,7 +2030,7 @@ varcmp(const char *p, const char *q)
 + int c, d;
 + 
 + while ((c = *p) == (d = *q)) {
 +-if (!c || c == '=')
 ++if (c == '\0' || c == '=')
 + goto out;
 + p++;
 + q++;
 +@@ -2247,7 +2247,7 @@ setvar(const char *name, const char *val, int flags)
 + }
 + 
 + static void FAST_FUNC
 +-setvar2(const char *name, const char *val)
 ++setvar0(const char *name, const char *val)
 + {
 + setvar(name, 

Re: [OpenWrt-Devel] [PATCH] ar71xx: add support for D-Link DIR-615 rev. Ix board

2015-07-07 Thread John Crispin
Hi,

sorry patch no longer applies. could you rebase it and then send it
again please ?

John

On 18/04/2015 06:52, Jaehoon You wrote:
 Signed-off-by: Jaehoon You teslam...@gmail.com
 ---
  target/linux/ar71xx/base-files/etc/diag.sh |   1 +
  .../ar71xx/base-files/etc/uci-defaults/01_leds |   8 ++
  .../ar71xx/base-files/etc/uci-defaults/02_network  |   0
  target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
  .../base-files/lib/preinit/05_set_iface_mac_ar71xx |   3 +
  .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
  target/linux/ar71xx/config-3.18|   1 +
  .../ar71xx/files/arch/mips/ath79/mach-dir-615-i1.c | 141 
 +
  target/linux/ar71xx/generic/profiles/d-link.mk |  10 ++
  target/linux/ar71xx/image/Makefile |   9 ++
  .../610-MIPS-ath79-openwrt-machines.patch  |  25 +++-
  11 files changed, 196 insertions(+), 6 deletions(-)
  mode change 100644 = 100755 
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network
  create mode 100644 
 target/linux/ar71xx/files/arch/mips/ath79/mach-dir-615-i1.c
 
 diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
 b/target/linux/ar71xx/base-files/etc/diag.sh
 index 52a73ee..07b1769 100644
 --- a/target/linux/ar71xx/base-files/etc/diag.sh
 +++ b/target/linux/ar71xx/base-files/etc/diag.sh
 @@ -54,6 +54,7 @@ get_status_led() {
   dir-505-a1 |\
   dir-600-a1 |\
   dir-615-e1 |\
 + dir-615-i1 |\
   dir-615-e4)
   status_led=d-link:green:power
   ;;
 diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds 
 b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
 index 787523a..aff8f1f 100644
 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
 +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
 @@ -139,6 +139,14 @@ dir-825-b1)
   ucidef_set_led_usbdev usb USB d-link:blue:usb 1-1
   ;;
  
 +dir-615-i1)
 + ucidef_set_led_default power POWER d-link:green:power 1
 + ucidef_set_led_default diag DIAG d-link:amber:power 0
 + ucidef_set_led_default wps WPS d-link:blue:wps 0
 + ucidef_set_led_netdev wan WAN d-link:green:wan eth0
 + ucidef_set_led_wlan wlan WLAN d-link:green:wlan phy0tpt
 + ;;
 +
  dir-825-c1)
   ucidef_set_led_usbdev usb USB d-link:blue:usb 1-1
   ucidef_set_led_wlan wlan2g WLAN 2.4 GHz d-link:blue:wlan2g 
 phy0tpt
 diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
 b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
 old mode 100644
 new mode 100755
 diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
 b/target/linux/ar71xx/base-files/lib/ar71xx.sh
 index b3dbcf5..3e4453d 100755
 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
 +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
 @@ -398,6 +398,9 @@ ar71xx_board_detect() {
   *DIR-615 rev. E4)
   name=dir-615-e4
   ;;
 + *DIR-615 rev. I1)
 + name=dir-615-i1
 + ;;
   *DIR-825 rev. B1)
   name=dir-825-b1
   ;;
 diff --git 
 a/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx 
 b/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx
 index b40dff5..c39169a 100644
 --- a/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx
 +++ b/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx
 @@ -29,6 +29,9 @@ preinit_set_mac_address() {
   fetch_mac_from_mtd config lan_mac wan_mac
   echo 1  
 /sys/class/leds/dir-615-c1:green:wancpu/brightness
   ;;
 + dir-615-i1)
 + fetch_mac_from_mtd nvram sys_lan_mac sys_wan_mac
 + ;;
   r6100)
   mac_lan=$(mtd_get_mac_binary caldata 0)
   [ -n $mac_lan ]  ifconfig eth1 hw ether $mac_lan
 diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
 b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
 index 0cbee1d..4899f78 100755
 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
 +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
 @@ -203,6 +203,7 @@ platform_check_image() {
   dir-615-c1 | \
   dir-615-e1 | \
   dir-615-e4 | \
 + dir-615-i1 | \
   dir-825-c1 | \
   dir-835-a1 | \
   dragino2 | \
 diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18
 index 1ee99f4..6374c54 100644
 --- a/target/linux/ar71xx/config-3.18
 +++ b/target/linux/ar71xx/config-3.18
 @@ -50,6 +50,7 @@ CONFIG_ATH79_MACH_DHP_1565_A1=y
  CONFIG_ATH79_MACH_DIR_505_A1=y
  CONFIG_ATH79_MACH_DIR_600_A1=y
  CONFIG_ATH79_MACH_DIR_615_C1=y
 +CONFIG_ATH79_MACH_DIR_615_I1=y
  CONFIG_ATH79_MACH_DIR_825_B1=y
  CONFIG_ATH79_MACH_DIR_825_C1=y
  CONFIG_ATH79_MACH_DRAGINO2=y
 diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-615-i1.c 
 

[OpenWrt-Devel] please backport to 15-05: scripts/feeds: observe -p flag for preferential feeds

2015-07-07 Thread Karl Palsson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Please backport 52c3a2972cf7cdd7184e8d60d684df459860d255 to the 15-05
branch. This is a regression from 14.07 and 12.10, but missed being
merged before the branch was pulled.

Sincerely,
Karl Palsson

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)

iQIcBAEBAgAGBQJVm7V4AAoJEBmotQ/U1cr2mX8P/i3268wEodg1AShYLrFwCmVU
ZNIAS7rLI9XcSEmk/qgtz91XnSPXmgcbzQqikK7A373Z7WaHZaOJBjSwL1EOZdaM
B/uyLU5MWHOPK/6auaUV4rMQ2HeMJXYyJLsVTfgvBDSr13/hQM7skw14j4Ve3GRh
T81blBQfRUrhQq/ij4HFA5C0QTpm/fkvzVbw0RyYE3SHHTy/bOQ/5HCitmv9DPc3
N9FPhbqGkqzhr+F8wT13ehFHI60ePeXxt88fTJctvGjvz1APxTNOM61lV143h26d
MqvQ4yi8h/gL0f5rj7BkkiB72FYeZsiLHSc0kfLyInat32Sw4cIammzlquXj71hh
wxjPJvO3hbVqLfZBghH696sFI2k3/D69FDb5bwEQFJZutLtwaAyg+4m3FYf6FM62
dwAgMosP29n7zatu95Jx6E768veoSZ4OukmbtWryQVdmswDbNm3Ii93jubhBbn3r
sbhvfgkuJ5qE0Sr9megzvMQxBuGNE7JJEAsJNqGOhLzH2mHA8W3VW/TMxthghUIP
5njpILMRRDRxZz8uN8qdaMtSx5OZSsX1DZ+pkgU+/v9YefD8i5OM1jnbT5F5uoTP
sdfp6b90Ls9tIQ64JieqzarsP2bCRfsWaU9DCpLQlAW7f7t/QsJz2rqK/ojApNAk
alS1U3X5PhRWAZwqSBGb
=+o1F
-END PGP SIGNATURE-
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ramips: fix typo in WHR1166D mtd size variable

2015-07-07 Thread Lorenzo Bianconi
Fix typo in WHR1166D mtd size variable

Signed-off-by: Lorenzo Bianconi lorenzo.biancon...@gmail.com
---
 target/linux/ramips/image/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/ramips/image/Makefile 
b/target/linux/ramips/image/Makefile
index 776920b..0c28216 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -859,7 +859,7 @@ whr_300hp2_mtd_size=7012352
 Image/Build/Profile/WHR300HP2=$(call 
BuildFirmware/CustomFlash/$(1),$(1),whr-300hp2,WHR-300HP2,$(whr_300hp2_mtd_size))
 Image/Build/Profile/WHR600D=$(call 
BuildFirmware/CustomFlash/$(1),$(1),whr-600d,WHR-600D,$(whr_300hp2_mtd_size))
 whr_1166d_mtd_size=15400960
-Image/Build/Profile/WHR1166D=$(call 
BuildFirmware/CustomFlash/$(1),$(1),whr-1166d,WHR-1166D,$(whr_1166hd_mtd_size))
+Image/Build/Profile/WHR1166D=$(call 
BuildFirmware/CustomFlash/$(1),$(1),whr-1166d,WHR-1166D,$(whr_1166d_mtd_size))
 dlink810l_mtd_size=6881280
 Image/Build/Profile/CF-WR800N=$(call 
BuildFirmware/Default8M/$(1),$(1),cf-wr800n,CF-WR800N)
 Image/Build/Profile/DIR-810L=$(call 
BuildFirmware/CustomFlash/$(1),$(1),dir-810l,DIR-810L,$(dlink810l_mtd_size))
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ramips: adding support for OY-0001 Wireless Router

2015-07-07 Thread John Crispin
Hi,

unfortunatley your patch is against an old version of the tree

On 06/07/2015 09:24, LiWeijian wrote:
 diff --git a/target/linux/ramips/base-files/etc/uci-defaults/01_leds 
 b/target/linux/ramips/base-files/etc/uci-defaults/01_leds
 index 5d6ed2b..265525a 100755
 --- a/target/linux/ramips/base-files/etc/uci-defaults/01_leds
 +++ b/target/linux/ramips/base-files/etc/uci-defaults/01_leds

this file no longer exists in the tree. the functionality was moved to
/etc/board.d/*. can you please resend a version against current HEAD

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


Re: [OpenWrt-Devel] Huawei 3372 NCM support on CC not working

2015-07-07 Thread chrono
As there seem to be more than just minor differences between the 3372H 
and the 3372S,
here is what I could query from the 3372s I have here. Maybe it is 
useful infor for someone.
The stick is available, so if you need more info/queries/tests just give 
me a ping

here or in #openwrt-devel.



rundown of commands from
http://www.lteforum.at/mobilfunk/at-command-execution-fuer-huawei-sticks.2235/

ATI
Manufacturer: huawei
Model: E3372
Revision: 21.297.05.01.55
IMEI: X
+GCAP: +CGSM,+DS,+ES

AT^HVER
^HVER:CL1E3372SM

AT^FHVER
^FHVER:E3372S-153 21.297.05.01.55,CL1E3372SM Ver.A

AT^VERSION?
^VERSION:BDT:Oct 14 2014, 18:22:29
^VERSION:EXTS:21.297.05.01.55
^VERSION:INTS:
^VERSION:EXTD:UTPS22.001.19.05.55_MAC22.001.19.05.55
^VERSION:INTD:
^VERSION:EXTH:CL1E3372SM Ver.A
^VERSION:INTH:
^VERSION:EXTU:E3372
^VERSION:INTU:
^VERSION:CFG:1004
^VERSION:PRL:
^VERSION:OEM:
^VERSION:INI:

AT^SYSCFG?
^SYSCFG:14,2,3FFF,1,2

AT^SYSINFOEX
^SYSINFOEX:2,3,0,1,,6,LTE,101,LTE

AT+GMR
21.297.05.01.55

AT^VERTIME
^VERTIME:Oct 14 2014, 18:25:31

AT^DATALOCK?
^DATALOCK:1

AT^DLOADVER?
2.0

AT^DLOADINFO?
swver:21.297.05.01.55
isover:UTPS22.001.19.05.55_MAC22.001.19.05.55
product name:E3372
dload type:0

AT^FLASHINFO?
~~FLASH INFO~~:
MMC BLOCK COUNT:0, PAGE SIZE:0, PAGE COUNT PER BLOCK:0

AT^CHIPTEMP?
^CHIPTEMP: 420,420,65535,29,23

AT+COPS=?
+COPS: 
(2,E-Plus,E-Plus,26203,7),(1,E-Plus,E-Plus,26203,2),(3,Vodafone.de,Vodafone,26202,7),(3,Vodafone.de,Vodafone,26202,2),(3,Telekom.de,TDG,26201,7),(3,Telekom.de,TDG,26201,2),(3,o2 
- de,o2 - de,26207,2),,(0,1,2,3,4),(0,1,2)


AT+CGACT?   (ip?)
+CGACT: 1,1
+CGACT: 21,0
+CGACT: 22,0
+CGACT: 23,0
+CGACT: 24,0
+CGACT: 25,0
+CGACT: 26,0
+CGACT: 27,0
+CGACT: 28,0
+CGACT: 29,0
+CGACT: 30,0
+CGACT: 31,0


Playing with ports:

AT^SETPORT=?
^SETPORT:3: 3G DIAG
^SETPORT:10: 4G MODEM
^SETPORT:1: 3G MODEM
^SETPORT:12: 4G PCUI
^SETPORT:13: 4G DIAG
^SETPORT:5: 3G GPS\
^SETPORT:14: 4G GPS
^SETPORT:A: BLUE TOOTH
^SETPORT:16: NCM
^SETPORT:A1: CDROM
^SETPORT:A2: SD

AT^SETPORT?
^SETPORT:FF;10,12,16

Test for more vxworks debug options according to
http://4pda.ru/forum/index.php?showtopic=582284st=560

at^setport=FF;10,12,16,A2,5,A
OK
at^reset

crw-r--r--1 root root  188,   0 Jul  4 16:03 /dev/ttyUSB0
crw-r--r--1 root root  188,   1 Jul  4 16:03 /dev/ttyUSB1
crw-r--r--1 root root  188,   2 Jul  4 16:03 /dev/ttyUSB2
crw-r--r--1 root root  188,   3 Jul  4 16:03 /dev/ttyUSB3
crw-r--r--1 root root  180, 176 Jul  4 16:03 /dev/cdc-wdm0

ttyUSB0 - AT-port PPP-connections
ttyUSB1 - AT-port connections for NDIS-
ttyUSB2 - knosol Linux
ttyUSB3 - Console VxWorks
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Add for Planex MZK-DP150N

2015-07-07 Thread John Crispin
Hi,

a few things wrong with the patch

* please dont send HTML mails.
* send patches inline
* the ramips:  prefix is missing from the subject

Please fix and resend the patch

John

On 25/05/2015 16:01, @SRCHACK.ORG wrote:
 Hi,
 
 This patch adds support for Planex MZK-DP150N.
 a mini router on the MT7620A SoC with one Ethernet port and a 802.11n 2.4 GHz 
 radio.
 
 
 
 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ramips mt7620: ArcherC20i USB support and more

2015-07-07 Thread Jonas Gorski
Hi,

On Mon, Jul 6, 2015 at 11:56 PM, Gunnar Thorburn gun...@thorburn.se wrote:
 Hi,

 The patch (actually the entire file) was contributed on the OpenWrt forum:
 https://forum.openwrt.org/viewtopic.php?pid=281794#p281794
 My contribution is that I have tested it and that I am trying to submit it
 here.

 I can confirm that:
  1) My ArcherC20i works fine with the patch applied
  2) USB works (which it does not do in CC without the patch)

 If the changes not related to USB (ehci/ohci) are questionable, I would be
 happy to resubmit a patch for just USB. I am sorry about the spaces and
 tabs. The clean patch below looks much nicer.

I'm mostly looking for a description what this patch does. You already
mentioned enabling USB in the subject, but you should also mention the
buttons/leds. Please write a commit log as you would write a commit,
without any hello and 'byes. And finally you dropped your
sign-off-by.


   Gunnar T.


 $ diff -up target/linux/ramips/dts/ArcherC20i.dts{.orig,}
 --- target/linux/ramips/dts/ArcherC20i.dts.orig 2015-07-05
 15:27:04.763421748 +0200
 +++ target/linux/ramips/dts/ArcherC20i.dts  2015-07-06
 23:11:04.533094775 +0200
 @@ -15,6 +15,10 @@
 status = okay;
 };


Your email-client ate the spaces at the start of empty context lines,
this patch is broken.

 +   gpio3: gpio@688 {
 +   status = okay;
 +   };
 +

Wrong indentation.

 spi@b00 {
 status = okay;

 @@ -77,8 +81,12 @@
 ralink,port-map = w;
 };

 -   gsw@1011 {
 -   ralink,port4 = ephy;

Why are you removing this part?

 +   ehci@101c {
 +   status = okay;
 +   };
 +
 +   ohci@101c1000 {
 +   status = okay;
 };

 wmac@1018 {
 @@ -100,6 +108,18 @@

 gpio-leds {
 compatible = gpio-leds;

Empty line here please.

 +   lan {
 +   label = tp-link:blue:lan;
 +   gpios = gpio0 1 1;
 +   };

Wrong indentation. Also empty line here please.

 +   usb {
 +   label = tp-link:blue:usb;
 +   gpios = gpio0 11 1;
 +   };

Empty line here please.

 +   wlan {
 +   label = tp-link:blue:wlan;
 +   gpios = gpio3 0 1;
 +   };

Wrong indentation.

 };

 gpio-keys-polled {
 @@ -107,5 +127,15 @@
 #address-cells = 1;
 #size-cells = 0;
 poll-interval = 20;

Empty line here please.

 +   reset_wps {
 +   label = reset_wps;
 +   gpios = gpio0 13 1;
 +   linux,code = 0x198;
 +   };

Empty line here please.

 +   rfkill {
 +   label = rfkill;
 +   gpios = gpio0 2 1;
 +   linux,code = 0xf7;
 +   };
 };
  };


Please fix and resend.


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


Re: [OpenWrt-Devel] [PATCH] implemented basic GPIO control

2015-07-07 Thread John Crispin
Hi Lars,

patch subject is missing the base-files:  prefix. please fix and
resend. rest of the patch looks fine.

John


On 01/07/2015 02:49, Lars Kruse wrote:
 Internal GPIO pins are used for PoE passthrough setups in multi-port
 routers. This patch implemnets control over this hardware feature for
 Ubiquiti Nanostations and TP-Link CPE510.
 
 Signed-off-by: Lars Kruse li...@sumpfralle.de
 ---
  package/base-files/files/etc/init.d/gpio_switch| 42 
 ++
  .../base-files/files/lib/functions/uci-defaults.sh | 24 +
  .../base-files/etc/uci-defaults/01_gpio-switches   | 25 +
  3 files changed, 91 insertions(+)
  create mode 100755 package/base-files/files/etc/init.d/gpio_switch
  create mode 100644 
 target/linux/ar71xx/base-files/etc/uci-defaults/01_gpio-switches
 
 diff --git a/package/base-files/files/etc/init.d/gpio_switch 
 b/package/base-files/files/etc/init.d/gpio_switch
 new file mode 100755
 index 000..1f1b44b
 --- /dev/null
 +++ b/package/base-files/files/etc/init.d/gpio_switch
 @@ -0,0 +1,42 @@
 +#!/bin/sh /etc/rc.common
 +# Copyright (C) 2015 OpenWrt.org
 +
 +START=98
 +STOP=10
 +USE_PROCD=1
 +
 +
 +load_gpio_switch()
 +{
 + local name
 + local gpio_pin
 + local value
 +
 + config_get gpio_pin $1 gpio_pin
 + config_get name $1 name
 + config_get value $1 value 0
 +
 + local gpio_path=/sys/class/gpio/gpio${gpio_pin}
 + # export GPIO pin for access
 + [ -d $gpio_path ] || {
 + echo $gpio_pin /sys/class/gpio/export
 + # we need to wait a bit until the GPIO appears
 + [ -d $gpio_path ] || sleep 1
 + echo out $gpio_path/direction
 + }
 + # write 0 or 1 to the value field
 + { [ $value = 0 ]  echo 0 || echo 1; } $gpio_path/value
 +}
 +
 +service_triggers()
 +{
 + procd_add_reload_trigger system
 +}
 +
 +start_service()
 +{
 + [ -e /sys/class/gpio/ ]  {
 + config_load system
 + config_foreach load_gpio_switch gpio_switch
 + }
 +}
 diff --git a/package/base-files/files/lib/functions/uci-defaults.sh 
 b/package/base-files/files/lib/functions/uci-defaults.sh
 index 5a8809d..6577ecd 100644
 --- a/package/base-files/files/lib/functions/uci-defaults.sh
 +++ b/package/base-files/files/lib/functions/uci-defaults.sh
 @@ -2,6 +2,7 @@
  # Copyright (C) 2011 OpenWrt.org
  
  UCIDEF_LEDS_CHANGED=0
 +UCIDEF_GPIO_SWITCHES_CHANGED=0
  
  ucidef_set_led_netdev() {
   local cfg=led_$1
 @@ -180,6 +181,29 @@ ucidef_commit_leds()
   [ $UCIDEF_LEDS_CHANGED = 1 ]  uci commit system
  }
  
 +ucidef_set_gpio_switch() {
 + local cfg=gpio_switch_$1
 + local name=$2
 + local gpio_pin=$3
 + # use 0 as default value
 + local default=${4:-0}
 +
 + uci -q get system.$cfg  return 0
 +
 + uci batch EOF
 +set system.$cfg='gpio_switch'
 +set system.$cfg.name='$name'
 +set system.$cfg.gpio_pin='$gpio_pin'
 +set system.$cfg.value='$default'
 +EOF
 + UCIDEF_GPIO_SWITCHES_CHANGED=1
 +}
 +
 +ucidef_commit_gpio_switches()
 +{
 + [ $UCIDEF_GPIO_SWITCHES_CHANGED = 1 ]  uci commit system
 +}
 +
  ucidef_set_interface_loopback() {
   uci batch EOF
  set network.loopback='interface'
 diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_gpio-switches 
 b/target/linux/ar71xx/base-files/etc/uci-defaults/01_gpio-switches
 new file mode 100644
 index 000..81d3982
 --- /dev/null
 +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_gpio-switches
 @@ -0,0 +1,25 @@
 +#!/bin/sh
 +#
 +# Copyright (C) 2015 OpenWrt.org
 +#
 +
 +. /lib/functions/uci-defaults.sh
 +. /lib/ar71xx.sh
 +
 +board=$(ar71xx_board_name)
 +
 +case $board in
 +nanostation-m)
 + ucidef_set_gpio_switch poe_passthrough PoE Passthrough 2
 + ;;
 +nanostation-m-xw)
 + ucidef_set_gpio_switch poe_passthrough PoE Passthrough 8
 + ;;
 +cpe510)
 + ucidef_set_gpio_switch poe_passthrough PoE Passthrough 20
 + ;;
 +esac
 +
 +ucidef_commit_gpio_switches
 +
 +exit 0
 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v3 3/7] ar71xx: add support for the devolo dLAN pro 500 Wireless+

2015-07-07 Thread Günther Kelleter
Signed-off-by: Günther Kelleter guenther.kelle...@devolo.de
---
 target/linux/ar71xx/base-files/etc/diag.sh |   3 +
 .../ar71xx/base-files/etc/uci-defaults/01_leds |   7 +
 .../ar71xx/base-files/etc/uci-defaults/02_network  |   4 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
 target/linux/ar71xx/config-3.18|   1 +
 .../files/arch/mips/ath79/mach-dlan-pro-500-wp.c   | 241 +
 .../linux/ar71xx/generic/profiles/devolo-dlan.mk   |  19 ++
 target/linux/ar71xx/image/Makefile |  19 ++
 .../610-MIPS-ath79-openwrt-machines.patch  |  27 ++-
 10 files changed, 319 insertions(+), 6 deletions(-)
 create mode 100644 
target/linux/ar71xx/files/arch/mips/ath79/mach-dlan-pro-500-wp.c
 create mode 100644 target/linux/ar71xx/generic/profiles/devolo-dlan.mk

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
index c02efa8..4c530ce 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -70,6 +70,9 @@ get_status_led() {
dir-835-a1)
status_led=d-link:amber:power
;;
+   dlan-pro-500-wp)
+   status_led=devolo:green:wlan-2g
+   ;;
dragino2)
status_led=dragino2:red:system
;;
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds 
b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
index 19814f4..f740d3b 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -150,6 +150,13 @@ dir-825-c1)
ucidef_set_led_wlan wlan2g WLAN 2.4 GHz d-link:blue:wlan2g 
phy0tpt
;;
 
+dlan-pro-500-wp)
+   ucidef_set_led_default power System Power devolo:green:status 1
+   ucidef_set_led_netdev lan Ethernet Activity devolo:green:eth 
br-lan
+   ucidef_set_led_wlan wlan2g WLAN 2.4 GHz devolo:green:wlan-2g 
phy0tpt
+   ucidef_set_led_wlan wlan5g WLAN 5 GHz devolo:blue:wlan-5g none
+   ;;
+
 gl-inet)
ucidef_set_led_netdev lan LAN gl-connect:green:lan eth1
ucidef_set_led_wlan wlan WLAN gl-connect:red:wlan phy0tpt
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
index 6d76af8..757d946 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -299,6 +299,10 @@ esr900)
[ -n $mac ]  ucidef_set_interface_macaddr wan $mac
;;
 
+dlan-pro-500-wp)
+   ucidef_set_interface_lan eth0 eth1
+   ;;
+
 all0305 |\
 aw-nr580 |\
 bullet-m |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 4fee82c..ddd1286 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -417,6 +417,9 @@ ar71xx_board_detect() {
*DIR-835 rev. A1)
name=dir-835-a1
;;
+   *dLAN pro 500 Wireless+)
+   name=dlan-pro-500-wp
+   ;;
*Dragino v2)
name=dragino2
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 0f3ea9c..f3909ed 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -207,6 +207,7 @@ platform_check_image() {
dir-615-e4 | \
dir-825-c1 | \
dir-835-a1 | \
+   dlan-pro-500-wp | \
dragino2 | \
epg5000 | \
esr1750 | \
diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18
index 0af087d..99f8881 100644
--- a/target/linux/ar71xx/config-3.18
+++ b/target/linux/ar71xx/config-3.18
@@ -54,6 +54,7 @@ CONFIG_ATH79_MACH_DIR_600_A1=y
 CONFIG_ATH79_MACH_DIR_615_C1=y
 CONFIG_ATH79_MACH_DIR_825_B1=y
 CONFIG_ATH79_MACH_DIR_825_C1=y
+CONFIG_ATH79_MACH_DLAN_PRO_500_WP=y
 CONFIG_ATH79_MACH_DRAGINO2=y
 CONFIG_ATH79_MACH_EAP300V2=y
 CONFIG_ATH79_MACH_EAP7660D=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-dlan-pro-500-wp.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-dlan-pro-500-wp.c
new file mode 100644
index 000..4a144ae
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-dlan-pro-500-wp.c
@@ -0,0 +1,241 @@
+/*
+ * devolo dLAN pro 500 Wireless+ support
+ *
+ * Copyright (c) 2013-2015 devolo AG
+ * Copyright (c) 2011-2012 Gabor Juhos juh...@openwrt.org
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS AND THE AUTHOR DISCLAIMS ALL 

Re: [OpenWrt-Devel] [PATCH] ar71xx: add support for D-Link DIR-615 rev. Ix board

2015-07-07 Thread Jaehoon You
Hi, John.

No problem. I will send new patch soon.

-Jaehoon
Jaehoon You
http://about.me/jhyou


2015-07-07 20:54 GMT+09:00 John Crispin blo...@openwrt.org:
 Hi,

 sorry patch no longer applies. could you rebase it and then send it
 again please ?

 John

 On 18/04/2015 06:52, Jaehoon You wrote:
 Signed-off-by: Jaehoon You teslam...@gmail.com
 ---
  target/linux/ar71xx/base-files/etc/diag.sh |   1 +
  .../ar71xx/base-files/etc/uci-defaults/01_leds |   8 ++
  .../ar71xx/base-files/etc/uci-defaults/02_network  |   0
  target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
  .../base-files/lib/preinit/05_set_iface_mac_ar71xx |   3 +
  .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
  target/linux/ar71xx/config-3.18|   1 +
  .../ar71xx/files/arch/mips/ath79/mach-dir-615-i1.c | 141 
 +
  target/linux/ar71xx/generic/profiles/d-link.mk |  10 ++
  target/linux/ar71xx/image/Makefile |   9 ++
  .../610-MIPS-ath79-openwrt-machines.patch  |  25 +++-
  11 files changed, 196 insertions(+), 6 deletions(-)
  mode change 100644 = 100755 
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network
  create mode 100644 
 target/linux/ar71xx/files/arch/mips/ath79/mach-dir-615-i1.c

 diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
 b/target/linux/ar71xx/base-files/etc/diag.sh
 index 52a73ee..07b1769 100644
 --- a/target/linux/ar71xx/base-files/etc/diag.sh
 +++ b/target/linux/ar71xx/base-files/etc/diag.sh
 @@ -54,6 +54,7 @@ get_status_led() {
   dir-505-a1 |\
   dir-600-a1 |\
   dir-615-e1 |\
 + dir-615-i1 |\
   dir-615-e4)
   status_led=d-link:green:power
   ;;
 diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds 
 b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
 index 787523a..aff8f1f 100644
 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
 +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
 @@ -139,6 +139,14 @@ dir-825-b1)
   ucidef_set_led_usbdev usb USB d-link:blue:usb 1-1
   ;;

 +dir-615-i1)
 + ucidef_set_led_default power POWER d-link:green:power 1
 + ucidef_set_led_default diag DIAG d-link:amber:power 0
 + ucidef_set_led_default wps WPS d-link:blue:wps 0
 + ucidef_set_led_netdev wan WAN d-link:green:wan eth0
 + ucidef_set_led_wlan wlan WLAN d-link:green:wlan phy0tpt
 + ;;
 +
  dir-825-c1)
   ucidef_set_led_usbdev usb USB d-link:blue:usb 1-1
   ucidef_set_led_wlan wlan2g WLAN 2.4 GHz d-link:blue:wlan2g 
 phy0tpt
 diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
 b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
 old mode 100644
 new mode 100755
 diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
 b/target/linux/ar71xx/base-files/lib/ar71xx.sh
 index b3dbcf5..3e4453d 100755
 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
 +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
 @@ -398,6 +398,9 @@ ar71xx_board_detect() {
   *DIR-615 rev. E4)
   name=dir-615-e4
   ;;
 + *DIR-615 rev. I1)
 + name=dir-615-i1
 + ;;
   *DIR-825 rev. B1)
   name=dir-825-b1
   ;;
 diff --git 
 a/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx 
 b/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx
 index b40dff5..c39169a 100644
 --- a/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx
 +++ b/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx
 @@ -29,6 +29,9 @@ preinit_set_mac_address() {
   fetch_mac_from_mtd config lan_mac wan_mac
   echo 1  
 /sys/class/leds/dir-615-c1:green:wancpu/brightness
   ;;
 + dir-615-i1)
 + fetch_mac_from_mtd nvram sys_lan_mac sys_wan_mac
 + ;;
   r6100)
   mac_lan=$(mtd_get_mac_binary caldata 0)
   [ -n $mac_lan ]  ifconfig eth1 hw ether $mac_lan
 diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
 b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
 index 0cbee1d..4899f78 100755
 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
 +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
 @@ -203,6 +203,7 @@ platform_check_image() {
   dir-615-c1 | \
   dir-615-e1 | \
   dir-615-e4 | \
 + dir-615-i1 | \
   dir-825-c1 | \
   dir-835-a1 | \
   dragino2 | \
 diff --git a/target/linux/ar71xx/config-3.18 
 b/target/linux/ar71xx/config-3.18
 index 1ee99f4..6374c54 100644
 --- a/target/linux/ar71xx/config-3.18
 +++ b/target/linux/ar71xx/config-3.18
 @@ -50,6 +50,7 @@ CONFIG_ATH79_MACH_DHP_1565_A1=y
  CONFIG_ATH79_MACH_DIR_505_A1=y
  CONFIG_ATH79_MACH_DIR_600_A1=y
  CONFIG_ATH79_MACH_DIR_615_C1=y
 +CONFIG_ATH79_MACH_DIR_615_I1=y
  CONFIG_ATH79_MACH_DIR_825_B1=y
  

[OpenWrt-Devel] [PATCH v3 6/7] base-files: added option to configure the gpio led trigger in uci-defaults

2015-07-07 Thread Günther Kelleter
Signed-off-by: Günther Kelleter guenther.kelle...@devolo.de
---
 package/base-files/files/etc/init.d/led  |  7 +++
 .../base-files/files/lib/functions/uci-defaults.sh   | 20 
 2 files changed, 27 insertions(+)

diff --git a/package/base-files/files/etc/init.d/led 
b/package/base-files/files/etc/init.d/led
index 1a57e8a..3f45732 100755
--- a/package/base-files/files/etc/init.d/led
+++ b/package/base-files/files/etc/init.d/led
@@ -26,6 +26,8 @@ load_led() {
config_get port_state $1 port_state
config_get delay $1 delay 150
config_get message $1 message 
+   config_get gpio $1 gpio 0
+   config_get inverted $1 inverted 0
 
if [ $trigger = rssi ]; then
# handled by rssileds userspace process
@@ -80,6 +82,11 @@ load_led() {
echo $delay  /sys/class/leds/${sysfs}/delay
;;
 
+   gpio)
+   echo $gpio  /sys/class/leds/${sysfs}/gpio
+   echo $inverted  /sys/class/leds/${sysfs}/inverted
+   ;;
+
switch[0-9]*)
local port_mask
 
diff --git a/package/base-files/files/lib/functions/uci-defaults.sh 
b/package/base-files/files/lib/functions/uci-defaults.sh
index 5a8809d..93997b2 100644
--- a/package/base-files/files/lib/functions/uci-defaults.sh
+++ b/package/base-files/files/lib/functions/uci-defaults.sh
@@ -157,6 +157,26 @@ EOF
UCIDEF_LEDS_CHANGED=1
 }
 
+ucidef_set_led_gpio() {
+   local cfg=led_$1
+   local name=$2
+   local sysfs=$3
+   local gpio=$4
+   local inverted=$5
+
+   uci -q get system.$cfg  return 0
+
+   uci batch EOF
+set system.$cfg='led'
+set system.$cfg.name='$name'
+set system.$cfg.sysfs='$sysfs'
+set system.$cfg.trigger='gpio'
+set system.$cfg.gpio='$gpio'
+set system.$cfg.inverted='$inverted'
+EOF
+   UCIDEF_LEDS_CHANGED=1
+}
+
 ucidef_set_rssimon() {
local dev=$1
local refresh=$2
-- 
2.4.4.88.gac2ab0d
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v3 4/7] ar71xx: add support to use gpio irqs

2015-07-07 Thread Günther Kelleter
Signed-off-by: Günther Kelleter guenther.kelle...@devolo.de
---
 .../739-MIPS-ath79-add-gpio-irq-support.patch  | 225 +
 1 file changed, 225 insertions(+)
 create mode 100644 
target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-irq-support.patch

diff --git 
a/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-irq-support.patch 
b/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-irq-support.patch
new file mode 100644
index 000..2b90df0
--- /dev/null
+++ b/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-irq-support.patch
@@ -0,0 +1,225 @@
+--- a/arch/mips/ath79/gpio.c
 b/arch/mips/ath79/gpio.c
+@@ -20,9 +20,14 @@
+ #include linux/io.h
+ #include linux/ioport.h
+ #include linux/gpio.h
++#include linux/irq.h
++#include linux/interrupt.h
++
++#include linux/of.h
+ 
+ #include asm/mach-ath79/ar71xx_regs.h
+ #include asm/mach-ath79/ath79.h
++#include asm/mach-ath79/irq.h
+ #include common.h
+ 
+ void __iomem *ath79_gpio_base;
+@@ -31,6 +36,13 @@ EXPORT_SYMBOL_GPL(ath79_gpio_base);
+ static unsigned long ath79_gpio_count;
+ static DEFINE_SPINLOCK(ath79_gpio_lock);
+ 
++/*
++ * gpio_both_edge is a bitmask of which gpio pins need to have
++ * the detect priority flipped from the interrupt handler to
++ * emulate IRQ_TYPE_EDGE_BOTH.
++ */
++static unsigned long gpio_both_edge = 0;
++
+ static void __ath79_gpio_set_value(unsigned gpio, int value)
+ {
+   void __iomem *base = ath79_gpio_base;
+@@ -209,6 +221,133 @@ void __init ath79_gpio_output_select(uns
+   spin_unlock_irqrestore(ath79_gpio_lock, flags);
+ }
+ 
++static int ath79_gpio_irq_type(struct irq_data *d, unsigned type)
++{
++  int offset = d-irq - ATH79_GPIO_IRQ_BASE;
++  void __iomem *base = ath79_gpio_base;
++  unsigned long flags;
++  unsigned long int_type;
++  unsigned long int_polarity;
++  unsigned long bit = (1  offset);
++
++  spin_lock_irqsave(ath79_gpio_lock, flags);
++
++  int_type = __raw_readl(base + AR71XX_GPIO_REG_INT_TYPE);
++  int_polarity = __raw_readl(base + AR71XX_GPIO_REG_INT_POLARITY);
++
++  gpio_both_edge = ~bit;
++
++  switch (type) {
++  case IRQ_TYPE_EDGE_RISING:
++  int_type = ~bit;
++  int_polarity |= bit;
++  break;
++
++  case IRQ_TYPE_EDGE_FALLING:
++  int_type = ~bit;
++  int_polarity = ~bit;
++  break;
++
++  case IRQ_TYPE_LEVEL_HIGH:
++  int_type |= bit;
++  int_polarity |= bit;
++  break;
++
++  case IRQ_TYPE_LEVEL_LOW:
++  int_type |= bit;
++  int_polarity = ~bit;
++  break;
++
++  case IRQ_TYPE_EDGE_BOTH:
++  int_type |= bit;
++  /* set polarity based on current value */
++  if (gpio_get_value(offset)) {
++  int_polarity = ~bit;
++  } else {
++  int_polarity |= bit;
++  }
++  /* flip this gpio in the interrupt handler */
++  gpio_both_edge |= bit;
++  break;
++
++  default:
++  spin_unlock_irqrestore(ath79_gpio_lock, flags);
++  return -EINVAL;
++  }
++
++  __raw_writel(int_type, base + AR71XX_GPIO_REG_INT_TYPE);
++  __raw_writel(int_polarity, base + AR71XX_GPIO_REG_INT_POLARITY);
++
++  __raw_writel(__raw_readl(base + AR71XX_GPIO_REG_INT_MODE) | (1  
offset),
++   base + AR71XX_GPIO_REG_INT_MODE);
++
++  __raw_writel(__raw_readl(base + AR71XX_GPIO_REG_INT_ENABLE)  ~(1  
offset),
++   base + AR71XX_GPIO_REG_INT_ENABLE);
++
++  spin_unlock_irqrestore(ath79_gpio_lock, flags);
++  return 0;
++}
++
++static void ath79_gpio_irq_enable(struct irq_data *d)
++{
++  int offset = d-irq - ATH79_GPIO_IRQ_BASE;
++  void __iomem *base = ath79_gpio_base;
++
++  __raw_writel(__raw_readl(base + AR71XX_GPIO_REG_INT_ENABLE) | (1  
offset),
++   base + AR71XX_GPIO_REG_INT_ENABLE);
++}
++
++static void ath79_gpio_irq_disable(struct irq_data *d)
++{
++  int offset = d-irq - ATH79_GPIO_IRQ_BASE;
++  void __iomem *base = ath79_gpio_base;
++
++  __raw_writel(__raw_readl(base + AR71XX_GPIO_REG_INT_ENABLE)  ~(1  
offset),
++   base + AR71XX_GPIO_REG_INT_ENABLE);
++}
++
++static struct irq_chip ath79_gpio_irqchip = {
++  .name = GPIO,
++  .irq_enable = ath79_gpio_irq_enable,
++  .irq_disable = ath79_gpio_irq_disable,
++  .irq_set_type = ath79_gpio_irq_type,
++};
++
++static irqreturn_t ath79_gpio_irq(int irq, void *dev)
++{
++  void __iomem *base = ath79_gpio_base;
++  unsigned int stat = __raw_readl(base + AR71XX_GPIO_REG_INT_PENDING);
++
++  while (stat) {
++  int bit_num = __ffs(stat);
++  unsigned long bit = (1bit_num);
++
++  if (bit  gpio_both_edge) {
++  __raw_writel(__raw_readl(base + 

[OpenWrt-Devel] [PATCH v3 2/7] ath79: dev-eth: initialize clock for id 0 on AR934X

2015-07-07 Thread Günther Kelleter
Signed-off-by: Günther Kelleter guenther.kelle...@devolo.de
---
 target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c 
b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
index ff94e2e..c7524be 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
@@ -251,9 +251,11 @@ void __init ath79_register_mdio(unsigned int id, u32 
phy_mask)
case ATH79_SOC_AR9344:
if (id == 1) {
mdio_data-builtin_switch = 1;
-   mdio_data-ref_clock = ar934x_get_mdio_ref_clock();
-   mdio_data-mdio_clock = 625;
+   } else {
+   mdio_data-builtin_switch = 0;
}
+   mdio_data-ref_clock = ar934x_get_mdio_ref_clock();
+   mdio_data-mdio_clock = 625;
mdio_data-is_ar934x = 1;
break;
 
-- 
2.4.4.88.gac2ab0d
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v3 1/7] ar71xx: ag71xx: add pdata field supported

2015-07-07 Thread Günther Kelleter
to allow target specific override of phydev-supported.

Signed-off-by: Günther Kelleter guenther.kelle...@devolo.de
---
 .../ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h  | 1 +
 .../ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c| 5 +
 2 files changed, 6 insertions(+)

diff --git 
a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h 
b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h
index d46dc4e..aa7663b 100644
--- 
a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h
+++ 
b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h
@@ -30,6 +30,7 @@ struct ag71xx_platform_data {
u32 reset_bit;
u8  mac_addr[ETH_ALEN];
struct device   *mii_bus_dev;
+   u32 supported;
 
u8  has_gbit:1;
u8  is_ar91xx:1;
diff --git 
a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c 
b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c
index 9de77e9..0f5ec9c 100644
--- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c
+++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c
@@ -146,6 +146,11 @@ static int ag71xx_phy_connect_multi(struct ag71xx *ag)
else
phydev-supported = PHY_BASIC_FEATURES;
 
+   if (pdata-supported) {
+   dev_info(dev, overriding phydev-supported (%08x)\n, 
pdata-supported);
+   phydev-supported = pdata-supported;
+   }
+
phydev-advertising = phydev-supported;
 
dev_info(dev, connected to PHY at %s [uid=%08x, driver=%s]\n,
-- 
2.4.4.88.gac2ab0d
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v3 5/7] mac80211: make ath10k firmware v2 selectable

2015-07-07 Thread Günther Kelleter
Added option for old firmware version (10.1 API v2). It seems that recent
firmware versions are constantly crashing (at least on a QCA9880-BR4A-R) and
this provides the option to select an older version instead.

Signed-off-by: Günther Kelleter guenther.kelle...@devolo.de
---
 package/kernel/mac80211/Makefile | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index 7f698f0..cc98fb7 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -620,6 +620,19 @@ Atheros IEEE 802.11ac family of chipsets. For now only
 PCI is supported.
 endef
 
+define KernelPackage/ath10k/config
+  if PACKAGE_kmod-ath10k
+
+   config ATH10K_API2_FW
+   bool Firmware optimized for AP operation (v10.1 / API v2)
+   default n
+   help
+ Use the ath10k firmware from the 10.1 SDK using API v2 
optimized
+ for access point operation if the default firmware keeps 
crashing.
+
+  endif
+endef
+
 define KernelPackage/carl9170
   $(call KernelPackage/mac80211/Default)
   TITLE:=Driver for Atheros AR9170 USB sticks
@@ -1844,9 +1857,15 @@ define KernelPackage/ath10k/install
$(INSTALL_DATA) \

$(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/ath10k/QCA988X/hw2.0/board.bin
 \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/
+ifeq ($(CONFIG_ATH10K_API2_FW),y)
+   $(INSTALL_DATA) \
+   
$(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.1/firmware-2.bin_10.1.467.2-1
 \
+   $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin
+else
$(INSTALL_DATA) \

$(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.2.4/untested/firmware-5.bin_10.2.4.70-2
 \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-5.bin
+endif
 endef
 
 define KernelPackage/mwl8k/install
-- 
2.4.4.88.gac2ab0d
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v3 0/7] ar71xx: Add support for devolo dLAN devices

2015-07-07 Thread Günther Kelleter
This patch set adds support for two devolo dLAN devices:
  dLAN pro 500 Wireless+
  dLAN pro 1200+ Wifi ac

It supports the wireless and ethernet interfaces.
PLC support must be implemented in user space and will follow later when basic
support is finally accepted.

Changes since PATCH v2:
fix keycode of WPS key on dLAN pro 1200+ Wifi ac
formatting fixes
reworked 739-MIPS-ath79-add-gpio-irq-support.patch, no nested threaded 
irqs
removed 835-fix-irq-request-ledtrig-gpio.patch
ath10k: only choose between latest fw and v2 as fallback

Günther Kelleter (7):
  ar71xx: ag71xx: add pdata field supported
  ath79: dev-eth: initialize clock for id 0 on AR934X
  ar71xx: add support for the devolo dLAN pro 500 Wireless+
  ar71xx: add support to use gpio irqs
  mac80211: make ath10k firmware v2 selectable
  base-files: added option to configure the gpio led trigger in
uci-defaults
  ar71xx: add support for the devolo dLAN pro 1200+ WiFi ac

 package/base-files/files/etc/init.d/led|   7 +
 .../base-files/files/lib/functions/uci-defaults.sh |  20 ++
 package/kernel/mac80211/Makefile   |  19 ++
 target/linux/ar71xx/base-files/etc/diag.sh |   6 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |   8 +
 .../ar71xx/base-files/etc/uci-defaults/01_leds |  13 ++
 .../ar71xx/base-files/etc/uci-defaults/02_network  |  10 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   6 +
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   2 +
 target/linux/ar71xx/config-3.18|   2 +
 .../linux/ar71xx/files/arch/mips/ath79/dev-eth.c   |   6 +-
 .../files/arch/mips/ath79/mach-dlan-pro-1200-ac.c  | 216 ++
 .../files/arch/mips/ath79/mach-dlan-pro-500-wp.c   | 241 +
 .../mips/include/asm/mach-ath79/ag71xx_platform.h  |   1 +
 .../net/ethernet/atheros/ag71xx/ag71xx_phy.c   |   5 +
 .../linux/ar71xx/generic/profiles/devolo-dlan.mk   |  33 +++
 target/linux/ar71xx/image/Makefile |  21 ++
 .../610-MIPS-ath79-openwrt-machines.patch  |  42 +++-
 .../739-MIPS-ath79-add-gpio-irq-support.patch  | 225 +++
 19 files changed, 875 insertions(+), 8 deletions(-)
 create mode 100644 
target/linux/ar71xx/files/arch/mips/ath79/mach-dlan-pro-1200-ac.c
 create mode 100644 
target/linux/ar71xx/files/arch/mips/ath79/mach-dlan-pro-500-wp.c
 create mode 100644 target/linux/ar71xx/generic/profiles/devolo-dlan.mk
 create mode 100644 
target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-irq-support.patch

-- 
2.4.4.88.gac2ab0d
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v3 7/7] ar71xx: add support for the devolo dLAN pro 1200+ WiFi ac

2015-07-07 Thread Günther Kelleter
Signed-off-by: Günther Kelleter guenther.kelle...@devolo.de
---
 target/linux/ar71xx/base-files/etc/diag.sh |   3 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |   8 +
 .../ar71xx/base-files/etc/uci-defaults/01_leds |   6 +
 .../ar71xx/base-files/etc/uci-defaults/02_network  |   6 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
 target/linux/ar71xx/config-3.18|   1 +
 .../files/arch/mips/ath79/mach-dlan-pro-1200-ac.c  | 216 +
 .../linux/ar71xx/generic/profiles/devolo-dlan.mk   |  14 ++
 target/linux/ar71xx/image/Makefile |   2 +
 .../610-MIPS-ath79-openwrt-machines.patch  |  27 ++-
 11 files changed, 281 insertions(+), 6 deletions(-)
 create mode 100644 
target/linux/ar71xx/files/arch/mips/ath79/mach-dlan-pro-1200-ac.c

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
index 4c530ce..a0ec52e 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -73,6 +73,9 @@ get_status_led() {
dlan-pro-500-wp)
status_led=devolo:green:wlan-2g
;;
+   dlan-pro-1200-ac)
+   status_led=devolo:status:wlan
+   ;;
dragino2)
status_led=dragino2:red: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 164d3ab..1b288ca 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
@@ -34,6 +34,14 @@ case $FIRMWARE in
esac
;;
 
+ath10k/cal-pci-:00:00.0.bin)
+   case $board in
+   dlan-pro-1200-ac)
+   ath10kcal_from_file /dev/$(cat /proc/mtd |grep \art\ | cut 
-d: -f1) 20480 $ath10kcal_tmp
+   ;;
+   esac
+   ;;
+
 *)
exit 1
;;
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds 
b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
index f740d3b..be0b4a0 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -157,6 +157,12 @@ dlan-pro-500-wp)
ucidef_set_led_wlan wlan5g WLAN 5 GHz devolo:blue:wlan-5g none
;;
 
+dlan-pro-1200-ac)
+   ucidef_set_led_wlan wlan WLAN devolo:status:wlan phy0radio
+   ucidef_set_led_gpio plcw dLAN devolo:status:dlan 17 1
+   ucidef_set_led_gpio plcr dLAN devolo:error:dlan 16 0
+   ;;
+
 gl-inet)
ucidef_set_led_netdev lan LAN gl-connect:green:lan eth1
ucidef_set_led_wlan wlan WLAN gl-connect:red:wlan phy0tpt
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
index 757d946..275697e 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -303,6 +303,12 @@ dlan-pro-500-wp)
ucidef_set_interface_lan eth0 eth1
;;
 
+dlan-pro-1200-ac)
+   ucidef_set_interface_lan eth0
+   ucidef_add_switch switch0 1 0
+   ucidef_add_switch_vlan switch0 0 0 2 3 4
+   ;;
+
 all0305 |\
 aw-nr580 |\
 bullet-m |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index ddd1286..e8ce342 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -420,6 +420,9 @@ ar71xx_board_detect() {
*dLAN pro 500 Wireless+)
name=dlan-pro-500-wp
;;
+   *dLAN pro 1200+ WiFi ac)
+   name=dlan-pro-1200-ac
+   ;;
*Dragino v2)
name=dragino2
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index f3909ed..6690ed3 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -208,6 +208,7 @@ platform_check_image() {
dir-825-c1 | \
dir-835-a1 | \
dlan-pro-500-wp | \
+   dlan-pro-1200-ac | \
dragino2 | \
epg5000 | \
esr1750 | \
diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18
index 99f8881..f621be2 100644
--- a/target/linux/ar71xx/config-3.18
+++ b/target/linux/ar71xx/config-3.18
@@ -54,6 +54,7 @@ CONFIG_ATH79_MACH_DIR_600_A1=y
 CONFIG_ATH79_MACH_DIR_615_C1=y
 CONFIG_ATH79_MACH_DIR_825_B1=y
 CONFIG_ATH79_MACH_DIR_825_C1=y
+CONFIG_ATH79_MACH_DLAN_PRO_1200_AC=y
 CONFIG_ATH79_MACH_DLAN_PRO_500_WP=y
 CONFIG_ATH79_MACH_DRAGINO2=y
 CONFIG_ATH79_MACH_EAP300V2=y
diff --git 

[OpenWrt-Devel] [PATCH][v2] ar71xx: add support for D-Link DIR-615 rev. Ix board

2015-07-07 Thread Jaehoon You
Based on trunk r46212.

Signed-off-by: Jaehoon You teslam...@gmail.com
---
 target/linux/ar71xx/base-files/etc/diag.sh |   1 +
 .../ar71xx/base-files/etc/uci-defaults/01_leds |   8 ++
 .../ar71xx/base-files/etc/uci-defaults/02_network  |   1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
 .../base-files/lib/preinit/05_set_iface_mac_ar71xx |   3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
 target/linux/ar71xx/config-3.18|   1 +
 .../ar71xx/files/arch/mips/ath79/mach-dir-615-i1.c | 133 +
 target/linux/ar71xx/generic/profiles/d-link.mk |  10 ++
 target/linux/ar71xx/image/Makefile |   9 ++
 .../610-MIPS-ath79-openwrt-machines.patch  |  25 +++-
 11 files changed, 189 insertions(+), 6 deletions(-)
 mode change 100644 = 100755 
target/linux/ar71xx/base-files/etc/uci-defaults/02_network
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-dir-615-i1.c

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
index c02efa8..7972844 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -57,6 +57,7 @@ get_status_led() {
dir-505-a1 |\
dir-600-a1 |\
dir-615-e1 |\
+   dir-615-i1 |\
dir-615-e4)
status_led=d-link:green:power
;;
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds 
b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
index 19814f4..3cafc6f 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -145,6 +145,14 @@ dir-825-b1)
ucidef_set_led_usbdev usb USB d-link:blue:usb 1-1
;;
 
+dir-615-i1)
+   ucidef_set_led_default power POWER d-link:green:power 1
+   ucidef_set_led_default diag DIAG d-link:amber:power 0
+   ucidef_set_led_default wps WPS d-link:blue:wps 0
+   ucidef_set_led_netdev wan WAN d-link:green:wan eth0
+   ucidef_set_led_wlan wlan WLAN d-link:green:wlan phy0tpt
+   ;;
+
 dir-825-c1)
ucidef_set_led_usbdev usb USB d-link:blue:usb 1-1
ucidef_set_led_wlan wlan2g WLAN 2.4 GHz d-link:blue:wlan2g 
phy0tpt
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
old mode 100644
new mode 100755
index 6d76af8..e0712a5
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -214,6 +214,7 @@ tl-wr941nd)
 
 r6100 |\
 smart-300 |\
+dir-615-i1 |\
 tl-mr3420-v2 |\
 tl-wr841n-v8 |\
 tl-wr842n-v2 |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 4fee82c..465ca12 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -408,6 +408,9 @@ ar71xx_board_detect() {
*DIR-615 rev. E4)
name=dir-615-e4
;;
+   *DIR-615 rev. I1)
+   name=dir-615-i1
+   ;;
*DIR-825 rev. B1)
name=dir-825-b1
;;
diff --git a/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx 
b/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx
index b40dff5..c39169a 100644
--- a/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx
+++ b/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx
@@ -29,6 +29,9 @@ preinit_set_mac_address() {
fetch_mac_from_mtd config lan_mac wan_mac
echo 1  
/sys/class/leds/dir-615-c1:green:wancpu/brightness
;;
+   dir-615-i1)
+   fetch_mac_from_mtd nvram sys_lan_mac sys_wan_mac
+   ;;
r6100)
mac_lan=$(mtd_get_mac_binary caldata 0)
[ -n $mac_lan ]  ifconfig eth1 hw ether $mac_lan
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 0f3ea9c..065a231 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -205,6 +205,7 @@ platform_check_image() {
dir-615-c1 | \
dir-615-e1 | \
dir-615-e4 | \
+   dir-615-i1 | \
dir-825-c1 | \
dir-835-a1 | \
dragino2 | \
diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18
index 0af087d..9a65b86 100644
--- a/target/linux/ar71xx/config-3.18
+++ b/target/linux/ar71xx/config-3.18
@@ -52,6 +52,7 @@ CONFIG_ATH79_MACH_DHP_1565_A1=y
 CONFIG_ATH79_MACH_DIR_505_A1=y
 CONFIG_ATH79_MACH_DIR_600_A1=y
 CONFIG_ATH79_MACH_DIR_615_C1=y
+CONFIG_ATH79_MACH_DIR_615_I1=y
 CONFIG_ATH79_MACH_DIR_825_B1=y
 CONFIG_ATH79_MACH_DIR_825_C1=y
 

Re: [OpenWrt-Devel] [PATCH][v2] ar71xx: add support for D-Link DIR-615 rev. Ix board

2015-07-07 Thread John Crispin
that was quick :)

On 07/07/2015 15:18, Jaehoon You wrote:
 Based on trunk r46212.
 
 Signed-off-by: Jaehoon You teslam...@gmail.com
 ---
  target/linux/ar71xx/base-files/etc/diag.sh |   1 +
  .../ar71xx/base-files/etc/uci-defaults/01_leds |   8 ++
  .../ar71xx/base-files/etc/uci-defaults/02_network  |   1 +
  target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
  .../base-files/lib/preinit/05_set_iface_mac_ar71xx |   3 +
  .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
  target/linux/ar71xx/config-3.18|   1 +
  .../ar71xx/files/arch/mips/ath79/mach-dir-615-i1.c | 133 
 +
  target/linux/ar71xx/generic/profiles/d-link.mk |  10 ++
  target/linux/ar71xx/image/Makefile |   9 ++
  .../610-MIPS-ath79-openwrt-machines.patch  |  25 +++-
  11 files changed, 189 insertions(+), 6 deletions(-)
  mode change 100644 = 100755 
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network
  create mode 100644 
 target/linux/ar71xx/files/arch/mips/ath79/mach-dir-615-i1.c
 
 diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
 b/target/linux/ar71xx/base-files/etc/diag.sh
 index c02efa8..7972844 100644
 --- a/target/linux/ar71xx/base-files/etc/diag.sh
 +++ b/target/linux/ar71xx/base-files/etc/diag.sh
 @@ -57,6 +57,7 @@ get_status_led() {
   dir-505-a1 |\
   dir-600-a1 |\
   dir-615-e1 |\
 + dir-615-i1 |\
   dir-615-e4)
   status_led=d-link:green:power
   ;;
 diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds 
 b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
 index 19814f4..3cafc6f 100644
 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
 +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
 @@ -145,6 +145,14 @@ dir-825-b1)
   ucidef_set_led_usbdev usb USB d-link:blue:usb 1-1
   ;;
  
 +dir-615-i1)
 + ucidef_set_led_default power POWER d-link:green:power 1
 + ucidef_set_led_default diag DIAG d-link:amber:power 0
 + ucidef_set_led_default wps WPS d-link:blue:wps 0
 + ucidef_set_led_netdev wan WAN d-link:green:wan eth0
 + ucidef_set_led_wlan wlan WLAN d-link:green:wlan phy0tpt
 + ;;
 +
  dir-825-c1)
   ucidef_set_led_usbdev usb USB d-link:blue:usb 1-1
   ucidef_set_led_wlan wlan2g WLAN 2.4 GHz d-link:blue:wlan2g 
 phy0tpt
 diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
 b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
 old mode 100644
 new mode 100755
 index 6d76af8..e0712a5
 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
 +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
 @@ -214,6 +214,7 @@ tl-wr941nd)
  
  r6100 |\
  smart-300 |\
 +dir-615-i1 |\
  tl-mr3420-v2 |\
  tl-wr841n-v8 |\
  tl-wr842n-v2 |\
 diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
 b/target/linux/ar71xx/base-files/lib/ar71xx.sh
 index 4fee82c..465ca12 100755
 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
 +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
 @@ -408,6 +408,9 @@ ar71xx_board_detect() {
   *DIR-615 rev. E4)
   name=dir-615-e4
   ;;
 + *DIR-615 rev. I1)
 + name=dir-615-i1
 + ;;
   *DIR-825 rev. B1)
   name=dir-825-b1
   ;;
 diff --git 
 a/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx 
 b/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx
 index b40dff5..c39169a 100644
 --- a/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx
 +++ b/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx
 @@ -29,6 +29,9 @@ preinit_set_mac_address() {
   fetch_mac_from_mtd config lan_mac wan_mac
   echo 1  
 /sys/class/leds/dir-615-c1:green:wancpu/brightness
   ;;
 + dir-615-i1)
 + fetch_mac_from_mtd nvram sys_lan_mac sys_wan_mac
 + ;;
   r6100)
   mac_lan=$(mtd_get_mac_binary caldata 0)
   [ -n $mac_lan ]  ifconfig eth1 hw ether $mac_lan
 diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
 b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
 index 0f3ea9c..065a231 100755
 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
 +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
 @@ -205,6 +205,7 @@ platform_check_image() {
   dir-615-c1 | \
   dir-615-e1 | \
   dir-615-e4 | \
 + dir-615-i1 | \
   dir-825-c1 | \
   dir-835-a1 | \
   dragino2 | \
 diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18
 index 0af087d..9a65b86 100644
 --- a/target/linux/ar71xx/config-3.18
 +++ b/target/linux/ar71xx/config-3.18
 @@ -52,6 +52,7 @@ CONFIG_ATH79_MACH_DHP_1565_A1=y
  CONFIG_ATH79_MACH_DIR_505_A1=y
  CONFIG_ATH79_MACH_DIR_600_A1=y
  CONFIG_ATH79_MACH_DIR_615_C1=y
 

[OpenWrt-Devel] Hardening Issues / Revert r46146 ?

2015-07-07 Thread Dirk Neukirchen
r46146 change broke uclibc compile in x86/x86_64 target/linux/install with 
Error:
arch/x86/Makefile:114: stack-protector enabled but compiler support broken

Reason in Config-build.in:
depends on USE_MUSL - means no PKG_CC_STACKPROTECTOR_REGULAR or 
PKG_CC_STACKPROTECTOR_STRONG are set

toolchain/uClibc/common.mk has

-e 's,^.*UCLIBC_HAS_SSP[^_].*,UCLIBC_HAS_SSP=$(if $(or 
$(CONFIG_PKG_CC_STACKPROTECTOR_REGULAR),$(CONFIG_PKG_CC_STACKPROTECTOR_STRONG)),y,n),g'
 \

which now will set 

UCLIBC_HAS_SSP=n

This breaks compiler support because Kernel SSP is enabled by default
- the Kernel runs kernel_dir/scripts/gcc-x86_bits-has-stack-protector.sh 
to determine support/breakage

Reading documentation like [1]
suggests that SSP (Stack Smashing Protection) should work with
a GCC that has --disable libssp (toolchain/gcc/common.mk), because uclibc and 
glibc do
provide these since 2005/2006 according to commits/versions involved.

[2] : GCC does not have to provide libssp, the needed functions are added to 
ldso/libc instead.

References:
[1] http://www.linuxfromscratch.org/hints/downloads/files/ssp.txt
[2] http://git.buildroot.net/uClibc/tree/extra/Configs/Config.in
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] fix 64bit uclibc external toolchain detection

2015-07-07 Thread Dirk Neukirchen
according to gcc, UCLIBC_DYNAMIC_LINKER64

Signed-off-by: Dirk Neukirchen dirkneukirc...@web.de
---
 scripts/ext-toolchain.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/ext-toolchain.sh b/scripts/ext-toolchain.sh
index 3ebaa21..a552fbe 100755
--- a/scripts/ext-toolchain.sh
+++ b/scripts/ext-toolchain.sh
@@ -91,7 +91,7 @@ test_uclibc() {
local sysroot=$($CC $CFLAGS -print-sysroot 2/dev/null)
if [ -d ${sysroot:-$TOOLCHAIN} ]; then
local lib
-   for lib in 
${sysroot:-$TOOLCHAIN}/{lib,usr/lib,usr/local/lib}/ld-uClibc*.so*; do
+   for lib in 
${sysroot:-$TOOLCHAIN}/{lib,usr/lib,usr/local/lib}/ld*-uClibc*.so*; do
if [ -f $lib ]  [ ! -h $lib ]; then
return 0
fi
-- 
2.4.5
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] toolchain/uClibc: add uclibc-ng 1.0.3

2015-07-07 Thread Dirk Neukirchen

uclibc-ng is used by buildroot sine June 2015
see http://lists.busybox.net/pipermail/buildroot/2015-June/130161.html

maybe some OpenWrt users are interested to test

- fix ld-uclibc.so.1 breakage by symlinking to expected .so.0
- use 0.9.33.2 config, add add missing config symbols
- use buildroot patches

successful boots on qemu malta, qemu x86_64

Signed-off-by: Dirk Neukirchen dirkneukirc...@web.de
---
 package/libs/toolchain/Makefile|  10 +
 toolchain/uClibc/Config.in |   4 +
 toolchain/uClibc/Config.version|   6 +-
 toolchain/uClibc/common.mk |  12 +-
 toolchain/uClibc/config-1.0.3/arm  |   7 +
 toolchain/uClibc/config-1.0.3/armeb|   7 +
 toolchain/uClibc/config-1.0.3/common   | 222 +
 toolchain/uClibc/config-1.0.3/debug|   6 +
 toolchain/uClibc/config-1.0.3/i386 |  21 ++
 toolchain/uClibc/config-1.0.3/i686 |  21 ++
 toolchain/uClibc/config-1.0.3/m68k |   6 +
 toolchain/uClibc/config-1.0.3/mips |  18 ++
 toolchain/uClibc/config-1.0.3/mips64   |  18 ++
 toolchain/uClibc/config-1.0.3/mips64.32|  19 ++
 toolchain/uClibc/config-1.0.3/mips64.64|  19 ++
 toolchain/uClibc/config-1.0.3/mips64.n32   |  19 ++
 toolchain/uClibc/config-1.0.3/mips64el |  18 ++
 toolchain/uClibc/config-1.0.3/mips64el.32  |  19 ++
 toolchain/uClibc/config-1.0.3/mips64el.64  |  19 ++
 toolchain/uClibc/config-1.0.3/mips64el.n32 |  19 ++
 toolchain/uClibc/config-1.0.3/mipsel   |  18 ++
 toolchain/uClibc/config-1.0.3/mipsel.cobalt|  18 ++
 toolchain/uClibc/config-1.0.3/powerpc  |   6 +
 toolchain/uClibc/config-1.0.3/powerpc.e500 |   6 +
 toolchain/uClibc/config-1.0.3/sparc|   8 +
 toolchain/uClibc/config-1.0.3/sparc.leon   |   8 +
 toolchain/uClibc/config-1.0.3/x86_64   |   6 +
 .../0001-Fix-libgcc_s_resume-issue.patch   |  56 ++
 .../patches-1.0.3/0002-fix-parallel-build.patch|  21 ++
 29 files changed, 635 insertions(+), 2 deletions(-)
 create mode 100644 toolchain/uClibc/config-1.0.3/arm
 create mode 100644 toolchain/uClibc/config-1.0.3/armeb
 create mode 100644 toolchain/uClibc/config-1.0.3/common
 create mode 100644 toolchain/uClibc/config-1.0.3/debug
 create mode 100644 toolchain/uClibc/config-1.0.3/i386
 create mode 100644 toolchain/uClibc/config-1.0.3/i686
 create mode 100644 toolchain/uClibc/config-1.0.3/m68k
 create mode 100644 toolchain/uClibc/config-1.0.3/mips
 create mode 100644 toolchain/uClibc/config-1.0.3/mips64
 create mode 100644 toolchain/uClibc/config-1.0.3/mips64.32
 create mode 100644 toolchain/uClibc/config-1.0.3/mips64.64
 create mode 100644 toolchain/uClibc/config-1.0.3/mips64.n32
 create mode 100644 toolchain/uClibc/config-1.0.3/mips64el
 create mode 100644 toolchain/uClibc/config-1.0.3/mips64el.32
 create mode 100644 toolchain/uClibc/config-1.0.3/mips64el.64
 create mode 100644 toolchain/uClibc/config-1.0.3/mips64el.n32
 create mode 100644 toolchain/uClibc/config-1.0.3/mipsel
 create mode 100644 toolchain/uClibc/config-1.0.3/mipsel.cobalt
 create mode 100644 toolchain/uClibc/config-1.0.3/powerpc
 create mode 100644 toolchain/uClibc/config-1.0.3/powerpc.e500
 create mode 100644 toolchain/uClibc/config-1.0.3/sparc
 create mode 100644 toolchain/uClibc/config-1.0.3/sparc.leon
 create mode 100644 toolchain/uClibc/config-1.0.3/x86_64
 create mode 100644 
toolchain/uClibc/patches-1.0.3/0001-Fix-libgcc_s_resume-issue.patch
 create mode 100644 toolchain/uClibc/patches-1.0.3/0002-fix-parallel-build.patch

diff --git a/package/libs/toolchain/Makefile b/package/libs/toolchain/Makefile
index 27865de..37edef7 100644
--- a/package/libs/toolchain/Makefile
+++ b/package/libs/toolchain/Makefile
@@ -464,6 +464,16 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
$(PKG_BUILD_DIR)/libm-* \
$(PKG_BUILD_DIR)/libcrypt-* \
$(1)/lib/
+
+  ifeq ($(CONFIG_UCLIBC_VERSION_NG),y)
+   if [ -e $(1)/lib/ld-uClibc.so.1 ]; then \
+   (cd $(1)/lib;ln -sf ld-uClibc.so.1 ld-uClibc.so.0) \
+   fi
+   if [ -e $(1)/lib/ld64-uClibc.so.1 ]; then \
+   (cd $(1)/lib;ln -sf ld64-uClibc.so.1 ld64-uClibc.so.0) \
+   fi
+  endif
+
   endef
 
   LD_MUSL_NAME = $(notdir $(firstword $(wildcard 
$(TOOLCHAIN_DIR)/lib/libc.so*)))
diff --git a/toolchain/uClibc/Config.in b/toolchain/uClibc/Config.in
index 08ea00a..19f5b9a 100644
--- a/toolchain/uClibc/Config.in
+++ b/toolchain/uClibc/Config.in
@@ -11,6 +11,10 @@ choice
select UCLIBC_VERSION_0_9_33
bool uClibc 0.9.33.2
 
+   config UCLIBC_USE_VERSION_NG
+   select UCLIBC_VERSION_NG
+   bool uClibc-ng 1.0.3
+
 endchoice
 
 # Debug version.
diff --git a/toolchain/uClibc/Config.version 

[OpenWrt-Devel] ramips: add support for Planex MZK-DP150N

2015-07-07 Thread @SRCHACK . ORG
Hi,

This patch add support for Planex MZK-DP150N.
a mini router on the MT7620A SoC with one Ethernet port and a 802.11n 2.4 GHz 
radio.


---
diff -uprN trunk.ORG/target/linux/ramips/base-files/etc/board.d/01_leds 
trunk/target/linux/ramips/base-files/etc/board.d/01_leds
--- trunk.ORG/target/linux/ramips/base-files/etc/board.d/01_leds
2015-07-07 23:09:18.103418210 +0900
+++ trunk/target/linux/ramips/base-files/etc/board.d/01_leds2015-07-07 
23:10:41.643421592 +0900
@@ -261,6 +261,9 @@ case $board in
zte-q7)
set_wifi_led zte:blue:status
;;
+   mzk-dp150n)
+   ucidef_set_led_default power power mzkdp150n:green:power 
1
+   ;;
 esac
 
 board_config_flush
diff -uprN trunk.ORG/target/linux/ramips/base-files/etc/board.d/02_network 
trunk/target/linux/ramips/base-files/etc/board.d/02_network
--- trunk.ORG/target/linux/ramips/base-files/etc/board.d/02_network 
2015-07-07 23:09:18.103418210 +0900
+++ trunk/target/linux/ramips/base-files/etc/board.d/02_network 2015-07-07 
23:10:41.643421592 +0900
@@ -260,6 +260,13 @@ ramips_setup_interfaces()
ucidef_add_switch_vlan switch0 1 1 2 3 4 5t
ucidef_add_switch_vlan switch0 2 0 5t
;;
+
+   mzk-dp150n)
+   ucidef_set_interface_lan eth0.1
+   ucidef_add_switch switch0 1 1
+   ucidef_add_switch_vlan switch0 1 0 4 6t
+   ;;
+
*)
RT3X5X=`cat /proc/cpuinfo | egrep (RT3.5|RT5350)`
if [ -n ${RT3X5X} ]; then
diff -uprN trunk.ORG/target/linux/ramips/base-files/etc/diag.sh 
trunk/target/linux/ramips/base-files/etc/diag.sh
--- trunk.ORG/target/linux/ramips/base-files/etc/diag.sh2015-07-07 
23:09:18.103418210 +0900
+++ trunk/target/linux/ramips/base-files/etc/diag.sh2015-07-07 
23:10:41.643421592 +0900
@@ -249,6 +249,9 @@ get_status_led() {
zte-q7)
status_led=zte:red:status
;;
+   mzk-dp150n)
+   status_led=mzkdp150n:green:power
+   ;;
esac
 }
 
diff -uprN trunk.ORG/target/linux/ramips/base-files/lib/ramips.sh 
trunk/target/linux/ramips/base-files/lib/ramips.sh
--- trunk.ORG/target/linux/ramips/base-files/lib/ramips.sh  2015-07-07 
23:09:18.103418210 +0900
+++ trunk/target/linux/ramips/base-files/lib/ramips.sh  2015-07-07 
23:10:41.643421592 +0900
@@ -418,6 +418,9 @@ ramips_board_detect() {
*Mediatek MT7628AN evaluation board)
name=mt7628
;;
+   *Planex MZK-DP150N)
+   name=mzk-dp150n
+   ;;
*)
name=generic
;;
diff -uprN trunk.ORG/target/linux/ramips/base-files/lib/upgrade/platform.sh 
trunk/target/linux/ramips/base-files/lib/upgrade/platform.sh
--- trunk.ORG/target/linux/ramips/base-files/lib/upgrade/platform.sh
2015-07-07 23:09:18.103418210 +0900
+++ trunk/target/linux/ramips/base-files/lib/upgrade/platform.sh
2015-07-07 23:13:07.055427477 +0900
@@ -71,6 +71,7 @@ platform_check_image() {
mpr-a2 | \
mr-102n | \
mzk-w300nh2 | \
+   mzk-dp150n | \
nbg-419n | \
nw718 | \
omni-emb | \
diff -uprN trunk.ORG/target/linux/ramips/dts/MZK-DP150N.dts 
trunk/target/linux/ramips/dts/MZK-DP150N.dts
--- trunk.ORG/target/linux/ramips/dts/MZK-DP150N.dts1970-01-01 
09:00:00.0 +0900
+++ trunk/target/linux/ramips/dts/MZK-DP150N.dts2015-07-07 
23:10:41.643421592 +0900
@@ -0,0 +1,98 @@
+/dts-v1/;
+
+/include/ rt5350.dtsi
+
+/ {
+   compatible = MZK-DP150N, ralink,rt5350-soc;
+   model = Planex MZK-DP150N;
+
+   palmbus@1000 {
+   gpio1: gpio@660 {
+   status = okay;
+   };
+
+   spi@b00 {
+   status = okay;
+
+   m25p80@0 {
+   #address-cells = 1;
+   #size-cells = 1;
+   compatible = s25fl064k;
+   reg = 0;
+   linux,modalias = m25p80, s25fl064k;
+   spi-max-frequency = 1000;
+
+   partition@0 {
+   label = uboot;
+   reg = 0x0 0x3;
+   read-only;
+   };
+
+   partition@3 {
+   label = uboot-env;
+   reg = 0x3 0x1;
+   read-only;
+   };
+
+   factory: partition@4 {
+   label = factory;
+   reg = 0x4 0x1;
+   read-only;
+